internal override IpV6MobilityOption CreateInstance(DataSegment data)
        {
            if (data.Length < OptionDataMinimumLength)
            {
                return(null);
            }

            IpV6LocalMobilityAnchorAddressCode code = (IpV6LocalMobilityAnchorAddressCode)data[Offset.Code];

            switch (code)
            {
            case IpV6LocalMobilityAnchorAddressCode.IpV6:
            {
                if (data.Length != Offset.LocalMobilityAnchorAddress + IpV6Address.SizeOf)
                {
                    return(null);
                }
                IpV6Address localMobilityAnchorAddress = data.ReadIpV6Address(Offset.LocalMobilityAnchorAddress, Endianity.Big);
                return(new IpV6MobilityOptionLocalMobilityAnchorAddress(localMobilityAnchorAddress));
            }

            case IpV6LocalMobilityAnchorAddressCode.IpV4:
            {
                if (data.Length != Offset.LocalMobilityAnchorAddress + IpV4Address.SizeOf)
                {
                    return(null);
                }
                IpV4Address localMobilityAnchorAddress = data.ReadIpV4Address(Offset.LocalMobilityAnchorAddress, Endianity.Big);
                return(new IpV6MobilityOptionLocalMobilityAnchorAddress(localMobilityAnchorAddress));
            }

            default:
                return(null);
            }
        }
        internal override IpV6MobilityOption CreateInstance(DataSegment data)
        {
            if (data.Length < OptionDataMinimumLength)
            {
                return(null);
            }

            ushort bindingId = data.ReadUShort(Offset.BindingId, Endianity.Big);
            IpV6BindingAcknowledgementStatus status = (IpV6BindingAcknowledgementStatus)data[Offset.Status];
            bool simultaneousHomeAndForeignBinding  = data.ReadBool(Offset.SimultaneousHomeAndForeignBinding, Mask.SimultaneousHomeAndForeignBinding);
            byte priority = (byte)(data[Offset.Priority] & Mask.Priority);

            if (data.Length == OptionDataMinimumLength)
            {
                return(new IpV6MobilityOptionBindingIdentifier(bindingId, status, simultaneousHomeAndForeignBinding, priority));
            }
            if (data.Length == OptionDataMinimumLength + IpV4Address.SizeOf)
            {
                IpV4Address careOfAddress = data.ReadIpV4Address(Offset.CareOfAddress, Endianity.Big);
                return(new IpV6MobilityOptionBindingIdentifier(bindingId, status, simultaneousHomeAndForeignBinding, priority, careOfAddress));
            }
            if (data.Length == OptionDataMinimumLength + IpV6Address.SizeOf)
            {
                IpV6Address careOfAddress = data.ReadIpV6Address(Offset.CareOfAddress, Endianity.Big);
                return(new IpV6MobilityOptionBindingIdentifier(bindingId, status, simultaneousHomeAndForeignBinding, priority, careOfAddress));
            }
            return(null);
        }
Example #3
0
 /// <summary>
 /// Creates an instance from next header, checksum, status, home address and options.
 /// </summary>
 /// <param name="nextHeader">
 /// Identifies the type of header immediately following this extension header.
 /// </param>
 /// <param name="checksum">
 /// Contains the checksum of the Mobility Header.
 /// The checksum is calculated from the octet string consisting of a "pseudo-header"
 /// followed by the entire Mobility Header starting with the Payload Proto field.
 /// The checksum is the 16-bit one's complement of the one's complement sum of this string.
 /// </param>
 /// <param name="status">Indicating the reason for this message.</param>
 /// <param name="homeAddress">
 /// The home address that was contained in the Home Address destination option.
 /// The mobile node uses this information to determine which binding does not exist, in cases where the mobile node has several home addresses.
 /// </param>
 /// <param name="options">
 /// Zero or more TLV-encoded mobility options.
 /// </param>
 public IpV6ExtensionHeaderMobilityBindingError(IpV4Protocol?nextHeader, ushort checksum, IpV6BindingErrorStatus status, IpV6Address homeAddress,
                                                IpV6MobilityOptions options)
     : base(nextHeader, checksum, options, MessageDataOffset.Options)
 {
     Status      = status;
     HomeAddress = homeAddress;
 }
Example #4
0
        internal override IpV6MobilityOption CreateInstance(DataSegment data)
        {
            if (data.Length < OptionDataMinimumLength)
            {
                return(null);
            }

            bool isIpV4 = data.ReadBool(Offset.IsIpV4, Mask.IsIpV4);
            bool isIpV6 = data.ReadBool(Offset.IsIpV6, Mask.IsIpV6);

            if (isIpV4 && !isIpV6)
            {
                if (data.Length != OptionDataMinimumLength + IpV4Address.SizeOf)
                {
                    return(null);
                }
                IpV4Address localMobilityAddress = data.ReadIpV4Address(Offset.LocalMobilityAddress, Endianity.Big);
                return(new IpV6MobilityOptionRedirect(localMobilityAddress));
            }
            if (isIpV6 && !isIpV4)
            {
                if (data.Length != OptionDataMinimumLength + IpV6Address.SizeOf)
                {
                    return(null);
                }
                IpV6Address localMobilityAddress = data.ReadIpV6Address(Offset.LocalMobilityAddress, Endianity.Big);
                return(new IpV6MobilityOptionRedirect(localMobilityAddress));
            }

            return(null);
        }
Example #5
0
        internal static IpV6ExtensionHeaderMobilityHomeAgentSwitchMessage ParseMessageData(IpV4Protocol nextHeader, ushort checksum, DataSegment messageData)
        {
            if (messageData.Length < MinimumMessageDataLength)
            {
                return(null);
            }

            byte numberOfAddresses      = messageData[MessageDataOffset.NumberOfAddresses];
            int  homeAgentAddressesSize = numberOfAddresses * IpV6Address.SizeOf;

            if (messageData.Length < MinimumMessageDataLength + homeAgentAddressesSize)
            {
                return(null);
            }

            IpV6Address[] homeAgentAddresses = new IpV6Address[numberOfAddresses];
            for (int i = 0; i != numberOfAddresses; ++i)
            {
                homeAgentAddresses[i] = messageData.ReadIpV6Address(MessageDataOffset.HomeAgentAddresses + i * IpV6Address.SizeOf, Endianity.Big);
            }

            int optionsOffset           = MessageDataOffset.HomeAgentAddresses + homeAgentAddressesSize;
            IpV6MobilityOptions options = new IpV6MobilityOptions(messageData.Subsegment(optionsOffset, messageData.Length - optionsOffset));

            return(new IpV6ExtensionHeaderMobilityHomeAgentSwitchMessage(nextHeader, checksum, homeAgentAddresses, options));
        }
Example #6
0
 private static bool IsAddressSuffixTooSmall(byte prefixLength, IpV6Address addressSuffix)
 {
     if ((int)prefixLength < 128)
     {
         return(addressSuffix.ToValue() < UInt128.One << (int)sbyte.MaxValue - (int)prefixLength);
     }
     return(false);
 }
Example #7
0
 private static bool IsAddressSuffixTooBig(byte prefixLength, IpV6Address addressSuffix)
 {
     if ((int)prefixLength > 0)
     {
         return(addressSuffix.ToValue() >= UInt128.One << 128 - (int)prefixLength);
     }
     return(false);
 }
Example #8
0
        internal override IpV6Option CreateInstance(DataSegment data)
        {
            if (data.Length != OptionDataLength)
            {
                return(null);
            }
            IpV6Address homeAddress = data.ReadIpV6Address(0, Endianity.Big);

            return(new IpV6OptionHomeAddress(homeAddress));
        }
Example #9
0
        internal static bool Read(DataSegment data, out IpV6Address address)
        {
            if (data.Length != OptionDataLength)
            {
                address = IpV6Address.Zero;
                return(false);
            }

            address = data.ReadIpV6Address(0, Endianity.Big);
            return(true);
        }
        internal static bool Read(DataSegment data, out IpV6Address address)
        {
            if (data.Length != OptionDataLength)
            {
                address = IpV6Address.Zero;
                return false;
            }

            address = data.ReadIpV6Address(0, Endianity.Big);
            return true;
        }
        internal static IpV6ExtensionHeaderRoutingHomeAddress ParseRoutingData(IpV4Protocol nextHeader, byte segmentsLeft, DataSegment routingData)
        {
            if (routingData.Length != ConstRoutingDataLength)
            {
                return(null);
            }

            IpV6Address homeAddress = routingData.ReadIpV6Address(RoutingDataOffset.HomeAddress, Endianity.Big);

            return(new IpV6ExtensionHeaderRoutingHomeAddress(nextHeader, segmentsLeft, homeAddress));
        }
Example #12
0
        public override sealed string ToString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(base.ToString());
            stringBuilder.Append(" ");
            IpV6Address ipV6Address = this._address;

            stringBuilder.Append((object)ipV6Address);
            return(stringBuilder.ToString());
        }
Example #13
0
        private static void ValidateCommonPrefixForAddress(IpV6Address[] addresses, int addressIndex, byte commonPrefixLength)
        {
            IpV6Address address = addresses[addressIndex];

            if (address.ToValue() >> (8 * (IpV6Address.SizeOf - commonPrefixLength)) != 0)
            {
                throw new ArgumentOutOfRangeException("addresses", address,
                                                      string.Format(CultureInfo.InvariantCulture,
                                                                    "When an address has {0} common bytes, it should start with {0} zero bytes.",
                                                                    commonPrefixLength));
            }
        }
Example #14
0
        internal override IpV6MobilityOption CreateInstance(DataSegment data)
        {
            if (data.Length != OptionDataLength)
            {
                return(null);
            }

            IpV6MobilityIpV6AddressPrefixCode code = (IpV6MobilityIpV6AddressPrefixCode)data[Offset.Code];
            byte        prefixLength    = data[Offset.PrefixLength];
            IpV6Address addressOrPrefix = data.ReadIpV6Address(Offset.AddressOrPrefix, Endianity.Big);

            return(new IpV6MobilityOptionIpV6AddressPrefix(code, prefixLength, addressOrPrefix));
        }
Example #15
0
        /// <summary>
        /// Creates an instance from code, prefix length and address or prefix.
        /// </summary>
        /// <param name="code">Describes the kind of the address or the prefix.</param>
        /// <param name="prefixLength">
        /// Indicates the length of the IPv6 Address Prefix.
        /// The value ranges from 0 to 128.
        /// </param>
        /// <param name="addressOrPrefix">The IP address/prefix defined by the Option-Code field.</param>
        public IpV6MobilityOptionIpV6AddressPrefix(IpV6MobilityIpV6AddressPrefixCode code, byte prefixLength, IpV6Address addressOrPrefix)
            : base(IpV6MobilityOptionType.IpV6AddressPrefix)
        {
            if (prefixLength > MaxPrefixLength)
            {
                throw new ArgumentOutOfRangeException("prefixLength", prefixLength,
                                                      string.Format(CultureInfo.InvariantCulture, "Max value is {0}", MaxPrefixLength));
            }

            Code            = code;
            PrefixLength    = prefixLength;
            AddressOrPrefix = addressOrPrefix;
        }
Example #16
0
        internal static IpV6ExtensionHeaderMobilityBindingError ParseMessageData(IpV4Protocol nextHeader, ushort checksum, DataSegment messageData)
        {
            if (messageData.Length < MinimumMessageDataLength)
            {
                return(null);
            }

            IpV6BindingErrorStatus status      = (IpV6BindingErrorStatus)messageData[MessageDataOffset.Status];
            IpV6Address            homeAddress = messageData.ReadIpV6Address(MessageDataOffset.HomeAddress, Endianity.Big);
            IpV6MobilityOptions    options     = new IpV6MobilityOptions(messageData.Subsegment(MessageDataOffset.Options, messageData.Length - MessageDataOffset.Options));

            return(new IpV6ExtensionHeaderMobilityBindingError(nextHeader, checksum, status, homeAddress, options));
        }
        internal static bool Read(DataSegment data, out byte prefixLength, out IpV6Address networkPrefix)
        {
            if (data.Length != OptionDataLength)
            {
                prefixLength  = 0;
                networkPrefix = IpV6Address.Zero;
                return(false);
            }

            prefixLength  = data[Offset.PrefixLength];
            networkPrefix = data.ReadIpV6Address(Offset.NetworkPrefix, Endianity.Big);
            return(true);
        }
Example #18
0
        /// <summary>
        /// Parses an option from the given data.
        /// </summary>
        /// <param name="data">The data to parse.</param>
        /// <returns>The option if parsing was successful, null otherwise.</returns>
        public IpV6Option CreateInstance(DataSegment data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }
            if (data.Length != OptionDataLength)
            {
                return(null);
            }
            IpV6Address homeAddress = data.ReadIpV6Address(0, Endianity.Big);

            return(new IpV6OptionHomeAddress(homeAddress));
        }
Example #19
0
        public static string GetWiresharkString(this IpV6Address address)
        {
            string str = address.ToString("x");

            if (str.StartsWith("0:0:"))
            {
                str = "::" + str.Substring(4);
            }
            if (str.EndsWith(":0:0"))
            {
                str = str.Substring(0, str.Length - 4) + "::";
            }
            str = str.Replace(":0:0:", "::");
            return(str);
        }
Example #20
0
        /// <summary>
        /// Constructs the resource data from the prefix length, address suffix and prefix name fields.
        /// </summary>
        /// <param name="prefixLength">Encoded as an eight-bit unsigned integer with value between 0 and 128 inclusive.</param>
        /// <param name="addressSuffix">
        /// An IPv6 address suffix, encoded in network order (high-order octet first).
        /// There must be exactly enough octets in this field to contain a number of bits equal to 128 minus prefix length,
        /// with 0 to 7 leading pad bits to make this field an integral number of octets.
        /// Pad bits, if present, must be set to zero when loading a zone file and ignored (other than for SIG verification) on reception.
        /// </param>
        /// <param name="prefixName">The name of the prefix, encoded as a domain name. This name must not be compressed. </param>
        public DnsResourceDataA6(byte prefixLength, IpV6Address addressSuffix, DnsDomainName prefixName)
        {
            if (IsAddressSuffixTooSmall(prefixLength, addressSuffix))
            {
                throw new ArgumentOutOfRangeException("addressSuffix",
                                                      string.Format(CultureInfo.InvariantCulture, "Value is too small for prefix length {0}", prefixLength));
            }
            if (IsAddressSuffixTooBig(prefixLength, addressSuffix))
            {
                throw new ArgumentOutOfRangeException("addressSuffix",
                                                      string.Format(CultureInfo.InvariantCulture, "Value is too big for prefix length {0}", prefixLength));
            }

            PrefixLength  = prefixLength;
            AddressSuffix = addressSuffix;
            PrefixName    = prefixName;
        }
Example #21
0
        internal override DnsResourceData CreateInstance(DnsDatagram dns, int offsetInDns, int length)
        {
            if (length < MinimumLength)
            {
                return(null);
            }

            byte prefixLength = dns[offsetInDns + Offset.PrefixLength];

            if (prefixLength > MaxPrefixLength)
            {
                return(null);
            }
            offsetInDns += ConstantPartLength;
            length      -= ConstantPartLength;

            int addressSuffixLength = CalculateAddressSuffixLength(prefixLength);

            if (length < addressSuffixLength)
            {
                return(null);
            }
            IpV6Address addressSuffix = new IpV6Address((UInt128)dns.ReadUnsignedBigInteger(offsetInDns, addressSuffixLength, Endianity.Big));

            offsetInDns += addressSuffixLength;
            length      -= addressSuffixLength;

            if (IsAddressSuffixTooSmall(prefixLength, addressSuffix) || IsAddressSuffixTooBig(prefixLength, addressSuffix))
            {
                return(null);
            }

            DnsDomainName prefixName;
            int           prefixNameLength;

            if (!DnsDomainName.TryParse(dns, offsetInDns, length, out prefixName, out prefixNameLength))
            {
                return(null);
            }
            if (prefixNameLength != length)
            {
                return(null);
            }

            return(new DnsResourceDataA6(prefixLength, addressSuffix, prefixName));
        }
Example #22
0
 public DnsResourceDataA6(byte prefixLength, IpV6Address addressSuffix, DnsDomainName prefixName)
 {
     if (DnsResourceDataA6.IsAddressSuffixTooSmall(prefixLength, addressSuffix))
     {
         throw new ArgumentOutOfRangeException("addressSuffix", string.Format((IFormatProvider)CultureInfo.InvariantCulture, "Value is too small for prefix length {0}", new object[1]
         {
             (object)prefixLength
         }));
     }
     if (DnsResourceDataA6.IsAddressSuffixTooBig(prefixLength, addressSuffix))
     {
         throw new ArgumentOutOfRangeException("addressSuffix", string.Format((IFormatProvider)CultureInfo.InvariantCulture, "Value is too big for prefix length {0}", new object[1]
         {
             (object)prefixLength
         }));
     }
     this.PrefixLength  = prefixLength;
     this.AddressSuffix = addressSuffix;
     this.PrefixName    = prefixName;
 }
Example #23
0
        internal override DnsResourceData CreateInstance(DnsDatagram dns, int offsetInDns, int length)
        {
            if (length < 2)
            {
                return((DnsResourceData)null);
            }
            byte prefixLength = dns[offsetInDns];

            if ((int)prefixLength > 128)
            {
                return((DnsResourceData)null);
            }
            ++offsetInDns;
            --length;
            int length1 = DnsResourceDataA6.CalculateAddressSuffixLength(prefixLength);

            if (length < length1)
            {
                return((DnsResourceData)null);
            }
            IpV6Address addressSuffix = new IpV6Address((UInt128)dns.ReadUnsignedBigInteger(offsetInDns, length1, Endianity.Big));

            offsetInDns += length1;
            length      -= length1;
            if (DnsResourceDataA6.IsAddressSuffixTooSmall(prefixLength, addressSuffix) || DnsResourceDataA6.IsAddressSuffixTooBig(prefixLength, addressSuffix))
            {
                return((DnsResourceData)null);
            }
            DnsDomainName domainName;
            int           numBytesRead;

            if (!DnsDomainName.TryParse(dns, offsetInDns, length, out domainName, out numBytesRead))
            {
                return((DnsResourceData)null);
            }
            if (numBytesRead != length)
            {
                return((DnsResourceData)null);
            }
            return((DnsResourceData) new DnsResourceDataA6(prefixLength, addressSuffix, domainName));
        }
Example #24
0
        internal static IpV6ExtensionHeaderRoutingSourceRoute ParseRoutingData(IpV4Protocol nextHeader, byte segmentsLeft, DataSegment routingData)
        {
            if (routingData.Length < RoutingDataMinimumLength)
            {
                return(null);
            }

            if ((routingData.Length - RoutingDataMinimumLength) % IpV6Address.SizeOf != 0)
            {
                return(null);
            }

            int numAddresses = (routingData.Length - RoutingDataMinimumLength) / IpV6Address.SizeOf;

            IpV6Address[] addresses = new IpV6Address[numAddresses];
            for (int i = 0; i != numAddresses; ++i)
            {
                addresses[i] = routingData.ReadIpV6Address(RoutingDataOffset.Addresses + i * IpV6Address.SizeOf, Endianity.Big);
            }
            return(new IpV6ExtensionHeaderRoutingSourceRoute(nextHeader, segmentsLeft, addresses));
        }
Example #25
0
        internal static IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased CreateSpecificInstance(DataSegment data)
        {
            IpV6TaggerIdType taggerIdType = (IpV6TaggerIdType)((data[Offset.TaggerIdType] & Mask.TaggerIdType) >> Shift.TaggerIdType);
            int taggerIdLength            = (taggerIdType == IpV6TaggerIdType.Null ? 0 : (data[Offset.TaggerIdLength] & Mask.TaggerIdLength) + 1);

            if (data.Length < Offset.TaggerId + taggerIdLength)
            {
                return(null);
            }
            DataSegment identifier = data.Subsegment(Offset.TaggerId + taggerIdLength, data.Length - Offset.TaggerId - taggerIdLength);

            switch (taggerIdType)
            {
            case IpV6TaggerIdType.Null:
                return(new IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionNull(identifier));

            case IpV6TaggerIdType.Default:
                return(new IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionDefault(data.Subsegment(Offset.TaggerId, taggerIdLength), identifier));

            case IpV6TaggerIdType.IpV4:
                if (taggerIdLength != IpV4Address.SizeOf)
                {
                    return(null);
                }
                IpV4Address ipV4Address = data.ReadIpV4Address(Offset.TaggerId, Endianity.Big);
                return(new IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV4(ipV4Address, identifier));

            case IpV6TaggerIdType.IpV6:
                if (taggerIdLength != IpV6Address.SizeOf)
                {
                    return(null);
                }
                IpV6Address ipV6Address = data.ReadIpV6Address(Offset.TaggerId, Endianity.Big);
                return(new IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV6(ipV6Address, identifier));

            default:
                return(null);
            }
        }
        public void IpV6AddressRandomTest()
        {
            Random random = new Random();

            for (int i = 0; i != 1000; ++i)
            {
                IpV6Address address = random.NextIpV6Address();

                Assert.AreEqual(address, new IpV6Address(address.ToString()));
                Assert.IsTrue(address == new IpV6Address(address.ToString()));
                Assert.IsFalse(address != new IpV6Address(address.ToString()));
                Assert.AreEqual(address.GetHashCode(), new IpV6Address(address.ToString()).GetHashCode());
                Assert.AreEqual(address, new IpV6Address(address.ToValue()));

                Assert.AreNotEqual(address, random.NextIpV6Address());
                Assert.IsFalse(address == random.NextIpV6Address());
                Assert.IsTrue(address != random.NextIpV6Address());
                Assert.AreNotEqual(address.GetHashCode(), random.NextIpV6Address().GetHashCode());

                Assert.AreNotEqual(2, address);
                Assert.IsFalse(address.Equals(null));
            }
        }
 /// <summary>
 /// Creates an instance from binding id, status, simulatneous home and foreign binding, priority and IPv6 care of address.
 /// </summary>
 /// <param name="bindingId">
 /// The BID that is assigned to the binding indicated by the care-of address in the Binding Update or the Binding Identifier mobility option.
 /// The value of zero is reserved and should not be used.
 /// </param>
 /// <param name="status">
 /// When the Binding Identifier mobility option is included in a Binding Acknowledgement,
 /// this field overwrites the Status field in the Binding Acknowledgement only for this BID.
 /// If this field is set to zero, the receiver ignores this field and uses the registration status stored in the Binding Acknowledgement message.
 /// The receiver must ignore this field if the Binding Identifier mobility option is not carried within either the Binding Acknowledgement
 /// or the Care-of Test messages.
 /// The possible status codes are the same as the status codes of the Binding Acknowledgement.
 /// This Status field is also used to carry error information related to the care-of address test in the Care-of Test message.
 /// </param>
 /// <param name="simultaneousHomeAndForeignBinding">
 /// Indicates that the mobile node registers multiple bindings to the home agent while it is attached to the home link.
 /// This flag is valid only for a Binding Update sent to the home agent.
 /// </param>
 /// <param name="priority">
 /// Places each BID to a relative priority (PRI) with other registered BIDs.
 /// Value '0' is reserved and must not be used.
 /// A lower number in this field indicates a higher priority, while BIDs with the same BID-PRI value have equal priority meaning that,
 /// the BID used is an implementation issue.
 /// This is consistent with current practice in packet classifiers.
 /// </param>
 /// <param name="careOfAddress">
 /// The IPv6 care-of address for the corresponding BID.
 /// </param>
 public IpV6MobilityOptionBindingIdentifier(ushort bindingId, IpV6BindingAcknowledgementStatus status, bool simultaneousHomeAndForeignBinding,
                                            byte priority, IpV6Address careOfAddress)
     : this(bindingId, status, simultaneousHomeAndForeignBinding, priority, null, careOfAddress)
 {
 }
Example #28
0
 public IpV6OptionSmfDpdIpV6(IpV6Address taggerId, DataSegment identifier)
     : base(identifier)
 {
     TaggerId = taggerId;
 }
 /// <summary>
 /// Creates an instance from prefix length and home network prefix.
 /// </summary>
 /// <param name="prefixLength">Indicates the prefix length of the IPv6 prefix contained in the option.</param>
 /// <param name="homeNetworkPrefix">Contains the Home Network Prefix.</param>
 public IpV6MobilityOptionHomeNetworkPrefix(byte prefixLength, IpV6Address homeNetworkPrefix)
     : base(IpV6MobilityOptionType.HomeNetworkPrefix, prefixLength, homeNetworkPrefix)
 {
 }
Example #30
0
 internal IpV6MobilityOptionIpV6Address(IpV6MobilityOptionType type, IpV6Address address)
     : base(type)
 {
     Address = address;
 }
 public IpV6OptionHomeAddress(IpV6Address homeAddress)
     : base(IpV6OptionType.HomeAddress)
 {
     HomeAddress = homeAddress;
 }
 /// <summary>
 /// Create an instance from prefix length and mobile network prefix.
 /// </summary>
 /// <param name="prefixLength">Indicates the prefix length of the IPv6 prefix contained in the option.</param>
 /// <param name="mobileNetworkPrefix">Contains the Mobile Network Prefix.</param>
 public IpV6MobilityOptionMobileNetworkPrefix(byte prefixLength, IpV6Address mobileNetworkPrefix)
     : base(IpV6MobilityOptionType.MobileNetworkPrefix, prefixLength, mobileNetworkPrefix)
 {
 }
 internal IpV6MobilityOptionIpV6Address(IpV6MobilityOptionType type, IpV6Address address)
     : base(type)
 {
     Address = address;
 }
 /// <summary>
 /// Creates an instance from link local address.
 /// </summary>
 /// <param name="linkLocalAddress">
 /// Contains the link-local address.
 /// </param>
 public IpV6MobilityOptionLinkLocalAddress(IpV6Address linkLocalAddress)
     : base(IpV6MobilityOptionType.LinkLocalAddress, linkLocalAddress)
 {
 }
 /// <summary>
 /// Creates an instance from tagger id and identifier.
 /// </summary>
 /// <param name="taggerId">
 /// Used to differentiate multiple ingressing border gateways that may commonly apply the SMF_DPD option header to packets from a particular source.
 /// </param>
 /// <param name="identifier">
 /// DPD packet Identifier.
 /// When the TaggerId field is present, the Identifier can be considered a unique packet identifier 
 /// in the context of the TaggerId:srcAddr:dstAddr tuple.
 /// When the TaggerId field is not present, then it is assumed that the source applied the SMF_DPD option 
 /// and the Identifier can be considered unique in the context of the IPv6 packet header srcAddr:dstAddr tuple.
 /// </param>
 public IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV6(IpV6Address taggerId, DataSegment identifier)
     : base(identifier)
 {
     TaggerId = taggerId;
 }
 public IpV6OptionSmfDpdIpV6(IpV6Address taggerId, DataSegment identifier)
     : base(identifier)
 {
     TaggerId = taggerId;
 }
Example #37
0
 /// <summary>
 /// Creates an instance from home address.
 /// </summary>
 /// <param name="homeAddress">
 /// The home address of the mobile node sending the packet.
 /// This address must be a unicast routable address.
 /// </param>
 public IpV6OptionHomeAddress(IpV6Address homeAddress)
     : base(IpV6OptionType.HomeAddress)
 {
     HomeAddress = homeAddress;
 }
 /// <summary>
 /// Creates an instance from an alternative care of address.
 /// </summary>
 /// <param name="alternateCareOfAddress">
 /// Contains an address to use as the care-of address for the binding, rather than using the Source Address of the packet as the care-of address.
 /// </param>
 public IpV6MobilityOptionAlternateCareOfAddress(IpV6Address alternateCareOfAddress)
     : base(IpV6MobilityOptionType.AlternateCareOfAddress, alternateCareOfAddress)
 {
 }
Example #39
0
 public DnsGatewayIpV6(IpV6Address value)
 {
     this.Value = value;
 }
 /// <summary>
 /// Creates an instance from address.
 /// </summary>
 /// <param name="address">Contains the MAG's IPv6 address.</param>
 public IpV6MobilityOptionMobileAccessGatewayIpV6Address(IpV6Address address)
     : base(IpV6MobilityOptionType.MobileAccessGatewayIpV6Address)
 {
     Address = address;
 }