Commit c997f2f5 authored by Brickner_cp's avatar Brickner_cp

5 warnings left.

Code Coverage 95.91%
parent 5c5d2b2f
<?xml version="1.0" encoding="utf-8" ?>
<Dictionary>
<Words>
<Unrecognized>
<!--Word>cb</Word-->
</Unrecognized>
<Recognized>
<Word>aaaa</Word>
<Word>ack</Word>
<Word>additionals</Word>
<Word>afi</Word>
<Word>afs</Word>
<Word>aris</Word>
<Word>arp</Word>
<Word>asn</Word>
<Word>autonet</Word>
<Word>avb</Word>
<Word>ax</Word>
<Word>axfr</Word>
<Word>bbn</Word> <!-- Probably BBN Technologies (originally Bolt, Beranek and Newman) -->
<Word>calipso</Word>
<Word>cbt</Word>
<Word>ccitt</Word>
<Word>cftp</Word> <!-- maybe Configurable Fault Tolerant Processor -->
<Word>codings</Word>
<Word>datagrams</Word>
<Word>datakit</Word>
<Word>dce</Word>
<Word>dcn</Word>
<Word>docsis</Word>
<Word>dss</Word>
<Word>emcon</Word>
<Word>endianity</Word>
<Word>enqueueing</Word>
<Word>eof</Word>
<Word>expak</Word>
<Word>fibre</Word>
<Word>firefox</Word>
<Word>genser</Word>
<Word>gid</Word>
<Word>gmtp</Word>
<Word>gost</Word>
<Word>gss</Word>
<Word>gwid</Word>
<Word>hiparp</Word>
<Word>iclfxbm</Word>
<Word>icmp</Word>
<Word>igmp</Word>
<Word>infini</Word>
<Word>internetwork</Word>
<Word>internodal</Word>
<Word>ipgp</Word>
<Word>iplt</Word>
<Word>ipsilon</Word> <!-- As in Ipsilon Networks -->
<Word>ipx</Word>
<Word>ixfr</Word>
<Word>keygen</Word>
<Word>kryptolan</Word>
<Word>lite</Word>
<Word>llq</Word>
<Word>md</Word>
<Word>metricom</Word>
<Word>multimegabit</Word>
<Word>multiprotocol</Word>
<Word>nca</Word>
<Word>netmask</Word>
<Word>nonces</Word>
<Word>nsa</Word>
<Word>osi</Word>
<Word>pcap</Word>
<Word>pgp</Word>
<Word>pkix</Word>
<Word>prespecified</Word>
<Word>proteon</Word>
<Word>qnx</Word> <!-- www.qnx.com -->
<Word>rcc</Word>
<Word>rpcap</Word>
<Word>satnet</Word>
<Word>sha</Word>
<Word>sitara</Word>
<Word>sll</Word>
<Word>sna</Word>
<Word>ssh</Word>
<Word>tcf</Word>
<Word>tcn</Word>
<Word>ttl</Word>
<Word>ttp</Word>
<Word>twinaxial</Word>
<Word>uid</Word>
<Word>unicast</Word>
<Word>uti</Word>
<Word>vpn</Word>
<Word>wi</Word>
<Word>wiegand</Word>
<Word>wo</Word>
<Word>xtp</Word>
<Word>yx</Word> <!--Yet exists?-->
</Recognized>
<Deprecated>
<!--Term PreferredAlternate="EnterpriseServices">complus</Term-->
</Deprecated>
<Compound>
<!--Term CompoundAlternate="DataStore">datastore</Term-->
</Compound>
<DiscreteExceptions>
<!--Term>netmask</Term-->
</DiscreteExceptions>
</Words>
<Acronyms>
<CasingExceptions>
<Acronym>Ip</Acronym>
<Acronym>Iv</Acronym>
<Acronym>Ms</Acronym>
<Acronym>Nd</Acronym>
<Acronym>Ns</Acronym>
<Acronym>Os</Acronym>
<Acronym>Sm</Acronym>
</CasingExceptions>
</Acronyms>
<Words>
<Unrecognized>
<!--Word>cb</Word-->
</Unrecognized>
<Recognized>
<Word>aaaa</Word>
<Word>ack</Word>
<Word>additionals</Word>
<Word>afi</Word>
<Word>afs</Word>
<Word>aris</Word>
<Word>arp</Word>
<Word>asn</Word>
<Word>autonet</Word>
<Word>avb</Word>
<Word>ax</Word>
<Word>axfr</Word>
<Word>bbn</Word> <!-- Probably BBN Technologies (originally Bolt, Beranek and Newman) -->
<Word>calipso</Word>
<Word>cbt</Word>
<Word>ccitt</Word>
<Word>cftp</Word> <!-- maybe Configurable Fault Tolerant Processor -->
<Word>codings</Word>
<Word>datagrams</Word>
<Word>datakit</Word>
<Word>dce</Word>
<Word>dcn</Word>
<Word>docsis</Word>
<Word>dss</Word>
<Word>emcon</Word>
<Word>endianity</Word>
<Word>enqueueing</Word>
<Word>eof</Word>
<Word>expak</Word>
<Word>fibre</Word>
<Word>firefox</Word>
<Word>fm</Word>
<Word>genser</Word>
<Word>gid</Word>
<Word>gmtp</Word>
<Word>gost</Word>
<Word>gss</Word>
<Word>gwid</Word>
<Word>hiparp</Word>
<Word>iclfxbm</Word>
<Word>icmp</Word>
<Word>igmp</Word>
<Word>infini</Word>
<Word>internetwork</Word>
<Word>internodal</Word>
<Word>ipgp</Word>
<Word>iplt</Word>
<Word>ipsilon</Word> <!-- As in Ipsilon Networks -->
<Word>ipx</Word>
<Word>ixfr</Word>
<Word>keygen</Word>
<Word>kryptolan</Word>
<Word>lite</Word>
<Word>llq</Word>
<Word>lossy</Word>
<Word>md</Word>
<Word>metricom</Word>
<Word>multimegabit</Word>
<Word>multiprotocol</Word>
<Word>nca</Word>
<Word>netmask</Word>
<Word>nonces</Word>
<Word>nsa</Word>
<Word>osi</Word>
<Word>pcap</Word>
<Word>pgp</Word>
<Word>pkix</Word>
<Word>prespecified</Word>
<Word>proteon</Word>
<Word>qnx</Word> <!-- www.qnx.com -->
<Word>rcc</Word>
<Word>rpcap</Word>
<Word>satnet</Word>
<Word>sha</Word>
<Word>sitara</Word>
<Word>sll</Word>
<Word>sna</Word>
<Word>ssh</Word>
<Word>tcf</Word>
<Word>tcn</Word>
<Word>ttl</Word>
<Word>ttp</Word>
<Word>twinaxial</Word>
<Word>uid</Word>
<Word>unicast</Word>
<Word>uti</Word>
<Word>vpn</Word>
<Word>wi</Word>
<Word>wiegand</Word>
<Word>wo</Word>
<Word>xtp</Word>
<Word>yx</Word> <!--Yet exists?-->
</Recognized>
<Deprecated>
<!--Term PreferredAlternate="EnterpriseServices">complus</Term-->
</Deprecated>
<Compound>
<Term CompoundAlternate="AddressOr">addressor</Term>
</Compound>
<DiscreteExceptions>
<!--Term>netmask</Term-->
</DiscreteExceptions>
</Words>
<Acronyms>
<CasingExceptions>
<Acronym>Ip</Acronym>
<Acronym>Iv</Acronym>
<Acronym>Ms</Acronym>
<Acronym>Nd</Acronym>
<Acronym>Ns</Acronym>
<Acronym>Os</Acronym>
<Acronym>Sm</Acronym>
</CasingExceptions>
</Acronyms>
</Dictionary>
\ No newline at end of file
......@@ -315,7 +315,7 @@ namespace PcapDotNet.Core.Test
break;
case " Unknown (4 bytes)":
MoreAssert.IsInRange((ushort)IpV6RouterAlertType.ActiveNetwork, (ushort)IpV6RouterAlertType.NsisNatfwNslp, (ushort)routerAlert.RouterAlertType);
MoreAssert.IsInRange((ushort)IpV6RouterAlertType.ActiveNetwork, (ushort)IpV6RouterAlertType.NextStepsInSignalingNatFirewallLayerProtocol, (ushort)routerAlert.RouterAlertType);
headerField.AssertValueInRange(0x05020002, 0x05020044);
break;
......
......@@ -436,7 +436,7 @@ namespace PcapDotNet.Core.Test
break;
case "mip6.bu.p_flag":
subfield.AssertShowDecimal(bindingUpdate.ProxyRegistrationFlag);
subfield.AssertShowDecimal(bindingUpdate.ProxyRegistration);
break;
case "mip6.bu.f_flag":
......@@ -444,7 +444,7 @@ namespace PcapDotNet.Core.Test
break;
case "mip6.bu.t_flag":
subfield.AssertShowDecimal(bindingUpdate.TlvHeaderFormat);
subfield.AssertShowDecimal(bindingUpdate.TypeLengthValueHeaderFormat);
break;
case "mip6.bu.lifetime":
......@@ -481,7 +481,7 @@ namespace PcapDotNet.Core.Test
break;
case "mip6.ba.t_flag":
subfield.AssertShowDecimal(bindingAcknowledgement.TlvHeaderFormat);
subfield.AssertShowDecimal(bindingAcknowledgement.TypeLengthValueHeaderFormat);
break;
case "mip6.ba.seqnr":
......@@ -729,7 +729,7 @@ namespace PcapDotNet.Core.Test
break;
case "mip6.vsm.subtype":
optionSubfield.AssertShowDecimal(vendorSpecific.SubType);
optionSubfield.AssertShowDecimal(vendorSpecific.Subtype);
break;
case "":
......@@ -743,20 +743,20 @@ namespace PcapDotNet.Core.Test
}
break;
case IpV6MobilityOptionType.NonceIndices:
case IpV6MobilityOptionType.NonceIndexes:
optionField.AssertShow("Nonce Indices");
IpV6MobilityOptionNonceIndices nonceIndices = (IpV6MobilityOptionNonceIndices)option;
IpV6MobilityOptionNonceIndexes nonceIndexes = (IpV6MobilityOptionNonceIndexes)option;
foreach (XElement optionSubfield in optionField.Fields())
{
optionSubfield.AssertNoFields();
switch (optionSubfield.Name())
{
case "mip6.ni.hni":
optionSubfield.AssertShowDecimal(nonceIndices.HomeNonceIndex);
optionSubfield.AssertShowDecimal(nonceIndexes.HomeNonceIndex);
break;
case "mip6.ni.cni":
optionSubfield.AssertShowDecimal(nonceIndices.CareOfNonceIndex);
optionSubfield.AssertShowDecimal(nonceIndexes.CareOfNonceIndex);
break;
default:
......@@ -860,7 +860,7 @@ namespace PcapDotNet.Core.Test
break;
case IpV6MobilityOptionType.FlowSummary:
case IpV6MobilityOptionType.CgaParametersRequest:
case IpV6MobilityOptionType.CryptographicallyGeneratedAddressParametersRequest:
case IpV6MobilityOptionType.Redirect:
case IpV6MobilityOptionType.IpV4CareOfAddress:
case IpV6MobilityOptionType.Signature:
......@@ -868,7 +868,7 @@ namespace PcapDotNet.Core.Test
case IpV6MobilityOptionType.MobileNodeLinkLayerIdentifier:
case IpV6MobilityOptionType.Authentication:
case IpV6MobilityOptionType.RedirectCapability:
case IpV6MobilityOptionType.CgaParameters:
case IpV6MobilityOptionType.CryptographicallyGeneratedAddressParameters:
case IpV6MobilityOptionType.ContextRequest:
case IpV6MobilityOptionType.IpV6AddressPrefix:
case IpV6MobilityOptionType.FlowIdentification:
......
......@@ -48,7 +48,7 @@ namespace PcapDotNet.Packets.Test
for (int i = 0; i != 100; ++i)
{
DataSegment data = random.NextDataSegment(random.Next(1000));
ushort fcs = PppFrameCheckSequenceCalculator.CalculateFcs16(data);
ushort fcs = PppFrameCheckSequenceCalculator.CalculateFrameCheckSequence16(data);
}
}
......@@ -60,7 +60,7 @@ namespace PcapDotNet.Packets.Test
for (int fcs16Value = 0; fcs16Value <= ushort.MaxValue; ++fcs16Value)
{
ushort extraValue = (ushort)(fcs16Value ^ 0xffff); // Complement.
Assert.AreEqual(GoodFcs16, PppFrameCheckSequenceCalculator.CalculateFcs16((ushort)fcs16Value, new[] { (byte)extraValue, (byte)(extraValue >> 8) }));
Assert.AreEqual(GoodFcs16, PppFrameCheckSequenceCalculator.CalculateFrameCheckSequence16((ushort)fcs16Value, new[] { (byte)extraValue, (byte)(extraValue >> 8) }));
}
}
}
......
......@@ -82,14 +82,14 @@ namespace PcapDotNet.Packets.TestUtils
case IpV6RoutingType.Type2RoutingHeader:
return new IpV6ExtensionHeaderRoutingHomeAddress(nextHeader, random.NextByte(), random.NextIpV6Address());
case IpV6RoutingType.RplSourceRouteHeader:
byte commonPrefixLengthForNonLastAddresses = random.NextByte(IpV6ExtensionHeaderRoutingRpl.MaxCommonPrefixLength + 1);
byte commonPrefixLengthForLastAddress = random.NextByte(IpV6ExtensionHeaderRoutingRpl.MaxCommonPrefixLength + 1);
case IpV6RoutingType.RoutingProtocolLowPowerAndLossyNetworksSourceRouteHeader:
byte commonPrefixLengthForNonLastAddresses = random.NextByte(IpV6ExtensionHeaderRoutingProtocolLowPowerAndLossyNetworks.MaxCommonPrefixLength + 1);
byte commonPrefixLengthForLastAddress = random.NextByte(IpV6ExtensionHeaderRoutingProtocolLowPowerAndLossyNetworks.MaxCommonPrefixLength + 1);
IpV6Address[] addresses = random.NextIpV6AddressWithLeadingZeroBytesArray(commonPrefixLengthForNonLastAddresses,
random.NextInt(0, 10));
if (addresses.Any() || random.NextBool())
addresses = addresses.Concat(random.NextIpV6AddressWithLeadingZeroBytes(commonPrefixLengthForLastAddress)).ToArray();
return new IpV6ExtensionHeaderRoutingRpl(nextHeader, random.NextByte(), commonPrefixLengthForNonLastAddresses,
return new IpV6ExtensionHeaderRoutingProtocolLowPowerAndLossyNetworks(nextHeader, random.NextByte(), commonPrefixLengthForNonLastAddresses,
commonPrefixLengthForLastAddress, addresses);
default:
......@@ -191,7 +191,7 @@ namespace PcapDotNet.Packets.TestUtils
random.NextIpV6MobilityOptions());
case IpV6MobilityHeaderType.BindingRevocationMessage: // 16
IpV6MobilityBindingRevocationType bindingRevocationType = random.NextEnum<IpV6MobilityBindingRevocationType>();
IpV6MobilityBindingRevocationType bindingRevocationType = random.NextEnum(IpV6MobilityBindingRevocationType.None);
byte revocationTriggerOrStatus = random.NextByte();
ushort sequenceNumber = random.NextUShort();
bool proxyBinding = random.NextBool();
......@@ -264,24 +264,24 @@ namespace PcapDotNet.Packets.TestUtils
return new IpV6OptionCalipso(random.NextEnum<IpV6CalipsoDomainOfInterpretation>(), random.NextByte(), random.NextUShort(),
random.NextDataSegment(random.NextInt(0, IpV6OptionCalipso.CompartmentBitmapMaxLength + 1) / 4 * sizeof(int)));
case IpV6OptionType.SmfDpd:
case IpV6OptionType.SimplifiedMulticastForwardingDuplicatePacketDetection:
if (random.NextBool())
return new IpV6OptionSmfDpdSequenceHashAssistValue(random.NextDataSegment(random.NextInt(1, 100)));
return new IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceHashAssistValue(random.NextDataSegment(random.NextInt(1, 100)));
IpV6TaggerIdType taggerIdType = random.NextEnum<IpV6TaggerIdType>();
DataSegment identifier = random.NextDataSegment(random.NextInt(0, 100));
switch (taggerIdType)
{
case IpV6TaggerIdType.Null:
return new IpV6OptionSmfDpdNull(identifier);
return new IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionNull(identifier);
case IpV6TaggerIdType.Default:
return new IpV6OptionSmfDpdDefault(random.NextDataSegment(random.NextInt(1, 17)), identifier);
return new IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionDefault(random.NextDataSegment(random.NextInt(1, 17)), identifier);
case IpV6TaggerIdType.IpV4:
return new IpV6OptionSmfDpdIpV4(random.NextIpV4Address(), identifier);
return new IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV4(random.NextIpV4Address(), identifier);
case IpV6TaggerIdType.IpV6:
return new IpV6OptionSmfDpdIpV6(random.NextIpV6Address(), identifier);
return new IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV6(random.NextIpV6Address(), identifier);
default:
throw new InvalidOperationException(string.Format("Invalid taggerIdType value {0}", taggerIdType));
......@@ -293,12 +293,12 @@ namespace PcapDotNet.Packets.TestUtils
case IpV6OptionType.EndpointIdentification:
return new IpV6OptionEndpointIdentification(random.NextDataSegment(random.Next(10)), random.NextDataSegment(random.Next(10)));
case IpV6OptionType.RplOption:
case IpV6OptionType.RoutingProtocolLowPowerAndLossyNetworksOption:
return new IpV6OptionRoutingProtocolLowPowerAndLossyNetworks(random.NextBool(), random.NextBool(), random.NextBool(), random.NextByte(),
random.NextUShort(), random.NextDataSegment(random.Next(10)));
case IpV6OptionType.IlnpNonce:
return new IpV6OptionIlnpNonce(random.NextDataSegment(random.Next(10)));
case IpV6OptionType.IdentifierLocatorNetworkProtocolNonce:
return new IpV6OptionIdentifierLocatorNetworkProtocolNonce(random.NextDataSegment(random.Next(10)));
case IpV6OptionType.LineIdentification:
return new IpV6OptionLineIdentificationDestination(random.NextDataSegment(random.Next(10)));
......@@ -330,8 +330,8 @@ namespace PcapDotNet.Packets.TestUtils
case IpV6MobilityOptionType.AlternateCareOfAddress:
return new IpV6MobilityOptionAlternateCareOfAddress(random.NextIpV6Address());
case IpV6MobilityOptionType.NonceIndices:
return new IpV6MobilityOptionNonceIndices(random.NextUShort(), random.NextUShort());
case IpV6MobilityOptionType.NonceIndexes:
return new IpV6MobilityOptionNonceIndexes(random.NextUShort(), random.NextUShort());
case IpV6MobilityOptionType.BindingAuthorizationData:
return new IpV6MobilityOptionBindingAuthorizationData(random.NextDataSegment(random.NextInt(0, 100)));
......@@ -357,11 +357,11 @@ namespace PcapDotNet.Packets.TestUtils
case IpV6MobilityOptionType.ReplayProtection:
return new IpV6MobilityOptionReplayProtection(random.NextULong());
case IpV6MobilityOptionType.CgaParametersRequest:
return new IpV6MobilityOptionCgaParametersRequest();
case IpV6MobilityOptionType.CryptographicallyGeneratedAddressParametersRequest:
return new IpV6MobilityOptionCryptographicallyGeneratedAddressParametersRequest();
case IpV6MobilityOptionType.CgaParameters:
return new IpV6MobilityOptionCgaParameters(random.NextDataSegment(random.NextInt(0, 100)));
case IpV6MobilityOptionType.CryptographicallyGeneratedAddressParameters:
return new IpV6MobilityOptionCryptographicallyGeneratedAddressParameters(random.NextDataSegment(random.NextInt(0, 100)));
case IpV6MobilityOptionType.Signature:
return new IpV6MobilityOptionSignature(random.NextDataSegment(random.NextInt(0, 100)));
......@@ -501,7 +501,7 @@ namespace PcapDotNet.Packets.TestUtils
return new IpV6MobilityOptionAlternateIpV4CareOfAddress(random.NextIpV4Address());
case IpV6MobilityOptionType.MobileNodeGroupIdentifier:
return new IpV6MobilityOptionMobileNodeGroupIdentifier(random.NextEnum<IpV6MobileNodeGroupIdentifierSubType>(), random.NextUInt());
return new IpV6MobilityOptionMobileNodeGroupIdentifier(random.NextEnum<IpV6MobileNodeGroupIdentifierSubtype>(), random.NextUInt());
case IpV6MobilityOptionType.MobileAccessGatewayIpV6Address:
return new IpV6MobilityOptionMobileAccessGatewayIpV6Address(random.NextIpV6Address());
......
......@@ -94,7 +94,7 @@ namespace PcapDotNet.Packets.IpV6
return IpV6ExtensionHeaderAuthentication.CreateInstance(extensionHeaderData, out numBytesRead);
default:
throw new InvalidOperationException("Invalid nextHeader value" + nextHeader);
throw new InvalidOperationException("Invalid next header value" + nextHeader);
}
}
......@@ -118,7 +118,7 @@ namespace PcapDotNet.Packets.IpV6
break;
default:
throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Invalid nextHeader value {0}", nextHeader));
throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture, "Invalid next header value {0}", nextHeader));
}
}
......
......@@ -68,6 +68,9 @@ namespace PcapDotNet.Packets.IpV6
public IpV6ExtensionHeaderAuthentication(IpV4Protocol nextHeader, uint securityParametersIndex, uint sequenceNumber, DataSegment authenticationData)
: base(nextHeader)
{
if (authenticationData == null)
throw new ArgumentNullException("authenticationData");
if (authenticationData.Length % 4 != 0)
{
throw new ArgumentException(
......
......@@ -71,7 +71,7 @@ namespace PcapDotNet.Packets.IpV6
/// Indicates that the local mobility anchor that processed the corresponding Proxy Binding Update message supports proxy registrations.
/// True only if the corresponding Proxy Binding Update had the Proxy Registration set to true.
/// </param>
/// <param name="tlvHeaderFormat">
/// <param name="typeLengthValueHeaderFormat">
/// Indicates that the sender of the Proxy Binding Acknowledgement, the LMA, supports tunneling IPv6-or-IPv4 in IPv4 using TLV-header format.
/// </param>
/// <param name="sequenceNumber">
......@@ -85,12 +85,12 @@ namespace PcapDotNet.Packets.IpV6
/// <param name="options">Zero or more TLV-encoded mobility options.</param>
public IpV6ExtensionHeaderMobilityBindingAcknowledgement(IpV4Protocol nextHeader, ushort checksum, IpV6BindingAcknowledgementStatus status,
bool keyManagementMobilityCapability, bool mobileRouter, bool proxyRegistration,
bool tlvHeaderFormat, ushort sequenceNumber, ushort lifetime, IpV6MobilityOptions options)
bool typeLengthValueHeaderFormat, ushort sequenceNumber, ushort lifetime, IpV6MobilityOptions options)
: base(nextHeader, checksum, status, keyManagementMobilityCapability, sequenceNumber, lifetime, options)
{
MobileRouter = mobileRouter;
ProxyRegistration = proxyRegistration;
TlvHeaderFormat = tlvHeaderFormat;
TypeLengthValueHeaderFormat = typeLengthValueHeaderFormat;
}
/// <summary>
......@@ -117,7 +117,7 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// Indicates that the sender of the Proxy Binding Acknowledgement, the LMA, supports tunneling IPv6-or-IPv4 in IPv4 using TLV-header format.
/// </summary>
public bool TlvHeaderFormat { get; private set; }
public bool TypeLengthValueHeaderFormat { get; private set; }
internal static IpV6ExtensionHeaderMobilityBindingAcknowledgement ParseMessageData(IpV4Protocol nextHeader, ushort checksum, DataSegment messageData)
{
......
......@@ -31,8 +31,8 @@ namespace PcapDotNet.Packets.IpV6
{
public const int MapRegistration = sizeof(ushort);
public const int MobileRouter = MapRegistration;
public const int ProxyRegistrationFlag = MobileRouter;
public const int ForcingUdpEncapsulation = ProxyRegistrationFlag;
public const int ProxyRegistration = MobileRouter;
public const int ForcingUdpEncapsulation = ProxyRegistration;
public const int TlvHeaderFormat = ForcingUdpEncapsulation + sizeof(byte);
public const int BulkBindingUpdate = TlvHeaderFormat;
}
......@@ -41,7 +41,7 @@ namespace PcapDotNet.Packets.IpV6
{
public const byte MapRegistration = 0x08;
public const byte MobileRouter = 0x04;
public const byte ProxyRegistrationFlag = 0x02;
public const byte ProxyRegistration = 0x02;
public const byte ForcingUdpEncapsulation = 0x01;
public const byte TlvHeaderFormat = 0x80;
public const byte BulkBindingUpdate = 0x40;
......@@ -91,7 +91,7 @@ namespace PcapDotNet.Packets.IpV6
/// If false, the Home Agent assumes that the Mobile Router is behaving as a Mobile Node,
/// and it must not forward packets destined for the Mobile Network to the Mobile Router.
/// </param>
/// <param name="proxyRegistrationFlag">
/// <param name="proxyRegistration">
/// Indicates to the local mobility anchor that the Binding Update message is a proxy registration.
/// Must be true for proxy registrations and must be false direct registrations sent by a mobile node.
/// </param>
......@@ -99,14 +99,14 @@ namespace PcapDotNet.Packets.IpV6
/// Indicates a request for forcing UDP encapsulation regardless of whether a NAT is present on the path between the mobile node and the home agent.
/// May be set by the mobile node if it is required to use UDP encapsulation regardless of the presence of a NAT.
/// </param>
/// <param name="tlvHeaderFormat">
/// <param name="typeLengthValueHeaderFormat">
/// Indicates that the mobile access gateway requests the use of the TLV header for encapsulating IPv6 or IPv4 packets in IPv4.
/// </param>
/// <param name="bulkBindingUpdate">
/// If true, it informs the local mobility anchor to enable bulk binding update support for the mobility session associated with this message.
/// If false, the local mobility anchor must exclude the mobility session associated with this message from any bulk-binding-related operations
/// and any binding update, or binding revocation operations with bulk-specific scope will not be relevant to that mobility session.
/// This flag is relevant only for Proxy Mobile IPv6 and therefore must be set to false when the ProxyRegistrationFlag is false.
/// This flag is relevant only for Proxy Mobile IPv6 and therefore must be set to false when the ProxyRegistration is false.
/// </param>
/// <param name="lifetime">
/// The number of time units remaining before the binding must be considered expired.
......@@ -116,16 +116,16 @@ namespace PcapDotNet.Packets.IpV6
/// <param name="options">Zero or more TLV-encoded mobility options.</param>
public IpV6ExtensionHeaderMobilityBindingUpdate(IpV4Protocol nextHeader, ushort checksum, ushort sequenceNumber, bool acknowledge, bool homeRegistration,
bool linkLocalAddressCompatibility, bool keyManagementMobilityCapability, bool mapRegistration,
bool mobileRouter, bool proxyRegistrationFlag, bool forcingUdpEncapsulation, bool tlvHeaderFormat,
bool mobileRouter, bool proxyRegistration, bool forcingUdpEncapsulation, bool typeLengthValueHeaderFormat,
bool bulkBindingUpdate, ushort lifetime, IpV6MobilityOptions options)
: base(nextHeader, checksum, sequenceNumber, acknowledge, homeRegistration, linkLocalAddressCompatibility, keyManagementMobilityCapability,
lifetime, options)
{
MapRegistration = mapRegistration;
MobileRouter = mobileRouter;
ProxyRegistrationFlag = proxyRegistrationFlag;
ProxyRegistration = proxyRegistration;
ForcingUdpEncapsulation = forcingUdpEncapsulation;
TlvHeaderFormat = tlvHeaderFormat;
TypeLengthValueHeaderFormat = typeLengthValueHeaderFormat;
BulkBindingUpdate = bulkBindingUpdate;
}
......@@ -156,7 +156,7 @@ namespace PcapDotNet.Packets.IpV6
/// Indicates to the local mobility anchor that the Binding Update message is a proxy registration.
/// Must be true for proxy registrations and must be false direct registrations sent by a mobile node.
/// </summary>
public bool ProxyRegistrationFlag { get; private set; }
public bool ProxyRegistration { get; private set; }
/// <summary>
/// Indicates a request for forcing UDP encapsulation regardless of whether a NAT is present on the path between the mobile node and the home agent.
......@@ -167,13 +167,13 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// Indicates that the mobile access gateway requests the use of the TLV header for encapsulating IPv6 or IPv4 packets in IPv4.
/// </summary>
public bool TlvHeaderFormat { get; private set; }
public bool TypeLengthValueHeaderFormat { get; private set; }
/// <summary>
/// If true, it informs the local mobility anchor to enable bulk binding update support for the mobility session associated with this message.
/// If false, the local mobility anchor must exclude the mobility session associated with this message from any bulk-binding-related operations
/// and any binding update, or binding revocation operations with bulk-specific scope will not be relevant to that mobility session.
/// This flag is relevant only for Proxy Mobile IPv6 and therefore must be set to false when the ProxyRegistrationFlag is false.
/// This flag is relevant only for Proxy Mobile IPv6 and therefore must be set to false when the ProxyRegistration is false.
/// </summary>
public bool BulkBindingUpdate { get; private set; }
......@@ -194,14 +194,14 @@ namespace PcapDotNet.Packets.IpV6
bool mapRegistration = messageData.ReadBool(MessageDataOffset.MapRegistration, MessageDataMask.MapRegistration);
bool mobileRouter = messageData.ReadBool(MessageDataOffset.MobileRouter, MessageDataMask.MobileRouter);
bool proxyRegistrationFlag = messageData.ReadBool(MessageDataOffset.ProxyRegistrationFlag, MessageDataMask.ProxyRegistrationFlag);
bool proxyRegistration = messageData.ReadBool(MessageDataOffset.ProxyRegistration, MessageDataMask.ProxyRegistration);
bool forcingUdpEncapsulation = messageData.ReadBool(MessageDataOffset.ForcingUdpEncapsulation, MessageDataMask.ForcingUdpEncapsulation);
bool tlvHeaderFormat = messageData.ReadBool(MessageDataOffset.TlvHeaderFormat, MessageDataMask.TlvHeaderFormat);
bool bulkBindingUpdate = messageData.ReadBool(MessageDataOffset.BulkBindingUpdate, MessageDataMask.BulkBindingUpdate);
return new IpV6ExtensionHeaderMobilityBindingUpdate(nextHeader, checksum, sequenceNumber, acknowledge, homeRegistration,
linkLocalAddressCompatibility, keyManagementMobilityCapability, mapRegistration, mobileRouter,
proxyRegistrationFlag, forcingUdpEncapsulation, tlvHeaderFormat, bulkBindingUpdate, lifetime,
proxyRegistration, forcingUdpEncapsulation, tlvHeaderFormat, bulkBindingUpdate, lifetime,
options);
}
}
......
......@@ -40,6 +40,8 @@ namespace PcapDotNet.Packets.IpV6
public IpV6ExtensionHeaderMobilityExperimental(IpV4Protocol nextHeader, ushort checksum, DataSegment messageData)
: base(nextHeader, checksum, IpV6MobilityOptions.None, null)
{
if (messageData == null)
throw new ArgumentNullException("messageData");
if (messageData.Length % 8 != 2)
throw new ArgumentException("Message data size must be an integral product of 8 bytes plus 2 bytes", "messageData");
MessageData = messageData;
......
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
......@@ -55,8 +56,11 @@ namespace PcapDotNet.Packets.IpV6
/// <param name="options">Zero or more TLV-encoded mobility options.</param>
public IpV6ExtensionHeaderMobilityHomeAgentSwitchMessage(IpV4Protocol nextHeader, ushort checksum, ReadOnlyCollection<IpV6Address> homeAgentAddresses,
IpV6MobilityOptions options)
: base(nextHeader, checksum, options, MessageDataOffset.HomeAgentAddresses + homeAgentAddresses.Count * IpV6Address.SizeOf)
: base(nextHeader, checksum, options,
MessageDataOffset.HomeAgentAddresses + (homeAgentAddresses == null ? 0 : homeAgentAddresses.Count) * IpV6Address.SizeOf)
{
if (homeAgentAddresses == null)
throw new ArgumentNullException("homeAgentAddresses");
HomeAgentAddresses = homeAgentAddresses;
}
......
......@@ -102,8 +102,8 @@ namespace PcapDotNet.Packets.IpV6
case IpV6RoutingType.Type2RoutingHeader:
return IpV6ExtensionHeaderRoutingHomeAddress.ParseRoutingData(nextHeader, segmentsLeft, routingData);
case IpV6RoutingType.RplSourceRouteHeader:
return IpV6ExtensionHeaderRoutingRpl.ParseRoutingData(nextHeader, segmentsLeft, routingData);
case IpV6RoutingType.RoutingProtocolLowPowerAndLossyNetworksSourceRouteHeader:
return IpV6ExtensionHeaderRoutingProtocolLowPowerAndLossyNetworks.ParseRoutingData(nextHeader, segmentsLeft, routingData);
default:
return null;
......
......@@ -35,7 +35,7 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+------------------------------------------------------------------------+
/// </pre>
/// </summary>
public sealed class IpV6ExtensionHeaderRoutingRpl : IpV6ExtensionHeaderRouting
public sealed class IpV6ExtensionHeaderRoutingProtocolLowPowerAndLossyNetworks : IpV6ExtensionHeaderRouting
{
private static class RoutingDataOffset
{
......@@ -90,10 +90,12 @@ namespace PcapDotNet.Packets.IpV6
/// For example, a header carrying a full IPv6 address in Addresses[n] sets this to 0.
/// </param>
/// <param name="addresses">Routing addresses.</param>
public IpV6ExtensionHeaderRoutingRpl(IpV4Protocol nextHeader, byte segmentsLeft, byte commonPrefixLengthForNonLastAddresses,
public IpV6ExtensionHeaderRoutingProtocolLowPowerAndLossyNetworks(IpV4Protocol nextHeader, byte segmentsLeft, byte commonPrefixLengthForNonLastAddresses,
byte commonPrefixLengthForLastAddress, params IpV6Address[] addresses)
: base(nextHeader, segmentsLeft)
{
if (addresses == null)
throw new ArgumentNullException("addresses");
if (commonPrefixLengthForNonLastAddresses > MaxCommonPrefixLength)
{
throw new ArgumentOutOfRangeException("commonPrefixLengthForNonLastAddresses", commonPrefixLengthForNonLastAddresses,
......@@ -142,7 +144,7 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
public override IpV6RoutingType RoutingType
{
get { return IpV6RoutingType.RplSourceRouteHeader; }
get { return IpV6RoutingType.RoutingProtocolLowPowerAndLossyNetworksSourceRouteHeader; }
}
/// <summary>
......@@ -179,7 +181,7 @@ namespace PcapDotNet.Packets.IpV6
}
}
internal static IpV6ExtensionHeaderRoutingRpl ParseRoutingData(IpV4Protocol nextHeader, byte segmentsLeft, DataSegment routingData)
internal static IpV6ExtensionHeaderRoutingProtocolLowPowerAndLossyNetworks ParseRoutingData(IpV4Protocol nextHeader, byte segmentsLeft, DataSegment routingData)
{
if (routingData.Length < RoutingDataMinimumLength)
return null;
......@@ -227,13 +229,13 @@ namespace PcapDotNet.Packets.IpV6
lastAddressSegment.Write(addressBytes, commonPrefixLengthForLastAddress);
addresses[numAddresses - 1] = addressBytes.ReadIpV6Address(0, Endianity.Big);
}
return new IpV6ExtensionHeaderRoutingRpl(nextHeader, segmentsLeft, commonPrefixLengthForNonLastAddresses, commonPrefixLengthForLastAddress,
return new IpV6ExtensionHeaderRoutingProtocolLowPowerAndLossyNetworks(nextHeader, segmentsLeft, commonPrefixLengthForNonLastAddresses, commonPrefixLengthForLastAddress,
addresses);
}
internal override bool EqualsRoutingData(IpV6ExtensionHeaderRouting other)
{
return EqualsRoutingData(other as IpV6ExtensionHeaderRoutingRpl);
return EqualsRoutingData(other as IpV6ExtensionHeaderRoutingProtocolLowPowerAndLossyNetworks);
}
internal override int GetRoutingDataHashCode()
......@@ -262,7 +264,7 @@ namespace PcapDotNet.Packets.IpV6
}
}
private bool EqualsRoutingData(IpV6ExtensionHeaderRoutingRpl other)
private bool EqualsRoutingData(IpV6ExtensionHeaderRoutingProtocolLowPowerAndLossyNetworks other)
{
return other != null &&
CommonPrefixLengthForNonLastAddresses == other.CommonPrefixLengthForNonLastAddresses &&
......
......@@ -124,7 +124,7 @@ namespace PcapDotNet.Packets.IpV6
return IpV6ExtensionHeaderMobility.ParseData(nextNextHeader, data);
default:
throw new InvalidOperationException("Invalid nextHeader value" + nextHeader);
throw new InvalidOperationException("Invalid next header value" + nextHeader);
}
}
......
......@@ -22,6 +22,8 @@ namespace PcapDotNet.Packets.IpV6
/// <param name="extensionHeaders">The extension headers.</param>
public IpV6ExtensionHeaders(ReadOnlyCollection<IpV6ExtensionHeader> extensionHeaders)
{
if (extensionHeaders == null)
throw new ArgumentNullException("extensionHeaders");
for (int i = 0; i < extensionHeaders.Count; ++i)
{
if (extensionHeaders[i].Protocol == IpV4Protocol.EncapsulatingSecurityPayload && i != extensionHeaders.Count - 1)
......
......@@ -6,6 +6,11 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
public enum IpV6MobilityBindingRevocationType : byte
{
/// <summary>
/// Invalid value.
/// </summary>
None = 0,
/// <summary>
/// Binding Revocation Indication.
/// </summary>
......
......@@ -25,6 +25,6 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 6554.
/// </summary>
RplSourceRouteHeader = 3,
RoutingProtocolLowPowerAndLossyNetworksSourceRouteHeader = 3,
}
}
\ No newline at end of file
namespace PcapDotNet.Packets.IpV6
{
/// <summary>
/// RFC 5846.
/// The Per-MN Revocation Trigger values are less than 128.
/// The Per-MN Revocation Trigger is used when the BRI message intends to revoke one or more bindings for the same mobile node.
/// The Global Revocation Trigger values are greater than 128 and less than 250 and used in the BRI message
......@@ -22,17 +23,17 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// Inter-MAG Handover - same Access Type.
/// </summary>
InterMagHandoverSameAccessType = 2,
InterMobileAccessGatewayHandoverSameAccessType = 2,
/// <summary>
/// Inter-MAG Handover - different Access Type.
/// </summary>
InterMagHandoverDifferentAccessType = 3,
InterMobileAccessGatewayHandoverDifferentAccessType = 3,
/// <summary>
/// Inter-MAG Handover - Unknown.
/// </summary>
InterMagHandoverUnknown = 4,
InterMobileAccessGatewayHandoverUnknown = 4,
/// <summary>
/// User-Initiated Session(s) Termination
......
......@@ -5,6 +5,11 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
public enum IpV6FlowIdentificationTrafficSelectorFormat : byte
{
/// <summary>
/// Invalid value.
/// </summary>
None = 0,
/// <summary>
/// IPv4 binary traffic selector.
/// </summary>
......
......@@ -5,6 +5,11 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
public enum IpV6HandoffIndicator : byte
{
/// <summary>
/// Invalid value.
/// </summary>
None = 0,
/// <summary>
/// Attachment over a new interface.
/// </summary>
......
......@@ -5,6 +5,11 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
public enum IpV6LocalMobilityAnchorAddressCode : byte
{
/// <summary>
/// Invalid value.
/// </summary>
None = 0,
/// <summary>
/// IPv6 address of the local mobility anchor (LMAA).
/// </summary>
......
......@@ -3,8 +3,13 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 6602.
/// </summary>
public enum IpV6MobileNodeGroupIdentifierSubType : byte
public enum IpV6MobileNodeGroupIdentifierSubtype : byte
{
/// <summary>
/// Invalid value.
/// </summary>
None = 0,
/// <summary>
/// RFC 6602.
/// </summary>
......
......@@ -5,6 +5,11 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
public enum IpV6MobileNodeIdentifierSubtype : byte
{
/// <summary>
/// Invalid value.
/// </summary>
None = 0,
/// <summary>
/// RFC 4283.
/// Uses an identifier of the form user@realm (RFC 4282).
......
......@@ -5,6 +5,11 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
public enum IpV6MobilityIpV6AddressPrefixCode : byte
{
/// <summary>
/// Invalid value.
/// </summary>
None = 0,
/// <summary>
/// Old Care-of Address.
/// </summary>
......
......@@ -27,9 +27,9 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// Returns true iff the given option is an equivalent option.
/// </summary>
public sealed override bool Equals(Option option)
public sealed override bool Equals(Option other)
{
return Equals(option as IpV6MobilityOption);
return Equals(other as IpV6MobilityOption);
}
/// <summary>
......
......@@ -26,6 +26,8 @@ namespace PcapDotNet.Packets.IpV6
public IpV6MobilityOptionAccessNetworkIdentifier(IpV6AccessNetworkIdentifierSubOptions subOptions)
: base(IpV6MobilityOptionType.AccessNetworkIdentifier)
{
if (subOptions == null)
throw new ArgumentNullException("subOptions");
if (subOptions.BytesLength > MaxDataLength)
throw new ArgumentOutOfRangeException("subOptions", subOptions,
string.Format(CultureInfo.InvariantCulture, "SubOptions take more than {0} bytes", MaxDataLength));
......
......@@ -26,6 +26,8 @@ namespace PcapDotNet.Packets.IpV6
/// <param name="option">The optional data to uniquely identify the requested context for the requested option.</param>
public IpV6MobilityOptionContextRequestEntry(byte requestType, DataSegment option)
{
if (option == null)
throw new ArgumentNullException("option");
if (option.Length > byte.MaxValue)
throw new ArgumentOutOfRangeException("option", option,
string.Format(CultureInfo.InvariantCulture, "Option length must not exceed {0}", byte.MaxValue));
......
......@@ -16,8 +16,8 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+----------------------------+
/// </pre>
/// </summary>
[IpV6MobilityOptionTypeRegistration(IpV6MobilityOptionType.CgaParameters)]
public sealed class IpV6MobilityOptionCgaParameters : IpV6MobilityOptionSingleDataSegmentField
[IpV6MobilityOptionTypeRegistration(IpV6MobilityOptionType.CryptographicallyGeneratedAddressParameters)]
public sealed class IpV6MobilityOptionCryptographicallyGeneratedAddressParameters : IpV6MobilityOptionSingleDataSegmentField
{
/// <summary>
/// The maximum option data length in bytes.
......@@ -27,7 +27,7 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// Creates an instance from the given CGA parameters.
/// </summary>
/// <param name="cgaParameters">
/// <param name="cryptographicallyGeneratedAddressParameters">
/// Contains up to 255 bytes of the CGA Parameters data structure defined in RFC 3972.
/// The concatenation of all CGA Parameters options in the order they appear in the Binding Update message
/// must result in the original CGA Parameters data structure.
......@@ -36,11 +36,13 @@ namespace PcapDotNet.Packets.IpV6
/// All CGA Parameters options must appear directly one after another, that is,
/// a mobility option of a different type must not be placed in between two CGA Parameters options.
/// </param>
public IpV6MobilityOptionCgaParameters(DataSegment cgaParameters)
: base(IpV6MobilityOptionType.CgaParameters, cgaParameters)
public IpV6MobilityOptionCryptographicallyGeneratedAddressParameters(DataSegment cryptographicallyGeneratedAddressParameters)
: base(IpV6MobilityOptionType.CryptographicallyGeneratedAddressParameters, cryptographicallyGeneratedAddressParameters)
{
if (cgaParameters.Length > OptionDataMaxLength)
throw new ArgumentOutOfRangeException("cgaParameters", cgaParameters,
if (cryptographicallyGeneratedAddressParameters == null)
throw new ArgumentNullException("cryptographicallyGeneratedAddressParameters");
if (cryptographicallyGeneratedAddressParameters.Length > OptionDataMaxLength)
throw new ArgumentOutOfRangeException("cryptographicallyGeneratedAddressParameters", cryptographicallyGeneratedAddressParameters,
string.Format(CultureInfo.InvariantCulture, "Must not exceed {0} bytes.", OptionDataMaxLength));
}
......@@ -53,7 +55,7 @@ namespace PcapDotNet.Packets.IpV6
/// All CGA Parameters options must appear directly one after another, that is,
/// a mobility option of a different type must not be placed in between two CGA Parameters options.
/// </summary>
public DataSegment CgaParameters
public DataSegment CryptographicallyGeneratedAddressParameters
{
get { return Value; }
}
......@@ -63,10 +65,10 @@ namespace PcapDotNet.Packets.IpV6
if (data.Length > OptionDataMaxLength)
return null;
return new IpV6MobilityOptionCgaParameters(data);
return new IpV6MobilityOptionCryptographicallyGeneratedAddressParameters(data);
}
private IpV6MobilityOptionCgaParameters()
private IpV6MobilityOptionCryptographicallyGeneratedAddressParameters()
: this(DataSegment.Empty)
{
}
......
......@@ -10,14 +10,14 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+-------------+--------------+
/// </pre>
/// </summary>
[IpV6MobilityOptionTypeRegistration(IpV6MobilityOptionType.CgaParametersRequest)]
public sealed class IpV6MobilityOptionCgaParametersRequest : IpV6MobilityOptionEmpty
[IpV6MobilityOptionTypeRegistration(IpV6MobilityOptionType.CryptographicallyGeneratedAddressParametersRequest)]
public sealed class IpV6MobilityOptionCryptographicallyGeneratedAddressParametersRequest : IpV6MobilityOptionEmpty
{
/// <summary>
/// Creates an instance.
/// </summary>
public IpV6MobilityOptionCgaParametersRequest()
: base(IpV6MobilityOptionType.CgaParametersRequest)
public IpV6MobilityOptionCryptographicallyGeneratedAddressParametersRequest()
: base(IpV6MobilityOptionType.CryptographicallyGeneratedAddressParametersRequest)
{
}
......@@ -26,7 +26,7 @@ namespace PcapDotNet.Packets.IpV6
if (data.Length != OptionDataLength)
return null;
return new IpV6MobilityOptionCgaParametersRequest();
return new IpV6MobilityOptionCryptographicallyGeneratedAddressParametersRequest();
}
}
}
\ No newline at end of file
......@@ -67,6 +67,8 @@ namespace PcapDotNet.Packets.IpV6
IpV6FlowIdentificationSubOptions subOptions)
: base(IpV6MobilityOptionType.FlowIdentification)
{
if (subOptions == null)
throw new ArgumentNullException("subOptions");
if (Offset.SubOptions + subOptions.BytesLength > byte.MaxValue)
{
throw new ArgumentOutOfRangeException("subOptions", subOptions,
......
......@@ -68,7 +68,7 @@ namespace PcapDotNet.Packets.IpV6
private bool EqualsData(IpV6MobilityOptionIpV6Address other)
{
return other != null &&
other.Address.Equals(other.Address);
Address.Equals(other.Address);
}
}
}
\ No newline at end of file
......@@ -34,7 +34,7 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// Creates an instance from sub type and mobile node group identifier.
/// </summary>
/// <param name="subType">
/// <param name="subtype">
/// Identifies the specific mobile node's group type.
/// </param>
/// <param name="mobileNodeGroupIdentifier">
......@@ -43,17 +43,17 @@ namespace PcapDotNet.Packets.IpV6
/// The value of (1) ALL-SESSIONS is the default group of all mobility sessions established between a given local mobility anchor and a mobile access
/// gateway.
/// </param>
public IpV6MobilityOptionMobileNodeGroupIdentifier(IpV6MobileNodeGroupIdentifierSubType subType, uint mobileNodeGroupIdentifier)
public IpV6MobilityOptionMobileNodeGroupIdentifier(IpV6MobileNodeGroupIdentifierSubtype subtype, uint mobileNodeGroupIdentifier)
: base(IpV6MobilityOptionType.MobileNodeGroupIdentifier)
{
SubType = subType;
Subtype = subtype;
MobileNodeGroupIdentifier = mobileNodeGroupIdentifier;
}
/// <summary>
/// Identifies the specific mobile node's group type.
/// </summary>
public IpV6MobileNodeGroupIdentifierSubType SubType { get; private set; }
public IpV6MobileNodeGroupIdentifierSubtype Subtype { get; private set; }
/// <summary>
/// Contains the mobile node's group identifier.
......@@ -68,10 +68,10 @@ namespace PcapDotNet.Packets.IpV6
if (data.Length != OptionDataLength)
return null;
IpV6MobileNodeGroupIdentifierSubType subType = (IpV6MobileNodeGroupIdentifierSubType)data[Offset.SubType];
IpV6MobileNodeGroupIdentifierSubtype subtype = (IpV6MobileNodeGroupIdentifierSubtype)data[Offset.SubType];
uint mobileNodeGroupIdentifier = data.ReadUInt(Offset.MobileNodeGroupIdentifier, Endianity.Big);
return new IpV6MobilityOptionMobileNodeGroupIdentifier(subType, mobileNodeGroupIdentifier);
return new IpV6MobilityOptionMobileNodeGroupIdentifier(subtype, mobileNodeGroupIdentifier);
}
internal override int DataLength
......@@ -86,25 +86,25 @@ namespace PcapDotNet.Packets.IpV6
internal override int GetDataHashCode()
{
return Sequence.GetHashCode(SubType, MobileNodeGroupIdentifier);
return Sequence.GetHashCode(Subtype, MobileNodeGroupIdentifier);
}
internal override void WriteData(byte[] buffer, ref int offset)
{
buffer.Write(offset + Offset.SubType, (byte)SubType);
buffer.Write(offset + Offset.SubType, (byte)Subtype);
buffer.Write(offset + Offset.MobileNodeGroupIdentifier, MobileNodeGroupIdentifier, Endianity.Big);
offset += OptionDataLength;
}
private IpV6MobilityOptionMobileNodeGroupIdentifier()
: this(IpV6MobileNodeGroupIdentifierSubType.BulkBindingUpdateGroup, 0)
: this(IpV6MobileNodeGroupIdentifierSubtype.BulkBindingUpdateGroup, 0)
{
}
private bool EqualsData(IpV6MobilityOptionMobileNodeGroupIdentifier other)
{
return other != null &&
SubType == other.SubType && MobileNodeGroupIdentifier == other.MobileNodeGroupIdentifier;
Subtype == other.Subtype && MobileNodeGroupIdentifier == other.MobileNodeGroupIdentifier;
}
}
}
\ No newline at end of file
......@@ -52,6 +52,8 @@ namespace PcapDotNet.Packets.IpV6
public IpV6MobilityOptionMobileNodeIdentifier(IpV6MobileNodeIdentifierSubtype subtype, DataSegment identifier)
: base(IpV6MobilityOptionType.MobileNodeIdentifier)
{
if (identifier == null)
throw new ArgumentNullException("identifier");
if (subtype == IpV6MobileNodeIdentifierSubtype.NetworkAccessIdentifier && identifier.Length < MinNetworkAccessIdentifierLength)
throw new ArgumentOutOfRangeException("identifier", identifier,
string.Format(CultureInfo.InvariantCulture, "Network Access Identifier must be at least {0} bytes long.",
......
......@@ -16,8 +16,8 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+-----------------------------+
/// </pre>
/// </summary>
[IpV6MobilityOptionTypeRegistration(IpV6MobilityOptionType.NonceIndices)]
public sealed class IpV6MobilityOptionNonceIndices : IpV6MobilityOptionComplex
[IpV6MobilityOptionTypeRegistration(IpV6MobilityOptionType.NonceIndexes)]
public sealed class IpV6MobilityOptionNonceIndexes : IpV6MobilityOptionComplex
{
private static class Offset
{
......@@ -40,8 +40,8 @@ namespace PcapDotNet.Packets.IpV6
/// Ignored in requests to delete a binding.
/// Otherwise, it tells the correspondent node which nonce value to use when producing the care-of keygen token.
/// </param>
public IpV6MobilityOptionNonceIndices(ushort homeNonceIndex, ushort careOfNonceIndex)
: base(IpV6MobilityOptionType.NonceIndices)
public IpV6MobilityOptionNonceIndexes(ushort homeNonceIndex, ushort careOfNonceIndex)
: base(IpV6MobilityOptionType.NonceIndexes)
{
HomeNonceIndex = homeNonceIndex;
CareOfNonceIndex = careOfNonceIndex;
......@@ -66,7 +66,7 @@ namespace PcapDotNet.Packets.IpV6
ushort homeNonceIndex = data.ReadUShort(Offset.HomeNonceIndex, Endianity.Big);
ushort careOfNonceIndex = data.ReadUShort(Offset.CareOfNonceIndex, Endianity.Big);
return new IpV6MobilityOptionNonceIndices(homeNonceIndex, careOfNonceIndex);
return new IpV6MobilityOptionNonceIndexes(homeNonceIndex, careOfNonceIndex);
}
internal override int DataLength
......@@ -76,7 +76,7 @@ namespace PcapDotNet.Packets.IpV6
internal override bool EqualsData(IpV6MobilityOption other)
{
return EqualsData(other as IpV6MobilityOptionNonceIndices);
return EqualsData(other as IpV6MobilityOptionNonceIndexes);
}
internal override int GetDataHashCode()
......@@ -90,12 +90,12 @@ namespace PcapDotNet.Packets.IpV6
buffer.Write(ref offset, CareOfNonceIndex, Endianity.Big);
}
private IpV6MobilityOptionNonceIndices()
private IpV6MobilityOptionNonceIndexes()
: this(0, 0)
{
}
private bool EqualsData(IpV6MobilityOptionNonceIndices other)
private bool EqualsData(IpV6MobilityOptionNonceIndexes other)
{
return other != null &&
HomeNonceIndex == other.HomeNonceIndex && CareOfNonceIndex == other.CareOfNonceIndex;
......
......@@ -44,6 +44,8 @@ namespace PcapDotNet.Packets.IpV6
public IpV6MobilityOptionServiceSelection(DataSegment identifier)
: base(IpV6MobilityOptionType.ServiceSelection, identifier)
{
if (identifier == null)
throw new ArgumentNullException("identifier");
if (identifier.Length < MinIdentifierLength || identifier.Length > MaxIdentifierLength)
throw new ArgumentOutOfRangeException("identifier", identifier,
string.Format(CultureInfo.InvariantCulture,
......
......@@ -29,7 +29,7 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 6275.
/// </summary>
NonceIndices = 0x04,
NonceIndexes = 0x04,
/// <summary>
/// RFC 6275.
......@@ -70,13 +70,13 @@ namespace PcapDotNet.Packets.IpV6
/// RFC 4866.
/// CGA Parameters Request.
/// </summary>
CgaParametersRequest = 0x0B,
CryptographicallyGeneratedAddressParametersRequest = 0x0B,
/// <summary>
/// RFC 4866.
/// CGA Parameters.
/// </summary>
CgaParameters = 0x0C,
CryptographicallyGeneratedAddressParameters = 0x0C,
/// <summary>
/// RFC 4866.
......
......@@ -46,16 +46,16 @@ namespace PcapDotNet.Packets.IpV6
/// The SMI Network Management Private Enterprise Code of the IANA- maintained Private Enterprise Numbers registry.
/// See http://www.iana.org/assignments/enterprise-numbers/enterprise-numbers
/// </param>
/// <param name="subType">
/// <param name="subtype">
/// Indicating the type of vendor-specific information carried in the option.
/// The administration of the Sub-type is done by the Vendor.
/// </param>
/// <param name="data">Vendor-specific data that is carried in this message.</param>
public IpV6MobilityOptionVendorSpecific(uint vendorId, byte subType, DataSegment data)
public IpV6MobilityOptionVendorSpecific(uint vendorId, byte subtype, DataSegment data)
: base(IpV6MobilityOptionType.VendorSpecific)
{
VendorId = vendorId;
SubType = subType;
Subtype = subtype;
Data = data;
}
......@@ -69,7 +69,7 @@ namespace PcapDotNet.Packets.IpV6
/// Indicating the type of vendor-specific information carried in the option.
/// The administration of the Sub-type is done by the Vendor.
/// </summary>
public byte SubType { get; private set; }
public byte Subtype { get; private set; }
/// <summary>
/// Vendor-specific data that is carried in this message.
......@@ -99,13 +99,13 @@ namespace PcapDotNet.Packets.IpV6
internal override int GetDataHashCode()
{
return Sequence.GetHashCode(VendorId, SubType, Data);
return Sequence.GetHashCode(VendorId, Subtype, Data);
}
internal override void WriteData(byte[] buffer, ref int offset)
{
buffer.Write(offset + Offset.VendorId, VendorId, Endianity.Big);
buffer.Write(offset + Offset.SubType, SubType);
buffer.Write(offset + Offset.SubType, Subtype);
buffer.Write(offset + Offset.Data, Data);
offset += DataLength;
}
......@@ -118,7 +118,7 @@ namespace PcapDotNet.Packets.IpV6
private bool EqualsData(IpV6MobilityOptionVendorSpecific other)
{
return other != null &&
VendorId == other.VendorId && SubType == other.SubType && Data.Equals(other.Data);
VendorId == other.VendorId && Subtype == other.Subtype && Data.Equals(other.Data);
}
}
}
\ No newline at end of file
......@@ -86,14 +86,16 @@ namespace PcapDotNet.Packets.IpV6
public IpV6OptionCalipso(IpV6CalipsoDomainOfInterpretation domainOfInterpretation, byte sensitivityLevel, ushort? checksum, DataSegment compartmentBitmap)
: base(IpV6OptionType.Calipso)
{
if (compartmentBitmap == null)
throw new ArgumentNullException("compartmentBitmap");
if (compartmentBitmap.Length % sizeof(int) != 0)
throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "Compartment Bitmap length must divide by {0}.", sizeof(int)),
"compartmentBitmap");
if (compartmentBitmap.Length > CompartmentBitmapMaxLength)
{
throw new ArgumentOutOfRangeException(
string.Format(CultureInfo.InvariantCulture, "Compartment Bitmap length must not be bigger than {0}.", CompartmentBitmapMaxLength),
"compartmentBitmap");
throw new ArgumentOutOfRangeException("compartmentBitmap", compartmentBitmap,
string.Format(CultureInfo.InvariantCulture, "Compartment Bitmap length must not be bigger than {0}.",
CompartmentBitmapMaxLength));
}
DomainOfInterpretation = domainOfInterpretation;
......@@ -188,6 +190,8 @@ namespace PcapDotNet.Packets.IpV6
/// <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 < OptionDataMinimumLength)
return null;
......@@ -250,7 +254,7 @@ namespace PcapDotNet.Packets.IpV6
byte[] domainOfInterpretationBytes = new byte[sizeof(uint)];
domainOfInterpretationBytes.Write(0, (uint)domainOfInterpretation, Endianity.Big);
ushort checksum =
PppFrameCheckSequenceCalculator.CalculateFcs16(
PppFrameCheckSequenceCalculator.CalculateFrameCheckSequence16(
new byte[0].Concat((byte)IpV6OptionType.Calipso,
(byte)(OptionDataMinimumLength + compartmentBitmap.Length)).Concat(
domainOfInterpretationBytes)
......
using System;
using PcapDotNet.Base;
namespace PcapDotNet.Packets.IpV6
......@@ -74,6 +75,8 @@ namespace PcapDotNet.Packets.IpV6
/// <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 < OptionDataMinimumLength)
return null;
......
using System;
namespace PcapDotNet.Packets.IpV6
{
/// <summary>
......@@ -54,6 +56,8 @@ namespace PcapDotNet.Packets.IpV6
/// <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);
......
......@@ -15,15 +15,15 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+----------------------------+
/// </pre>
/// </summary>
[IpV6OptionTypeRegistration(IpV6OptionType.IlnpNonce)]
public sealed class IpV6OptionIlnpNonce : IpV6OptionComplex, IIpV6OptionComplexFactory
[IpV6OptionTypeRegistration(IpV6OptionType.IdentifierLocatorNetworkProtocolNonce)]
public sealed class IpV6OptionIdentifierLocatorNetworkProtocolNonce : IpV6OptionComplex, IIpV6OptionComplexFactory
{
/// <summary>
/// Creates an instance from nonce.
/// </summary>
/// <param name="nonce">An unpredictable cryptographically random value used to prevent off-path attacks on an ILNP session.</param>
public IpV6OptionIlnpNonce(DataSegment nonce)
: base(IpV6OptionType.IlnpNonce)
public IpV6OptionIdentifierLocatorNetworkProtocolNonce(DataSegment nonce)
: base(IpV6OptionType.IdentifierLocatorNetworkProtocolNonce)
{
Nonce = nonce;
}
......@@ -40,7 +40,7 @@ namespace PcapDotNet.Packets.IpV6
/// <returns>The option if parsing was successful, null otherwise.</returns>
public IpV6Option CreateInstance(DataSegment data)
{
return new IpV6OptionIlnpNonce(data);
return new IpV6OptionIdentifierLocatorNetworkProtocolNonce(data);
}
internal override int DataLength
......@@ -50,7 +50,7 @@ namespace PcapDotNet.Packets.IpV6
internal override bool EqualsData(IpV6Option other)
{
return EqualsData(other as IpV6OptionIlnpNonce);
return EqualsData(other as IpV6OptionIdentifierLocatorNetworkProtocolNonce);
}
internal override int GetDataHashCode()
......@@ -63,12 +63,12 @@ namespace PcapDotNet.Packets.IpV6
buffer.Write(ref offset, Nonce);
}
private IpV6OptionIlnpNonce()
private IpV6OptionIdentifierLocatorNetworkProtocolNonce()
: this(DataSegment.Empty)
{
}
private bool EqualsData(IpV6OptionIlnpNonce other)
private bool EqualsData(IpV6OptionIdentifierLocatorNetworkProtocolNonce other)
{
return other != null &&
Nonce.Equals(other.Nonce);
......
using System;
namespace PcapDotNet.Packets.IpV6
{
/// <summary>
......@@ -46,6 +48,8 @@ namespace PcapDotNet.Packets.IpV6
/// <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;
......
......@@ -47,6 +47,8 @@ namespace PcapDotNet.Packets.IpV6
public IpV6OptionLineIdentificationDestination(DataSegment lineIdentification)
: base(IpV6OptionType.LineIdentification)
{
if (lineIdentification == null)
throw new ArgumentNullException("lineIdentification");
if (lineIdentification.Length > byte.MaxValue)
{
throw new ArgumentOutOfRangeException("lineIdentification", lineIdentification,
......@@ -69,6 +71,8 @@ namespace PcapDotNet.Packets.IpV6
/// <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 < OptionDataMinimumLength)
return null;
......
using System;
namespace PcapDotNet.Packets.IpV6
{
/// <summary>
......@@ -39,6 +41,8 @@ namespace PcapDotNet.Packets.IpV6
/// <returns>The option if parsing was successful, null otherwise.</returns>
public IpV6Option CreateInstance(DataSegment data)
{
if (data == null)
throw new ArgumentNullException("data");
return new IpV6OptionPadN(data.Length);
}
......
using System;
using PcapDotNet.Base;
using PcapDotNet.Packets.Ip;
using PcapDotNet.Packets.IpV4;
......@@ -99,6 +100,8 @@ namespace PcapDotNet.Packets.IpV6
/// <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;
......
using System;
namespace PcapDotNet.Packets.IpV6
{
/// <summary>
......@@ -42,6 +44,8 @@ namespace PcapDotNet.Packets.IpV6
/// <returns>Router alert IPv6 option according to the data parsed.</returns>
public IpV6Option CreateInstance(DataSegment data)
{
if (data == null)
throw new ArgumentNullException("data");
if (data.Length != OptionDataLength)
return null;
......
using System;
using PcapDotNet.Base;
namespace PcapDotNet.Packets.IpV6
......@@ -20,7 +21,7 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+---------------------------------+
/// </pre>
/// </summary>
[IpV6OptionTypeRegistration(IpV6OptionType.RplOption)]
[IpV6OptionTypeRegistration(IpV6OptionType.RoutingProtocolLowPowerAndLossyNetworksOption)]
public sealed class IpV6OptionRoutingProtocolLowPowerAndLossyNetworks : IpV6OptionComplex, IIpV6OptionComplexFactory
{
private static class Offset
......@@ -28,9 +29,9 @@ namespace PcapDotNet.Packets.IpV6
public const int Down = 0;
public const int RankError = Down;
public const int ForwardingError = RankError;
public const int RplInstanceId = ForwardingError + sizeof(byte);
public const int SenderRank = RplInstanceId + sizeof(byte);
public const int SubTlvs = SenderRank + sizeof(ushort);
public const int RoutingProtocolLowPowerAndLossyNetworksInstanceId = ForwardingError + sizeof(byte);
public const int SenderRank = RoutingProtocolLowPowerAndLossyNetworksInstanceId + sizeof(byte);
public const int SubTypeLengthValues = SenderRank + sizeof(ushort);
}
private static class Mask
......@@ -43,7 +44,7 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// The minimum number of bytes this option data takes.
/// </summary>
public const int OptionDataMinimumLength = Offset.SubTlvs;
public const int OptionDataMinimumLength = Offset.SubTypeLengthValues;
/// <summary>
/// Creates an instance from down, rank error, forwarding error, RPL instance id, sender rank and sub TLVs.
......@@ -64,21 +65,22 @@ namespace PcapDotNet.Packets.IpV6
/// The Forward Error flag might be set by a child node that does not have a route to destination for a packet with the Down flag set.
/// A host or RPL leaf node must set the Forwarding error flag to 0.
/// </param>
/// <param name="rplInstanceId">Indicating the DODAG instance along which the packet is sent.</param>
/// <param name="routingProtocolLowPowerAndLossyNetworksInstanceId">Indicating the DODAG instance along which the packet is sent.</param>
/// <param name="senderRank">Set to zero by the source and to DAGRank(rank) by a router that forwards inside the RPL network.</param>
/// <param name="subTlvs">
/// <param name="subtypeLengthValues">
/// A RPL device must skip over any unrecognized sub-TLVs and attempt to process any additional sub-TLVs that may appear after.
/// </param>
public IpV6OptionRoutingProtocolLowPowerAndLossyNetworks(bool down, bool rankError, bool forwardingError, byte rplInstanceId, ushort senderRank,
DataSegment subTlvs)
: base(IpV6OptionType.RplOption)
public IpV6OptionRoutingProtocolLowPowerAndLossyNetworks(bool down, bool rankError, bool forwardingError,
byte routingProtocolLowPowerAndLossyNetworksInstanceId, ushort senderRank,
DataSegment subtypeLengthValues)
: base(IpV6OptionType.RoutingProtocolLowPowerAndLossyNetworksOption)
{
Down = down;
RankError = rankError;
ForwardingError = forwardingError;
RplInstanceId = rplInstanceId;
RoutingProtocolLowPowerAndLossyNetworksInstanceId = routingProtocolLowPowerAndLossyNetworksInstanceId;
SenderRank = senderRank;
SubTlvs = subTlvs;
SubtypeLengthValues = subtypeLengthValues;
}
/// <summary>
......@@ -106,7 +108,7 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// Indicating the DODAG instance along which the packet is sent.
/// </summary>
public byte RplInstanceId { get; private set; }
public byte RoutingProtocolLowPowerAndLossyNetworksInstanceId { get; private set; }
/// <summary>
/// Set to zero by the source and to DAGRank(rank) by a router that forwards inside the RPL network.
......@@ -116,7 +118,7 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// A RPL device must skip over any unrecognized sub-TLVs and attempt to process any additional sub-TLVs that may appear after.
/// </summary>
public DataSegment SubTlvs { get; private set; }
public DataSegment SubtypeLengthValues { get; private set; }
/// <summary>
/// Parses an option from the given data.
......@@ -125,22 +127,24 @@ namespace PcapDotNet.Packets.IpV6
/// <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 < OptionDataMinimumLength)
return null;
bool down = data.ReadBool(Offset.Down, Mask.Down);
bool rankError = data.ReadBool(Offset.RankError, Mask.RankError);
bool forwardingError = data.ReadBool(Offset.ForwardingError, Mask.ForwardingError);
byte rplInstanceId = data[Offset.RplInstanceId];
byte rplInstanceId = data[Offset.RoutingProtocolLowPowerAndLossyNetworksInstanceId];
ushort senderRank = data.ReadUShort(Offset.SenderRank, Endianity.Big);
DataSegment subTlvs = data.Subsegment(Offset.SubTlvs, data.Length - Offset.SubTlvs);
DataSegment subTlvs = data.Subsegment(Offset.SubTypeLengthValues, data.Length - Offset.SubTypeLengthValues);
return new IpV6OptionRoutingProtocolLowPowerAndLossyNetworks(down, rankError, forwardingError, rplInstanceId, senderRank, subTlvs);
}
internal override int DataLength
{
get { return OptionDataMinimumLength + SubTlvs.Length; }
get { return OptionDataMinimumLength + SubtypeLengthValues.Length; }
}
internal override bool EqualsData(IpV6Option other)
......@@ -150,16 +154,16 @@ namespace PcapDotNet.Packets.IpV6
internal override int GetDataHashCode()
{
return Sequence.GetHashCode(BitSequence.Merge(BitSequence.Merge(Down, RankError, ForwardingError), RplInstanceId, SenderRank), SubTlvs);
return Sequence.GetHashCode(BitSequence.Merge(BitSequence.Merge(Down, RankError, ForwardingError), RoutingProtocolLowPowerAndLossyNetworksInstanceId, SenderRank), SubtypeLengthValues);
}
internal override void WriteData(byte[] buffer, ref int offset)
{
byte flags = (byte)((Down ? Mask.Down : 0) | (RankError ? Mask.RankError : 0) | (ForwardingError ? Mask.ForwardingError : 0));
buffer.Write(ref offset, flags);
buffer.Write(ref offset, RplInstanceId);
buffer.Write(ref offset, RoutingProtocolLowPowerAndLossyNetworksInstanceId);
buffer.Write(ref offset, SenderRank, Endianity.Big);
buffer.Write(ref offset, SubTlvs);
buffer.Write(ref offset, SubtypeLengthValues);
}
private IpV6OptionRoutingProtocolLowPowerAndLossyNetworks()
......@@ -170,8 +174,8 @@ namespace PcapDotNet.Packets.IpV6
private bool EqualsData(IpV6OptionRoutingProtocolLowPowerAndLossyNetworks other)
{
return other != null &&
Down == other.Down && RankError == other.RankError && ForwardingError == other.ForwardingError && RplInstanceId == other.RplInstanceId &&
SenderRank == other.SenderRank && SubTlvs.Equals(SubTlvs);
Down == other.Down && RankError == other.RankError && ForwardingError == other.ForwardingError && RoutingProtocolLowPowerAndLossyNetworksInstanceId == other.RoutingProtocolLowPowerAndLossyNetworksInstanceId &&
SenderRank == other.SenderRank && SubtypeLengthValues.Equals(SubtypeLengthValues);
}
}
}
\ No newline at end of file
......@@ -17,7 +17,7 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+----------------------+
/// </pre>
/// </summary>
public abstract class IpV6OptionSmfDpd : IpV6OptionComplex
public abstract class IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetection : IpV6OptionComplex
{
private static class Offset
{
......@@ -36,13 +36,13 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// Identifying DPD marking type.
/// 0 == sequence-based approach with optional TaggerId and a tuple-based sequence number. See <see cref="IpV6OptionSmfDpdSequenceBased"/>.
/// 0 == sequence-based approach with optional TaggerId and a tuple-based sequence number. See <see cref="IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased"/>.
/// 1 == indicates a hash assist value (HAV) field follows to aid in avoiding hash-based DPD collisions.
/// </summary>
public abstract bool HashIndicator { get; }
internal IpV6OptionSmfDpd()
: base(IpV6OptionType.SmfDpd)
internal IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetection()
: base(IpV6OptionType.SimplifiedMulticastForwardingDuplicatePacketDetection)
{
}
......@@ -53,17 +53,17 @@ namespace PcapDotNet.Packets.IpV6
bool hashIndicator = data.ReadBool(Offset.HashIndicator, Mask.HashIndicator);
if (hashIndicator)
return new IpV6OptionSmfDpdSequenceHashAssistValue(data);
return IpV6OptionSmfDpdSequenceBased.CreateSpecificInstance(data);
return new IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceHashAssistValue(data);
return IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased.CreateSpecificInstance(data);
}
}
[IpV6OptionTypeRegistration(IpV6OptionType.SmfDpd)]
[IpV6OptionTypeRegistration(IpV6OptionType.SimplifiedMulticastForwardingDuplicatePacketDetection)]
internal class IpV6OptionSmfDpdFactory : IIpV6OptionComplexFactory
{
public IpV6Option CreateInstance(DataSegment data)
{
return IpV6OptionSmfDpd.CreateInstance(data);
return IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetection.CreateInstance(data);
}
}
}
\ No newline at end of file
......@@ -26,7 +26,7 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+--------------------+
/// </pre>
/// </summary>
public sealed class IpV6OptionSmfDpdDefault : IpV6OptionSmfDpdSequenceBased
public sealed class IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionDefault : IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased
{
/// <summary>
/// Creates an instance from tagger id and identifier.
......@@ -42,9 +42,11 @@ namespace PcapDotNet.Packets.IpV6
/// 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 IpV6OptionSmfDpdDefault(DataSegment taggerId, DataSegment identifier)
public IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionDefault(DataSegment taggerId, DataSegment identifier)
: base(identifier)
{
if (taggerId == null)
throw new ArgumentNullException("taggerId");
if (taggerId.Length > TaggerIdMaxLength)
{
throw new ArgumentOutOfRangeException("taggerId", taggerId,
......@@ -82,9 +84,9 @@ namespace PcapDotNet.Packets.IpV6
get { return IpV6TaggerIdType.Default; }
}
internal override bool EqualsTaggerId(IpV6OptionSmfDpdSequenceBased other)
internal override bool EqualsTaggerId(IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased other)
{
return EqualsTaggerId(other as IpV6OptionSmfDpdDefault);
return EqualsTaggerId(other as IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionDefault);
}
internal override int GetTaggerIdHashCode()
......@@ -97,7 +99,7 @@ namespace PcapDotNet.Packets.IpV6
buffer.Write(ref offset, TaggerId);
}
private bool EqualsTaggerId(IpV6OptionSmfDpdDefault other)
private bool EqualsTaggerId(IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionDefault other)
{
return other != null &&
TaggerId.Equals(other.TaggerId);
......
......@@ -27,7 +27,7 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+--------------------+
/// </pre>
/// </summary>
public sealed class IpV6OptionSmfDpdIpV4 : IpV6OptionSmfDpdSequenceBased
public sealed class IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV4 : IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased
{
/// <summary>
/// Creates an instance from tagger id and identifier.
......@@ -42,7 +42,7 @@ namespace PcapDotNet.Packets.IpV6
/// 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 IpV6OptionSmfDpdIpV4(IpV4Address taggerId, DataSegment identifier)
public IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV4(IpV4Address taggerId, DataSegment identifier)
: base(identifier)
{
TaggerId = taggerId;
......@@ -69,9 +69,9 @@ namespace PcapDotNet.Packets.IpV6
get { return IpV6TaggerIdType.IpV4; }
}
internal override bool EqualsTaggerId(IpV6OptionSmfDpdSequenceBased other)
internal override bool EqualsTaggerId(IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased other)
{
return EqualsTaggerId(other as IpV6OptionSmfDpdIpV4);
return EqualsTaggerId(other as IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV4);
}
internal override int GetTaggerIdHashCode()
......@@ -84,7 +84,7 @@ namespace PcapDotNet.Packets.IpV6
buffer.Write(ref offset, TaggerId, Endianity.Big);
}
private bool EqualsTaggerId(IpV6OptionSmfDpdIpV4 other)
private bool EqualsTaggerId(IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV4 other)
{
return other != null &&
TaggerId.Equals(other.TaggerId);
......
......@@ -37,7 +37,7 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+--------------------+
/// </pre>
/// </summary>
public sealed class IpV6OptionSmfDpdIpV6 : IpV6OptionSmfDpdSequenceBased
public sealed class IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV6 : IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased
{
/// <summary>
/// Creates an instance from tagger id and identifier.
......@@ -52,7 +52,7 @@ namespace PcapDotNet.Packets.IpV6
/// 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 IpV6OptionSmfDpdIpV6(IpV6Address taggerId, DataSegment identifier)
public IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV6(IpV6Address taggerId, DataSegment identifier)
: base(identifier)
{
TaggerId = taggerId;
......@@ -79,9 +79,9 @@ namespace PcapDotNet.Packets.IpV6
get { return IpV6TaggerIdType.IpV6; }
}
internal override bool EqualsTaggerId(IpV6OptionSmfDpdSequenceBased other)
internal override bool EqualsTaggerId(IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased other)
{
return EqualsTaggerId(other as IpV6OptionSmfDpdIpV6);
return EqualsTaggerId(other as IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV6);
}
internal override int GetTaggerIdHashCode()
......@@ -94,7 +94,7 @@ namespace PcapDotNet.Packets.IpV6
buffer.Write(ref offset, TaggerId, Endianity.Big);
}
private bool EqualsTaggerId(IpV6OptionSmfDpdIpV6 other)
private bool EqualsTaggerId(IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV6 other)
{
return other != null &&
TaggerId.Equals(other.TaggerId);
......
......@@ -20,7 +20,7 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+--------------------+
/// </pre>
/// </summary>
public sealed class IpV6OptionSmfDpdNull : IpV6OptionSmfDpdSequenceBased
public sealed class IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionNull : IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased
{
/// <summary>
/// Creates an instance from an identifier.
......@@ -32,7 +32,7 @@ namespace PcapDotNet.Packets.IpV6
/// 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 IpV6OptionSmfDpdNull(DataSegment identifier)
public IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionNull(DataSegment identifier)
: base(identifier)
{
}
......@@ -53,7 +53,7 @@ namespace PcapDotNet.Packets.IpV6
get { return IpV6TaggerIdType.Null; }
}
internal override bool EqualsTaggerId(IpV6OptionSmfDpdSequenceBased other)
internal override bool EqualsTaggerId(IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased other)
{
return true;
}
......
......@@ -25,7 +25,7 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+--------------------+
/// </pre>
/// </summary>
public abstract class IpV6OptionSmfDpdSequenceBased : IpV6OptionSmfDpd
public abstract class IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased : IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetection
{
internal const int TaggerIdMaxLength = 0xF + 1;
......@@ -63,7 +63,7 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// Identifying DPD marking type.
/// 0 == sequence-based approach with optional TaggerId and a tuple-based sequence number. See <see cref="IpV6OptionSmfDpdSequenceBased"/>.
/// 0 == sequence-based approach with optional TaggerId and a tuple-based sequence number. See <see cref="IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased"/>.
/// 1 == indicates a hash assist value (HAV) field follows to aid in avoiding hash-based DPD collisions.
/// </summary>
public override bool HashIndicator
......@@ -76,7 +76,7 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
public abstract IpV6TaggerIdType TaggerIdType { get; }
internal IpV6OptionSmfDpdSequenceBased(DataSegment identifier)
internal IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased(DataSegment identifier)
{
Identifier = identifier;
}
......@@ -88,7 +88,7 @@ namespace PcapDotNet.Packets.IpV6
internal sealed override bool EqualsData(IpV6Option other)
{
return EqualsData(other as IpV6OptionSmfDpdSequenceBased);
return EqualsData(other as IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased);
}
internal sealed override int GetDataHashCode()
......@@ -96,7 +96,7 @@ namespace PcapDotNet.Packets.IpV6
return Sequence.GetHashCode(Identifier, TaggerIdType, GetTaggerIdHashCode());
}
internal abstract bool EqualsTaggerId(IpV6OptionSmfDpdSequenceBased other);
internal abstract bool EqualsTaggerId(IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased other);
internal abstract int GetTaggerIdHashCode();
......@@ -112,7 +112,7 @@ namespace PcapDotNet.Packets.IpV6
internal abstract void WriteTaggerId(byte[] buffer, ref int offset);
internal static IpV6OptionSmfDpdSequenceBased CreateSpecificInstance(DataSegment data)
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);
......@@ -122,29 +122,29 @@ namespace PcapDotNet.Packets.IpV6
switch (taggerIdType)
{
case IpV6TaggerIdType.Null:
return new IpV6OptionSmfDpdNull(identifier);
return new IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionNull(identifier);
case IpV6TaggerIdType.Default:
return new IpV6OptionSmfDpdDefault(data.Subsegment(Offset.TaggerId, taggerIdLength), identifier);
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 IpV6OptionSmfDpdIpV4(ipV4Address, identifier);
return new IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV4(ipV4Address, identifier);
case IpV6TaggerIdType.IpV6:
if (taggerIdLength != IpV6Address.SizeOf)
return null;
IpV6Address ipV6Address = data.ReadIpV6Address(Offset.TaggerId, Endianity.Big);
return new IpV6OptionSmfDpdIpV6(ipV6Address, identifier);
return new IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV6(ipV6Address, identifier);
default:
return null;
}
}
private bool EqualsData(IpV6OptionSmfDpdSequenceBased other)
private bool EqualsData(IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased other)
{
return other != null &&
Identifier.Equals(other.Identifier) && TaggerIdType == other.TaggerIdType && EqualsTaggerId(other);
......
using System;
namespace PcapDotNet.Packets.IpV6
{
/// <summary>
......@@ -18,7 +20,7 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+--------------+
/// </pre>
/// </summary>
public sealed class IpV6OptionSmfDpdSequenceHashAssistValue : IpV6OptionSmfDpd
public sealed class IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceHashAssistValue : IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetection
{
private static class Offset
{
......@@ -31,8 +33,10 @@ namespace PcapDotNet.Packets.IpV6
/// <param name="data">
/// The first bit of the data is ignored, and the rest are considered to be the Hash assist value (HAV) used to facilitate H-DPD operation.
/// </param>
public IpV6OptionSmfDpdSequenceHashAssistValue(DataSegment data)
public IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceHashAssistValue(DataSegment data)
{
if (data == null)
throw new ArgumentNullException("data");
byte[] hashAssistValueBuffer = new byte[data.Length - Offset.HashAssistValue];
data.Buffer.BlockCopy(data.StartOffset + Offset.HashAssistValue, hashAssistValueBuffer, 0, hashAssistValueBuffer.Length);
hashAssistValueBuffer[0] &= 0x7F;
......@@ -59,7 +63,7 @@ namespace PcapDotNet.Packets.IpV6
internal override bool EqualsData(IpV6Option other)
{
return EqualsData(other as IpV6OptionSmfDpdSequenceHashAssistValue);
return EqualsData(other as IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceHashAssistValue);
}
internal override int GetDataHashCode()
......@@ -73,7 +77,7 @@ namespace PcapDotNet.Packets.IpV6
buffer.Write(ref offset, HashAssistValue.Subsegment(1, HashAssistValue.Length - 1));
}
private bool EqualsData(IpV6OptionSmfDpdSequenceHashAssistValue other)
private bool EqualsData(IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceHashAssistValue other)
{
return other != null &&
HashAssistValue.Equals(other.HashAssistValue);
......
using System;
namespace PcapDotNet.Packets.IpV6
{
/// <summary>
......@@ -42,6 +44,8 @@ namespace PcapDotNet.Packets.IpV6
/// <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;
......
......@@ -43,7 +43,7 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 6621.
/// </summary>
SmfDpd = 0x08,
SimplifiedMulticastForwardingDuplicatePacketDetection = 0x08,
/// <summary>
/// RFC 6275.
......@@ -58,12 +58,12 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 6553.
/// </summary>
RplOption = 0x63,
RoutingProtocolLowPowerAndLossyNetworksOption = 0x63,
/// <summary>
/// RFC irtf-rrg-ilnp-noncev6-06.
/// </summary>
IlnpNonce = 0x8B,
IdentifierLocatorNetworkProtocolNonce = 0x8B,
/// <summary>
/// RFC ietf-6man-lineid-08.
......
namespace PcapDotNet.Packets.IpV6
{
/// <summary>
/// The type of the Tagger ID for <see cref="IpV6OptionSmfDpdSequenceBased"/>
/// The type of the Tagger ID for <see cref="IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased"/>
/// </summary>
public enum IpV6TaggerIdType : byte
{
......
using System;
using System.Collections.Generic;
namespace PcapDotNet.Packets.IpV6
......@@ -12,16 +13,18 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// Calculates FCS16.
/// </summary>
public static ushort CalculateFcs16(IEnumerable<byte> values)
public static ushort CalculateFrameCheckSequence16(IEnumerable<byte> values)
{
return CalculateFcs16(InitialValue, values);
return CalculateFrameCheckSequence16(InitialValue, values);
}
/// <summary>
/// Calculates FCS16.
/// </summary>
public static ushort CalculateFcs16(ushort fcs, IEnumerable<byte> values)
public static ushort CalculateFrameCheckSequence16(ushort fcs, IEnumerable<byte> values)
{
if (values == null)
throw new ArgumentNullException("values");
foreach (byte value in values)
{
ushort tableValue = _fcsTable[(fcs ^ value) & 0xff];
......
......@@ -377,7 +377,7 @@
<Compile Include="IpV6\ExtensionHeaders\IpV6ExtensionHeaderOptions.cs" />
<Compile Include="IpV6\ExtensionHeaders\IpV6ExtensionHeaderRouting.cs" />
<Compile Include="IpV6\ExtensionHeaders\IpV6ExtensionHeaderRoutingHomeAddress.cs" />
<Compile Include="IpV6\ExtensionHeaders\IpV6ExtensionHeaderRoutingRpl.cs" />
<Compile Include="IpV6\ExtensionHeaders\IpV6ExtensionHeaderRoutingProtocolLowPowerAndLossyNetworks.cs" />
<Compile Include="IpV6\ExtensionHeaders\IpV6ExtensionHeaderRoutingSourceRoute.cs" />
<Compile Include="IpV6\Options\IpV6DnsUpdateStatus.cs" />
<Compile Include="IpV6\Options\IpV6FlowIdentificationStatus.cs" />
......@@ -412,8 +412,8 @@
<Compile Include="IpV6\Options\IpV6MobilityOptionBindingRefreshAdvice.cs" />
<Compile Include="IpV6\Options\IpV6MobilityOptionCareOfTest.cs" />
<Compile Include="IpV6\Options\IpV6MobilityOptionCareOfTestInit.cs" />
<Compile Include="IpV6\Options\IpV6MobilityOptionCgaParameters.cs" />
<Compile Include="IpV6\Options\IpV6MobilityOptionCgaParametersRequest.cs" />
<Compile Include="IpV6\Options\IpV6MobilityOptionCryptographicallyGeneratedAddressParameters.cs" />
<Compile Include="IpV6\Options\IpV6MobilityOptionCryptographicallyGeneratedAddressParametersRequest.cs" />
<Compile Include="IpV6\Options\IpV6MobilityOptionComplex.cs" />
<Compile Include="IpV6\Options\IpV6MobilityOptionContextRequest.cs" />
<Compile Include="IpV6\Options\IpV6MobilityOptionContextRequestEntry.cs" />
......@@ -447,7 +447,7 @@
<Compile Include="IpV6\Options\IpV6MobilityOptionMobileNodeLinkLocalAddressInterfaceIdentifier.cs" />
<Compile Include="IpV6\Options\IpV6MobilityOptionNatDetection.cs" />
<Compile Include="IpV6\Options\IpV6MobilityOptionNetworkPrefix.cs" />
<Compile Include="IpV6\Options\IpV6MobilityOptionNonceIndices.cs" />
<Compile Include="IpV6\Options\IpV6MobilityOptionNonceIndexes.cs" />
<Compile Include="IpV6\Options\IpV6MobilityOptionPad1.cs" />
<Compile Include="IpV6\Options\IpV6MobilityOptionPadN.cs" />
<Compile Include="IpV6\Options\IpV6MobilityOptionPermanentHomeKeygenToken.cs" />
......@@ -472,7 +472,7 @@
<Compile Include="IpV6\Options\IpV6OptionComplex.cs" />
<Compile Include="IpV6\Options\IpV6OptionEndpointIdentification.cs" />
<Compile Include="IpV6\Options\IpV6OptionHomeAddress.cs" />
<Compile Include="IpV6\Options\IpV6OptionIlnpNonce.cs" />
<Compile Include="IpV6\Options\IpV6OptionIdentifierLocatorNetworkProtocolNonce.cs" />
<Compile Include="IpV6\Options\IpV6OptionJumboPayload.cs" />
<Compile Include="IpV6\Options\IpV6OptionLineIdentificationDestination.cs" />
<Compile Include="IpV6\Options\IpV6OptionPad1.cs" />
......@@ -482,13 +482,13 @@
<Compile Include="IpV6\Options\IpV6OptionRoutingProtocolLowPowerAndLossyNetworks.cs" />
<Compile Include="IpV6\Options\IpV6Options.cs" />
<Compile Include="IpV6\Options\IpV6OptionSimple.cs" />
<Compile Include="IpV6\Options\IpV6OptionSmfDpd.cs" />
<Compile Include="IpV6\Options\IpV6OptionSmfDpdDefault.cs" />
<Compile Include="IpV6\Options\IpV6OptionSmfDpdIpV4.cs" />
<Compile Include="IpV6\Options\IpV6OptionSmfDpdIpV6.cs" />
<Compile Include="IpV6\Options\IpV6OptionSmfDpdNull.cs" />
<Compile Include="IpV6\Options\IpV6OptionSmfDpdSequenceBased.cs" />
<Compile Include="IpV6\Options\IpV6OptionSmfDpdSequenceHashAssistValue.cs" />
<Compile Include="IpV6\Options\IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetection.cs" />
<Compile Include="IpV6\Options\IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionDefault.cs" />
<Compile Include="IpV6\Options\IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV4.cs" />
<Compile Include="IpV6\Options\IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionIpV6.cs" />
<Compile Include="IpV6\Options\IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionNull.cs" />
<Compile Include="IpV6\Options\IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceBased.cs" />
<Compile Include="IpV6\Options\IpV6OptionSimplifiedMulticastForwardingDuplicatePacketDetectionSequenceHashAssistValue.cs" />
<Compile Include="IpV6\Options\IpV6OptionTunnelEncapsulationLimit.cs" />
<Compile Include="IpV6\Options\IpV6OptionType.cs" />
<Compile Include="IpV6\Options\IpV6OptionTypeRegistrationAttribute.cs" />
......
......@@ -65,7 +65,7 @@ namespace PcapDotNet.Packets.Transport
internal override bool EqualsData(TcpOption other)
{
return EqualsData(other as TcpOptionPartialOrderConnectionPermitted);
return (other is TcpOptionPartialOrderConnectionPermitted);
}
internal override int GetDataHashCode()
......@@ -73,11 +73,6 @@ namespace PcapDotNet.Packets.Transport
return 0;
}
private bool EqualsData(TcpOptionPartialOrderConnectionPermitted other)
{
return other != null;
}
private static readonly TcpOptionPartialOrderConnectionPermitted _instance = new TcpOptionPartialOrderConnectionPermitted();
}
}
\ No newline at end of file
......@@ -69,7 +69,7 @@ namespace PcapDotNet.Packets.Transport
internal override bool EqualsData(TcpOption other)
{
return EqualsData(other as TcpOptionSelectiveAcknowledgmentPermitted);
return other is TcpOptionSelectiveAcknowledgmentPermitted;
}
internal override int GetDataHashCode()
......@@ -77,11 +77,6 @@ namespace PcapDotNet.Packets.Transport
return 0;
}
private bool EqualsData(TcpOptionSelectiveAcknowledgmentPermitted other)
{
return other != null;
}
private static readonly TcpOptionSelectiveAcknowledgmentPermitted _instance = new TcpOptionSelectiveAcknowledgmentPermitted();
}
}
\ No newline at end of file
......@@ -33,17 +33,12 @@ namespace PcapDotNet.Packets.Transport
internal override bool EqualsData(TcpOption other)
{
return EqualsData(other as TcpOptionSimple);
return other is TcpOptionSimple;
}
internal override int GetDataHashCode()
{
return 0;
}
private bool EqualsData(TcpOptionSimple other)
{
return other != null;
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment