Пример #1
0
 static DHCPv6PacketOptionFactory()
 {
     _constructorDict = new Dictionary <ushort, Func <byte[], DHCPv6PacketOption> >
     {
         { (UInt16)DHCPv6PacketOptionTypes.ClientIdentifier, (data) => DHCPv6PacketIdentifierOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.ServerIdentifer, (data) => DHCPv6PacketIdentifierOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.IdentityAssociation_NonTemporary, (data) => DHCPv6PacketIdentityAssociationNonTemporaryAddressesOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.IdentityAssociation_Temporary, (data) => DHCPv6PacketIdentityAssociationTemporaryAddressesOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.OptionRequest, (data) => DHCPv6PacketOptionRequestOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.Preference, (data) => DHCPv6PacketByteOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.ElapsedTime, (data) => DHCPv6PacketTimeOption.FromByteArray(data, 0, DHCPv6PacketTimeOption.DHCPv6PacketTimeOptionUnits.HundredsOfSeconds) },
         { (UInt16)DHCPv6PacketOptionTypes.ServerUnicast, (data) => DHCPv6PacketIPAddressOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.RapitCommit, (data) => DHCPv6PacketTrueOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.UserClass, (data) => DHCPv6PacketUserClassOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.VendorClass, (data) => DHCPv6PacketVendorClassOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.VendorOptions, (data) => DHCPv6PacketVendorSpecificInformationOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.InterfaceId, (data) => DHCPv6PacketByteArrayOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.Reconfigure, (data) => DHCPv6PacketReconfigureOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.ReconfigureAccepte, (data) => DHCPv6PacketTrueOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.IdentityAssociation_PrefixDelegation, (data) => DHCPv6PacketIdentityAssociationPrefixDelegationOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.InformationRefreshTime, (data) => DHCPv6PacketTimeOption.FromByteArray(data, 0, DHCPv6PacketTimeOption.DHCPv6PacketTimeOptionUnits.Seconds) },
         { (UInt16)DHCPv6PacketOptionTypes.RemoteIdentifier, (data) => DHCPv6PacketRemoteIdentifierOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.SOL_MAX_RT, (data) => DHCPv6PacketUInt32Option.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.INF_MAX_RT, (data) => DHCPv6PacketUInt32Option.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.DNSServer, (data) => DHCPv6PacketIPAddressListOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.NTPServer, (data) => DHCPv6PacketIPAddressListOption.FromByteArray(data, 0) },
         { (UInt16)DHCPv6PacketOptionTypes.SNTPServer, (data) => DHCPv6PacketIPAddressListOption.FromByteArray(data, 0) },
     };
 }
Пример #2
0
        public new static DHCPv6PacketReconfigureOption FromByteArray(Byte[] data, Int32 offset)
        {
            var byteOption = DHCPv6PacketByteOption.FromByteArray(data, offset);

            return(new DHCPv6PacketReconfigureOption((DHCPv6PacketTypes)byteOption.Value));
        }