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