Exemplo n.º 1
0
        public void AddDomainSearchListOption(string[] domains)
        {
            DHCPv6Option opt = new DHCPv6Option();

            opt.Option = DHCPv6OptionCode.DomainList;
            opt.Value  = CreateDomainSearchListValue(domains);
            opt.Length = (short)opt.Value.Length;
            Options.Add(DHCPv6OptionCode.DomainList, opt);
        }
Exemplo n.º 2
0
        public void ParsePacket(byte[] PacketData)
        {
            using (MemoryStream ms = new MemoryStream(PacketData))
            {
                using (BinaryReader br = new BinaryReader(ms))
                {
                    MessageType = (DHCPv6Type)br.ReadByte();
                    TransactionId = br.ReadBytes(3);

                    do
                    {
                        DHCPv6Option opt = new DHCPv6Option();
                        opt.Option = (DHCPv6OptionCode)IPAddress.NetworkToHostOrder(br.ReadInt16());
                        opt.Length = IPAddress.NetworkToHostOrder(br.ReadInt16());
                        opt.Value = br.ReadBytes(opt.Length);
                        Options.Add(opt.Option, opt);
                    } while (br.BaseStream.Position < br.BaseStream.Length);
                }
            }
        }
Exemplo n.º 3
0
        public void ParsePacket(byte[] PacketData)
        {
            using (MemoryStream ms = new MemoryStream(PacketData))
            {
                using (BinaryReader br = new BinaryReader(ms))
                {
                    MessageType   = (DHCPv6Type)br.ReadByte();
                    TransactionId = br.ReadBytes(3);

                    do
                    {
                        DHCPv6Option opt = new DHCPv6Option();
                        opt.Option = (DHCPv6OptionCode)IPAddress.NetworkToHostOrder(br.ReadInt16());
                        opt.Length = IPAddress.NetworkToHostOrder(br.ReadInt16());
                        opt.Value  = br.ReadBytes(opt.Length);
                        Options.Add(opt.Option, opt);
                    } while (br.BaseStream.Position < br.BaseStream.Length);
                }
            }
        }
Exemplo n.º 4
0
 public void AddDomainSearchListOption(string[] domains)
 {
     DHCPv6Option opt = new DHCPv6Option();
     opt.Option = DHCPv6OptionCode.DomainList;
     opt.Value = CreateDomainSearchListValue(domains);
     opt.Length = (short)opt.Value.Length;
     Options.Add(DHCPv6OptionCode.DomainList, opt);
 }