Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pcap-Net
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Pcap-Net
Commits
1c38d4e7
Commit
1c38d4e7
authored
Sep 13, 2014
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IPv6
673 warnings left Code Coverage 96.16%
parent
a1cae0f0
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
296 additions
and
83 deletions
+296
-83
SequenceTest.cs
PcapDotNet/src/PcapDotNet.Base.Test/SequenceTest.cs
+3
-9
BitSequence.cs
PcapDotNet/src/PcapDotNet.Base/BitSequence.cs
+13
-0
Sequence.cs
PcapDotNet/src/PcapDotNet.Base/Sequence.cs
+11
-7
IpOptionQuickStartCommon.cs
...Net/src/PcapDotNet.Packets/Ip/IpOptionQuickStartCommon.cs
+5
-2
IpV6ExtensionHeader.cs
...tNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeader.cs
+2
-0
IpV6ExtensionHeaderAuthentication.cs
...pV6/ExtensionHeaders/IpV6ExtensionHeaderAuthentication.cs
+7
-1
IpV6ExtensionHeaderDestinationOptions.cs
...ExtensionHeaders/IpV6ExtensionHeaderDestinationOptions.cs
+1
-1
IpV6ExtensionHeaderEncapsulatingSecurityPayload.cs
...eaders/IpV6ExtensionHeaderEncapsulatingSecurityPayload.cs
+6
-0
IpV6ExtensionHeaderFragmentData.cs
.../IpV6/ExtensionHeaders/IpV6ExtensionHeaderFragmentData.cs
+7
-1
IpV6ExtensionHeaderMobility.cs
...kets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobility.cs
+8
-0
IpV6ExtensionHeaderMobilityBindingAcknowledgementBase.cs
.../IpV6ExtensionHeaderMobilityBindingAcknowledgementBase.cs
+6
-0
IpV6ExtensionHeaderMobilityBindingError.cs
...tensionHeaders/IpV6ExtensionHeaderMobilityBindingError.cs
+9
-3
IpV6ExtensionHeaderMobilityBindingRefreshRequest.cs
...aders/IpV6ExtensionHeaderMobilityBindingRefreshRequest.cs
+6
-1
IpV6ExtensionHeaderMobilityBindingRevocationAcknowledgementMessage.cs
...nHeaderMobilityBindingRevocationAcknowledgementMessage.cs
+1
-1
IpV6ExtensionHeaderMobilityBindingRevocationMessage.cs
...rs/IpV6ExtensionHeaderMobilityBindingRevocationMessage.cs
+7
-0
IpV6ExtensionHeaderMobilityBindingUpdateBase.cs
...onHeaders/IpV6ExtensionHeaderMobilityBindingUpdateBase.cs
+16
-8
IpV6ExtensionHeaderMobilityCareOfTest.cs
...ExtensionHeaders/IpV6ExtensionHeaderMobilityCareOfTest.cs
+6
-0
IpV6ExtensionHeaderMobilityCareOfTestInit.cs
...nsionHeaders/IpV6ExtensionHeaderMobilityCareOfTestInit.cs
+5
-0
IpV6ExtensionHeaderMobilityExperimental.cs
...tensionHeaders/IpV6ExtensionHeaderMobilityExperimental.cs
+5
-0
IpV6ExtensionHeaderMobilityFastNeighborAdvertisement.cs
...s/IpV6ExtensionHeaderMobilityFastNeighborAdvertisement.cs
+5
-0
IpV6ExtensionHeaderMobilityHandoverAcknowledgeMessage.cs
.../IpV6ExtensionHeaderMobilityHandoverAcknowledgeMessage.cs
+9
-3
IpV6ExtensionHeaderMobilityHandoverInitiateMessage.cs
...ers/IpV6ExtensionHeaderMobilityHandoverInitiateMessage.cs
+6
-0
IpV6ExtensionHeaderMobilityHeartbeatMessage.cs
...ionHeaders/IpV6ExtensionHeaderMobilityHeartbeatMessage.cs
+6
-0
IpV6ExtensionHeaderMobilityHomeAgentSwitchMessage.cs
...ders/IpV6ExtensionHeaderMobilityHomeAgentSwitchMessage.cs
+5
-0
IpV6ExtensionHeaderMobilityHomeTest.cs
...6/ExtensionHeaders/IpV6ExtensionHeaderMobilityHomeTest.cs
+6
-0
IpV6ExtensionHeaderMobilityHomeTestInit.cs
...tensionHeaders/IpV6ExtensionHeaderMobilityHomeTestInit.cs
+5
-0
IpV6ExtensionHeaderMobilityLocalizedRouting.cs
...ionHeaders/IpV6ExtensionHeaderMobilityLocalizedRouting.cs
+8
-0
IpV6ExtensionHeaderMobilityLocalizedRoutingAcknowledgement.cs
...ExtensionHeaderMobilityLocalizedRoutingAcknowledgement.cs
+6
-0
IpV6ExtensionHeaderMobilityLocalizedRoutingInitiation.cs
.../IpV6ExtensionHeaderMobilityLocalizedRoutingInitiation.cs
+5
-0
IpV6ExtensionHeaderOptions.cs
...ckets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderOptions.cs
+5
-0
IpV6ExtensionHeaderRouting.cs
...ckets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderRouting.cs
+8
-0
IpV6ExtensionHeaderRoutingHomeAddress.cs
...ExtensionHeaders/IpV6ExtensionHeaderRoutingHomeAddress.cs
+5
-0
IpV6ExtensionHeaderRoutingRpl.cs
...ts/IpV6/ExtensionHeaders/IpV6ExtensionHeaderRoutingRpl.cs
+6
-0
IpV6ExtensionHeaderRoutingSourceRoute.cs
...ExtensionHeaders/IpV6ExtensionHeaderRoutingSourceRoute.cs
+5
-0
IpV6ExtensionHeaderStandard.cs
...kets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderStandard.cs
+7
-0
IpV6ExtensionHeaders.cs
...Net.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaders.cs
+15
-1
IIpV6MobilityOptionIpV4HomeAddress.cs
...ackets/IpV6/Options/IIpV6MobilityOptionIpV4HomeAddress.cs
+20
-0
IpV6MobilityOptionIpV4HomeAddressRequest.cs
.../IpV6/Options/IpV6MobilityOptionIpV4HomeAddressRequest.cs
+1
-10
IpV6MobilityOptionPad1.cs
...PcapDotNet.Packets/IpV6/Options/IpV6MobilityOptionPad1.cs
+37
-0
IpV6OptionPad1.cs
...Net/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionPad1.cs
+0
-35
PcapDotNet.Packets.csproj
PcapDotNet/src/PcapDotNet.Packets/PcapDotNet.Packets.csproj
+2
-0
No files found.
PcapDotNet/src/PcapDotNet.Base.Test/SequenceTest.cs
View file @
1c38d4e7
...
...
@@ -38,27 +38,21 @@ namespace PcapDotNet.Base.Test
#
endregion
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
GetHashCodeNullValue1Test
()
{
Assert
.
IsNotNull
(
Sequence
.
GetHashCode
(
null
,
1
));
Assert
.
Fail
();
Assert
.
AreEqual
(
1.
GetHashCode
(),
Sequence
.
GetHashCode
(
null
,
1
));
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
GetHashCodeNullValue2Test
()
{
Assert
.
IsNotNull
(
Sequence
.
GetHashCode
(
1
,
null
));
Assert
.
Fail
();
Assert
.
AreEqual
(
1.
GetHashCode
(),
Sequence
.
GetHashCode
(
1
,
null
));
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentNullException
),
AllowDerivedTypes
=
false
)]
public
void
GetHashCodeNullValue3Test
()
{
Assert
.
IsNotNull
(
Sequence
.
GetHashCode
(
1
,
2
,
null
));
Assert
.
Fail
();
Assert
.
AreEqual
(
Sequence
.
GetHashCode
(
1
,
2
),
Sequence
.
GetHashCode
(
1
,
2
,
null
));
}
[
TestMethod
]
...
...
PcapDotNet/src/PcapDotNet.Base/BitSequence.cs
View file @
1c38d4e7
...
...
@@ -296,6 +296,19 @@ namespace PcapDotNet.Base
return
Merge
(
Merge
(
value1
,
value2
),
value3
);
}
/// <summary>
/// Merges a uint and 2 ushorts to a ulong.
/// values should be arranged from the most significant to the least.
/// </summary>
/// <param name="value1">Bits 0-31 of the ulong.</param>
/// <param name="value2">Bits 32-47 of the ulong.</param>
/// <param name="value3">Bits 48-63 of the ulong.</param>
/// <returns>A ulong whose bits are determined by the input.</returns>
public
static
ulong
Merge
(
uint
value1
,
ushort
value2
,
ushort
value3
)
{
return
Merge
(
value1
,
Merge
(
value2
,
value3
));
}
/// <summary>
/// Merges 2 uints to a ulong.
/// uints should be arranged from the most significant to the least.
...
...
PcapDotNet/src/PcapDotNet.Base/Sequence.cs
View file @
1c38d4e7
...
...
@@ -12,10 +12,10 @@ namespace PcapDotNet.Base
/// </summary>
public
static
int
GetHashCode
(
object
value1
,
object
value2
)
{
if
(
value1
==
null
)
throw
new
ArgumentNullException
(
"value1"
);
if
(
value1
==
null
)
return
value2
.
GetHashCode
(
);
if
(
value2
==
null
)
throw
new
ArgumentNullException
(
"value2"
);
return
value1
.
GetHashCode
(
);
return
value1
.
GetHashCode
()
^
value2
.
GetHashCode
();
}
...
...
@@ -25,10 +25,11 @@ namespace PcapDotNet.Base
/// </summary>
public
static
int
GetHashCode
(
object
value1
,
object
value2
,
object
value3
)
{
int
result
=
GetHashCode
(
value1
,
value2
);
if
(
value3
==
null
)
throw
new
ArgumentNullException
(
"value3"
)
;
return
result
;
return
GetHashCode
(
value1
,
value2
)
^
value3
.
GetHashCode
();
return
result
^
value3
.
GetHashCode
();
}
/// <summary>
...
...
@@ -40,8 +41,11 @@ namespace PcapDotNet.Base
throw
new
ArgumentNullException
(
"values"
);
int
result
=
0
;
for
(
int
i
=
0
;
i
!=
values
.
Length
;
++
i
)
result
^=
values
[
i
].
GetHashCode
();
foreach
(
object
value
in
values
)
{
if
(
value
!=
null
)
result
^=
value
.
GetHashCode
();
}
return
result
;
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Ip/IpOptionQuickStartCommon.cs
View file @
1c38d4e7
...
...
@@ -3,15 +3,18 @@ using PcapDotNet.Packets.IpV4;
namespace
PcapDotNet.Packets.Ip
{
/// <summary>
/// Contains common QuickStart option parameters.
/// </summary>
public
static
class
IpOptionQuickStartCommon
{
internal
const
int
DataLength
=
6
;
/// <summary>
/// The maximum value for the rate field.
/// </summary>
public
const
byte
RateMaximumValue
=
0x0F
;
internal
const
int
DataLength
=
6
;
private
static
class
Offset
{
public
const
int
Function
=
0
;
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeader.cs
View file @
1c38d4e7
...
...
@@ -32,6 +32,8 @@ namespace PcapDotNet.Packets.IpV6
public
abstract
bool
Equals
(
IpV6ExtensionHeader
other
);
public
abstract
override
int
GetHashCode
();
internal
static
bool
IsExtensionHeader
(
IpV4Protocol
nextHeader
)
{
if
(
IpV6ExtensionHeaderStandard
.
IsStandard
(
nextHeader
))
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderAuthentication.cs
View file @
1c38d4e7
using
System
;
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
...
...
@@ -20,7 +21,7 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+--------------------------------------+
/// </pre>
/// </summary>
public
class
IpV6ExtensionHeaderAuthentication
:
IpV6ExtensionHeader
,
IEquatable
<
IpV6ExtensionHeaderAuthentication
>
public
sealed
class
IpV6ExtensionHeaderAuthentication
:
IpV6ExtensionHeader
,
IEquatable
<
IpV6ExtensionHeaderAuthentication
>
{
private
static
class
Offset
{
...
...
@@ -154,6 +155,11 @@ namespace PcapDotNet.Packets.IpV6
AuthenticationData
.
Equals
(
other
.
AuthenticationData
);
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
NextHeader
,
SecurityParametersIndex
,
SequenceNumber
,
AuthenticationData
);
}
internal
override
void
Write
(
byte
[]
buffer
,
ref
int
offset
)
{
buffer
.
Write
(
offset
+
Offset
.
NextHeader
,
(
byte
)
NextHeader
);
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderDestinationOptions.cs
View file @
1c38d4e7
...
...
@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+---------------------------------------+
/// </pre>
/// </summary>
public
class
IpV6ExtensionHeaderDestinationOptions
:
IpV6ExtensionHeaderOptions
public
sealed
class
IpV6ExtensionHeaderDestinationOptions
:
IpV6ExtensionHeaderOptions
{
public
IpV6ExtensionHeaderDestinationOptions
(
IpV4Protocol
nextHeader
,
IpV6Options
options
)
:
base
(
nextHeader
,
options
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderEncapsulatingSecurityPayload.cs
View file @
1c38d4e7
using
System
;
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
...
...
@@ -92,6 +93,11 @@ namespace PcapDotNet.Packets.IpV6
EncryptedDataAndAuthenticationData
.
Equals
(
other
.
EncryptedDataAndAuthenticationData
);
}
public
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
SecurityParametersIndex
,
SequenceNumber
,
EncryptedDataAndAuthenticationData
);
}
/// <summary>
/// <para>
/// The SPI is an arbitrary 32-bit value that, in combination with the destination IP address and security protocol (ESP),
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderFragmentData.cs
View file @
1c38d4e7
using
System
;
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
...
...
@@ -15,7 +16,7 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+----------------------------------------------------------------------+
/// </pre>
/// </summary>
public
class
IpV6ExtensionHeaderFragmentData
:
IpV6ExtensionHeaderStandard
public
sealed
class
IpV6ExtensionHeaderFragmentData
:
IpV6ExtensionHeaderStandard
{
private
static
class
DataOffset
{
...
...
@@ -99,6 +100,11 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsData
(
other
as
IpV6ExtensionHeaderFragmentData
);
}
internal
override
int
GetDataHashCode
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
FragmentOffset
,
MoreFragments
.
ToByte
()),
Identification
);
}
internal
override
void
WriteData
(
byte
[]
buffer
,
int
offset
)
{
ushort
fragmentOffsetAndMoreFragments
=
(
ushort
)(
FragmentOffset
<<
DataShift
.
FragmentOffset
);
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobility.cs
View file @
1c38d4e7
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
...
...
@@ -185,8 +186,15 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsData
(
other
as
IpV6ExtensionHeaderMobility
);
}
internal
sealed
override
int
GetDataHashCode
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
Checksum
,
(
byte
)
MobilityHeaderType
),
MobilityOptions
,
GetMessageDataHashCode
());
}
internal
abstract
bool
EqualsMessageData
(
IpV6ExtensionHeaderMobility
other
);
internal
abstract
int
GetMessageDataHashCode
();
private
bool
EqualsData
(
IpV6ExtensionHeaderMobility
other
)
{
return
other
!=
null
&&
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityBindingAcknowledgementBase.cs
View file @
1c38d4e7
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
...
...
@@ -101,6 +102,11 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsMessageData
(
other
as
IpV6ExtensionHeaderMobilityBindingAcknowledgementBase
);
}
internal
override
int
GetMessageDataHashCode
()
{
return
BitSequence
.
Merge
(
BitSequence
.
Merge
((
byte
)
Status
,
KeyManagementMobilityCapability
.
ToByte
()),
SequenceNumber
,
Lifetime
).
GetHashCode
();
}
internal
static
bool
ParseMessageDataFields
(
DataSegment
messageData
,
out
IpV6BindingAcknowledgementStatus
status
,
out
bool
keyManagementMobilityCapability
,
out
ushort
sequenceNumber
,
out
ushort
lifetime
,
out
IpV6MobilityOptions
options
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityBindingError.cs
View file @
1c38d4e7
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
...
...
@@ -79,10 +80,9 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsMessageData
(
other
as
IpV6ExtensionHeaderMobilityBindingError
);
}
private
bool
EqualsMessageData
(
IpV6ExtensionHeaderMobilityBindingError
other
)
internal
override
int
GetMessageDataHashCode
(
)
{
return
other
!=
null
&&
Status
==
other
.
Status
&&
HomeAddress
==
other
.
HomeAddress
;
return
Sequence
.
GetHashCode
(
Status
,
HomeAddress
);
}
internal
static
IpV6ExtensionHeaderMobilityBindingError
ParseMessageData
(
IpV4Protocol
nextHeader
,
ushort
checksum
,
DataSegment
messageData
)
...
...
@@ -102,5 +102,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
MessageDataOffset
.
HomeAddress
,
HomeAddress
,
Endianity
.
Big
);
MobilityOptions
.
Write
(
buffer
,
offset
+
MessageDataOffset
.
Options
);
}
private
bool
EqualsMessageData
(
IpV6ExtensionHeaderMobilityBindingError
other
)
{
return
other
!=
null
&&
Status
==
other
.
Status
&&
HomeAddress
==
other
.
HomeAddress
;
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityBindingRefreshRequest.cs
View file @
1c38d4e7
...
...
@@ -21,7 +21,7 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+---------------------------------------+
/// </pre>
/// </summary>
public
class
IpV6ExtensionHeaderMobilityBindingRefreshRequest
:
IpV6ExtensionHeaderMobility
public
sealed
class
IpV6ExtensionHeaderMobilityBindingRefreshRequest
:
IpV6ExtensionHeaderMobility
{
private
static
class
MessageDataOffset
{
...
...
@@ -67,5 +67,10 @@ namespace PcapDotNet.Packets.IpV6
{
return
other
!=
null
;
}
internal
override
int
GetMessageDataHashCode
()
{
return
0
;
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityBindingRevocationAcknowledgementMessage.cs
View file @
1c38d4e7
...
...
@@ -25,7 +25,7 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+-------------------------------------------+
/// </pre>
/// </summary>
public
class
IpV6ExtensionHeaderMobilityBindingRevocationAcknowledgementMessage
:
IpV6ExtensionHeaderMobilityBindingRevocationMessage
public
sealed
class
IpV6ExtensionHeaderMobilityBindingRevocationAcknowledgementMessage
:
IpV6ExtensionHeaderMobilityBindingRevocationMessage
{
public
IpV6ExtensionHeaderMobilityBindingRevocationAcknowledgementMessage
(
IpV4Protocol
nextHeader
,
ushort
checksum
,
Ipv6MobilityBindingRevocationStatus
status
,
ushort
sequenceNumber
,
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityBindingRevocationMessage.cs
View file @
1c38d4e7
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
...
...
@@ -114,6 +115,12 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsMessageData
(
other
as
IpV6ExtensionHeaderMobilityBindingRevocationMessage
);
}
internal
override
int
GetMessageDataHashCode
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
SequenceNumber
,
(
byte
)
BindingRevocationType
,
RevocationTriggerOrStatus
),
BitSequence
.
Merge
(
ProxyBinding
,
IpV4HomeAddressBindingOnly
,
Global
));
}
internal
static
IpV6ExtensionHeaderMobilityBindingRevocationMessage
ParseMessageData
(
IpV4Protocol
nextHeader
,
ushort
checksum
,
DataSegment
messageData
)
{
if
(
messageData
.
Length
<
MinimumMessageDataLength
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityBindingUpdateBase.cs
View file @
1c38d4e7
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
...
...
@@ -106,20 +107,18 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
public
ushort
Lifetime
{
get
;
private
set
;
}
internal
override
bool
EqualsMessageData
(
IpV6ExtensionHeaderMobility
other
)
internal
sealed
override
bool
EqualsMessageData
(
IpV6ExtensionHeaderMobility
other
)
{
return
EqualsMessageData
(
other
as
IpV6ExtensionHeaderMobilityBindingUpdateBase
);
}
private
bool
EqualsMessageData
(
IpV6ExtensionHeaderMobilityBindingUpdateBase
other
)
internal
sealed
override
int
GetMessageDataHashCode
(
)
{
return
other
!=
null
&&
SequenceNumber
==
other
.
SequenceNumber
&&
Acknowledge
==
other
.
Acknowledge
&&
HomeRegistration
==
other
.
HomeRegistration
&&
LinkLocalAddressCompatibility
==
other
.
LinkLocalAddressCompatibility
&&
KeyManagementMobilityCapability
==
other
.
KeyManagementMobilityCapability
&&
Lifetime
==
other
.
Lifetime
;
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
SequenceNumber
,
Lifetime
),
BitSequence
.
Merge
(
Acknowledge
,
HomeRegistration
,
LinkLocalAddressCompatibility
,
KeyManagementMobilityCapability
));
}
internal
override
int
MessageDataLength
internal
sealed
override
int
MessageDataLength
{
get
{
return
MinimumMessageDataLength
+
MobilityOptions
.
BytesLength
;
}
}
...
...
@@ -151,7 +150,7 @@ namespace PcapDotNet.Packets.IpV6
return
true
;
}
internal
override
void
WriteMessageData
(
byte
[]
buffer
,
int
offset
)
internal
sealed
override
void
WriteMessageData
(
byte
[]
buffer
,
int
offset
)
{
buffer
.
Write
(
offset
+
MessageDataOffset
.
SequenceNumber
,
SequenceNumber
,
Endianity
.
Big
);
...
...
@@ -169,5 +168,14 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
MessageDataOffset
.
Lifetime
,
Lifetime
,
Endianity
.
Big
);
MobilityOptions
.
Write
(
buffer
,
offset
+
MessageDataOffset
.
Options
);
}
private
bool
EqualsMessageData
(
IpV6ExtensionHeaderMobilityBindingUpdateBase
other
)
{
return
other
!=
null
&&
SequenceNumber
==
other
.
SequenceNumber
&&
Acknowledge
==
other
.
Acknowledge
&&
HomeRegistration
==
other
.
HomeRegistration
&&
LinkLocalAddressCompatibility
==
other
.
LinkLocalAddressCompatibility
&&
KeyManagementMobilityCapability
==
other
.
KeyManagementMobilityCapability
&&
Lifetime
==
other
.
Lifetime
;
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityCareOfTest.cs
View file @
1c38d4e7
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
...
...
@@ -86,6 +87,11 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsMessageData
(
other
as
IpV6ExtensionHeaderMobilityCareOfTest
);
}
internal
override
int
GetMessageDataHashCode
()
{
return
Sequence
.
GetHashCode
(
CareOfNonceIndex
,
CareOfInitCookie
,
CareOfKeygenToken
);
}
internal
static
IpV6ExtensionHeaderMobilityCareOfTest
ParseMessageData
(
IpV4Protocol
nextHeader
,
ushort
checksum
,
DataSegment
messageData
)
{
if
(
messageData
.
Length
<
MinimumMessageDataLength
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityCareOfTestInit.cs
View file @
1c38d4e7
...
...
@@ -66,6 +66,11 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsMessageData
(
other
as
IpV6ExtensionHeaderMobilityCareOfTestInit
);
}
internal
override
int
GetMessageDataHashCode
()
{
return
CareOfInitCookie
.
GetHashCode
();
}
internal
static
IpV6ExtensionHeaderMobilityCareOfTestInit
ParseMessageData
(
IpV4Protocol
nextHeader
,
ushort
checksum
,
DataSegment
messageData
)
{
if
(
messageData
.
Length
<
MinimumMessageDataLength
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityExperimental.cs
View file @
1c38d4e7
...
...
@@ -54,6 +54,11 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsMessageData
(
other
as
IpV6ExtensionHeaderMobilityExperimental
);
}
internal
override
int
GetMessageDataHashCode
()
{
return
MessageData
.
GetHashCode
();
}
internal
static
IpV6ExtensionHeaderMobilityExperimental
ParseMessageData
(
IpV4Protocol
nextHeader
,
ushort
checksum
,
DataSegment
messageData
)
{
return
new
IpV6ExtensionHeaderMobilityExperimental
(
nextHeader
,
checksum
,
messageData
);
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityFastNeighborAdvertisement.cs
View file @
1c38d4e7
...
...
@@ -55,6 +55,11 @@ namespace PcapDotNet.Packets.IpV6
return
other
!=
null
;
}
internal
override
int
GetMessageDataHashCode
()
{
return
0
;
}
internal
static
IpV6ExtensionHeaderMobilityFastNeighborAdvertisement
ParseMessageData
(
IpV4Protocol
nextHeader
,
ushort
checksum
,
DataSegment
messageData
)
{
if
(
messageData
.
Length
<
MinimumMessageDataLength
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityHandoverAcknowledgeMessage.cs
View file @
1c38d4e7
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
...
...
@@ -72,10 +73,9 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsMessageData
(
other
as
IpV6ExtensionHeaderMobilityHandoverAcknowledgeMessage
);
}
private
bool
EqualsMessageData
(
IpV6ExtensionHeaderMobilityHandoverAcknowledgeMessage
other
)
internal
override
int
GetMessageDataHashCode
(
)
{
return
other
!=
null
&&
SequenceNumber
==
other
.
SequenceNumber
&&
Code
==
other
.
Code
;
return
BitSequence
.
Merge
(
SequenceNumber
,
(
byte
)
Code
).
GetHashCode
();
}
internal
static
IpV6ExtensionHeaderMobilityHandoverAcknowledgeMessage
ParseMessageData
(
IpV4Protocol
nextHeader
,
ushort
checksum
,
DataSegment
messageData
)
...
...
@@ -95,5 +95,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
MessageDataOffset
.
Code
,
(
byte
)
Code
);
MobilityOptions
.
Write
(
buffer
,
offset
+
MessageDataOffset
.
Options
);
}
private
bool
EqualsMessageData
(
IpV6ExtensionHeaderMobilityHandoverAcknowledgeMessage
other
)
{
return
other
!=
null
&&
SequenceNumber
==
other
.
SequenceNumber
&&
Code
==
other
.
Code
;
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityHandoverInitiateMessage.cs
View file @
1c38d4e7
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
...
...
@@ -95,6 +96,11 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsMessageData
(
other
as
IpV6ExtensionHeaderMobilityHandoverInitiateMessage
);
}
internal
override
int
GetMessageDataHashCode
()
{
return
BitSequence
.
Merge
(
SequenceNumber
,
(
byte
)
Code
,
BitSequence
.
Merge
(
AssignedAddressConfiguration
,
Buffer
)).
GetHashCode
();
}
internal
static
IpV6ExtensionHeaderMobilityHandoverInitiateMessage
ParseMessageData
(
IpV4Protocol
nextHeader
,
ushort
checksum
,
DataSegment
messageData
)
{
if
(
messageData
.
Length
<
MinimumMessageDataLength
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityHeartbeatMessage.cs
View file @
1c38d4e7
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
...
...
@@ -87,6 +88,11 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsMessageData
(
other
as
IpV6ExtensionHeaderMobilityHeartbeatMessage
);
}
internal
override
int
GetMessageDataHashCode
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
IsUnsolicitedHeartbeatResponse
,
IsResponse
),
SequenceNumber
);
}
internal
static
IpV6ExtensionHeaderMobilityHeartbeatMessage
ParseMessageData
(
IpV4Protocol
nextHeader
,
ushort
checksum
,
DataSegment
messageData
)
{
if
(
messageData
.
Length
<
MinimumMessageDataLength
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityHomeAgentSwitchMessage.cs
View file @
1c38d4e7
...
...
@@ -74,6 +74,11 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsMessageData
(
other
as
IpV6ExtensionHeaderMobilityHomeAgentSwitchMessage
);
}
internal
override
int
GetMessageDataHashCode
()
{
return
HomeAgentAddresses
.
SequenceGetHashCode
();
}
internal
static
IpV6ExtensionHeaderMobilityHomeAgentSwitchMessage
ParseMessageData
(
IpV4Protocol
nextHeader
,
ushort
checksum
,
DataSegment
messageData
)
{
if
(
messageData
.
Length
<
MinimumMessageDataLength
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityHomeTest.cs
View file @
1c38d4e7
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
...
...
@@ -86,6 +87,11 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsMessageData
(
other
as
IpV6ExtensionHeaderMobilityHomeTest
);
}
internal
override
int
GetMessageDataHashCode
()
{
return
Sequence
.
GetHashCode
(
HomeNonceIndex
,
HomeInitCookie
,
HomeKeygenToken
);
}
internal
static
IpV6ExtensionHeaderMobilityHomeTest
ParseMessageData
(
IpV4Protocol
nextHeader
,
ushort
checksum
,
DataSegment
messageData
)
{
if
(
messageData
.
Length
<
MinimumMessageDataLength
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityHomeTestInit.cs
View file @
1c38d4e7
...
...
@@ -66,6 +66,11 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsMessageData
(
other
as
IpV6ExtensionHeaderMobilityHomeTestInit
);
}
internal
override
int
GetMessageDataHashCode
()
{
return
HomeInitCookie
.
GetHashCode
();
}
internal
static
IpV6ExtensionHeaderMobilityHomeTestInit
ParseMessageData
(
IpV4Protocol
nextHeader
,
ushort
checksum
,
DataSegment
messageData
)
{
if
(
messageData
.
Length
<
MinimumMessageDataLength
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityLocalizedRouting.cs
View file @
1c38d4e7
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
...
...
@@ -76,6 +77,13 @@ namespace PcapDotNet.Packets.IpV6
internal
abstract
bool
EqualsMessageDataLocalizedRoutingExtraFields
(
IpV6ExtensionHeaderMobilityLocalizedRouting
other
);
internal
sealed
override
int
GetMessageDataHashCode
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
SequenceNumber
,
Lifetime
),
GetMessageDataLocalizedRoutingExtraFieldsHashCode
());
}
internal
abstract
int
GetMessageDataLocalizedRoutingExtraFieldsHashCode
();
internal
static
bool
ParseMessageDataToFields
(
DataSegment
messageData
,
out
ushort
sequenceNumber
,
out
ushort
lifetime
,
out
IpV6MobilityOptions
options
)
{
if
(
messageData
.
Length
<
MinimumMessageDataLength
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityLocalizedRoutingAcknowledgement.cs
View file @
1c38d4e7
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
...
...
@@ -83,6 +84,11 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsMessageDataLocalizedRoutingExtraFields
(
other
as
IpV6ExtensionHeaderMobilityLocalizedRoutingAcknowledgement
);
}
internal
override
int
GetMessageDataLocalizedRoutingExtraFieldsHashCode
()
{
return
BitSequence
.
Merge
((
byte
)
Status
,
Unsolicited
.
ToByte
()).
GetHashCode
();
}
internal
override
void
WriteMessageDataBetweenSequenceNumberAndLifetime
(
byte
[]
buffer
,
int
offset
)
{
if
(
Unsolicited
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderMobilityLocalizedRoutingInitiation.cs
View file @
1c38d4e7
...
...
@@ -58,6 +58,11 @@ namespace PcapDotNet.Packets.IpV6
return
true
;
}
internal
override
int
GetMessageDataLocalizedRoutingExtraFieldsHashCode
()
{
return
0
;
}
internal
override
void
WriteMessageDataBetweenSequenceNumberAndLifetime
(
byte
[]
buffer
,
int
offset
)
{
}
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderOptions.cs
View file @
1c38d4e7
...
...
@@ -35,6 +35,11 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsData
(
other
as
IpV6ExtensionHeaderOptions
);
}
internal
sealed
override
int
GetDataHashCode
()
{
return
Options
.
GetHashCode
();
}
internal
override
void
WriteData
(
byte
[]
buffer
,
int
offset
)
{
Options
.
Write
(
buffer
,
offset
);
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderRouting.cs
View file @
1c38d4e7
using
PcapDotNet.Base
;
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
...
...
@@ -66,6 +67,13 @@ namespace PcapDotNet.Packets.IpV6
internal
abstract
bool
EqualsRoutingData
(
IpV6ExtensionHeaderRouting
other
);
internal
sealed
override
int
GetDataHashCode
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
((
byte
)
RoutingType
,
SegmentsLeft
),
GetRoutingDataHashCode
());
}
internal
abstract
int
GetRoutingDataHashCode
();
internal
static
IpV6ExtensionHeaderRouting
ParseData
(
IpV4Protocol
nextHeader
,
DataSegment
data
)
{
if
(
data
.
Length
<
DataMinimumLength
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderRoutingHomeAddress.cs
View file @
1c38d4e7
...
...
@@ -63,6 +63,11 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsRoutingData
(
other
as
IpV6ExtensionHeaderRoutingHomeAddress
);
}
internal
override
int
GetRoutingDataHashCode
()
{
return
HomeAddress
.
GetHashCode
();
}
internal
override
void
WriteRoutingData
(
byte
[]
buffer
,
int
offset
)
{
buffer
.
Write
(
offset
+
RoutingDataOffset
.
HomeAddress
,
HomeAddress
,
Endianity
.
Big
);
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderRoutingRpl.cs
View file @
1c38d4e7
...
...
@@ -201,6 +201,12 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsRoutingData
(
other
as
IpV6ExtensionHeaderRoutingRpl
);
}
internal
override
int
GetRoutingDataHashCode
()
{
return
Sequence
.
GetHashCode
(
BitSequence
.
Merge
(
CommonPrefixLengthForNonLastAddresses
,
CommonPrefixLengthForLastAddress
,
PadSize
),
Addresses
.
SequenceGetHashCode
());
}
internal
override
void
WriteRoutingData
(
byte
[]
buffer
,
int
offset
)
{
buffer
.
Write
(
offset
+
RoutingDataOffset
.
CommonPrefixLengthForNonLastAddresses
,
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderRoutingSourceRoute.cs
View file @
1c38d4e7
...
...
@@ -84,6 +84,11 @@ namespace PcapDotNet.Packets.IpV6
return
EqualsRoutingData
(
other
as
IpV6ExtensionHeaderRoutingSourceRoute
);
}
internal
override
int
GetRoutingDataHashCode
()
{
return
Addresses
.
SequenceGetHashCode
();
}
internal
override
void
WriteRoutingData
(
byte
[]
buffer
,
int
offset
)
{
for
(
int
i
=
0
;
i
!=
Addresses
.
Count
;
++
i
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderStandard.cs
View file @
1c38d4e7
...
...
@@ -35,8 +35,15 @@ namespace PcapDotNet.Packets.IpV6
Protocol
==
other
.
Protocol
&&
NextHeader
==
other
.
NextHeader
&&
EqualsData
(
other
);
}
public
sealed
override
int
GetHashCode
()
{
return
Sequence
.
GetHashCode
(
Protocol
,
NextHeader
,
GetDataHashCode
());
}
internal
abstract
bool
EqualsData
(
IpV6ExtensionHeader
other
);
internal
abstract
int
GetDataHashCode
();
internal
IpV6ExtensionHeaderStandard
(
IpV4Protocol
nextHeader
)
:
base
(
nextHeader
)
{
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaders.cs
View file @
1c38d4e7
...
...
@@ -8,8 +8,17 @@ using PcapDotNet.Packets.IpV4;
namespace
PcapDotNet.Packets.IpV6
{
/// <summary>
/// List of IPv6 extension headers.
/// </summary>
public
class
IpV6ExtensionHeaders
:
IEnumerable
<
IpV6ExtensionHeader
>,
IEquatable
<
IpV6ExtensionHeaders
>
{
/// <summary>
/// Create an object from a ReadOnlyCollection of extension headers.
/// Verifies that there's at most one Encapsulating Security Payload extension header and that it is the last extension header.
/// Assumes the collection won't be modified.
/// </summary>
/// <param name="extensionHeaders">The extension headers.</param>
public
IpV6ExtensionHeaders
(
ReadOnlyCollection
<
IpV6ExtensionHeader
>
extensionHeaders
)
{
for
(
int
i
=
0
;
i
<
extensionHeaders
.
Count
;
++
i
)
...
...
@@ -93,7 +102,7 @@ namespace PcapDotNet.Packets.IpV6
get
{
return
_empty
;
}
}
public
override
bool
Equals
(
object
obj
)
public
sealed
override
bool
Equals
(
object
obj
)
{
return
Equals
(
obj
as
IpV6ExtensionHeaders
);
}
...
...
@@ -103,6 +112,11 @@ namespace PcapDotNet.Packets.IpV6
return
other
!=
null
&&
this
.
SequenceEqual
(
other
);
}
public
override
int
GetHashCode
()
{
return
this
.
SequenceGetHashCode
();
}
internal
IpV6ExtensionHeaders
(
DataSegment
data
,
IpV4Protocol
firstHeader
)
{
IpV4Protocol
?
nextHeader
=
firstHeader
;
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IIpV6MobilityOptionIpV4HomeAddress.cs
0 → 100644
View file @
1c38d4e7
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
{
/// <summary>
/// RFC 5844.
/// </summary>
public
interface
IIpV6MobilityOptionIpV4HomeAddress
{
/// <summary>
/// The prefix length of the address.
/// </summary>
byte
PrefixLength
{
get
;
}
/// <summary>
/// Contains the IPv4 home address.
/// </summary>
IpV4Address
HomeAddress
{
get
;
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6MobilityOptionIpV4HomeAddressRequest.cs
View file @
1c38d4e7
...
...
@@ -4,15 +4,6 @@ using PcapDotNet.Packets.IpV4;
namespace
PcapDotNet.Packets.IpV6
{
/// <summary>
/// RFC 5844.
/// </summary>
public
interface
IIpV6MobilityOptionIpV4HomeAddress
{
byte
PrefixLength
{
get
;
}
IpV4Address
HomeAddress
{
get
;
}
}
/// <summary>
/// RFC 5844.
/// <pre>
...
...
@@ -67,7 +58,7 @@ namespace PcapDotNet.Packets.IpV6
public
byte
PrefixLength
{
get
;
private
set
;
}
/// <summary>
/// Contain
ing
the IPv4 home address that is being requested.
/// Contain
s
the IPv4 home address that is being requested.
/// The value of 0.0.0.0 is used to request that the local mobility anchor perform the address allocation.
/// </summary>
public
IpV4Address
HomeAddress
{
get
;
private
set
;
}
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6MobilityOptionPad1.cs
0 → 100644
View file @
1c38d4e7
using
System
;
namespace
PcapDotNet.Packets.IpV6
{
/// <summary>
/// RFC 6275.
/// +-----+-----+
/// | Bit | 0-7 |
/// +-----+-----+
/// | 0 | 0 |
/// +-----+-----+
/// </summary>
public
sealed
class
IpV6MobilityOptionPad1
:
IpV6MobilityOption
{
public
const
int
OptionLength
=
sizeof
(
byte
);
public
IpV6MobilityOptionPad1
()
:
base
(
IpV6MobilityOptionType
.
Pad1
)
{
}
internal
override
bool
EqualsData
(
IpV6MobilityOption
other
)
{
return
true
;
}
internal
override
int
GetDataHashCode
()
{
return
0
;
}
internal
override
IpV6MobilityOption
CreateInstance
(
DataSegment
data
)
{
throw
new
InvalidOperationException
(
"Pad1 options shouldn't be registered."
);
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionPad1.cs
View file @
1c38d4e7
using
System
;
namespace
PcapDotNet.Packets.IpV6
{
/// <summary>
...
...
@@ -18,37 +16,4 @@ namespace PcapDotNet.Packets.IpV6
{
}
}
/// <summary>
/// RFC 6275.
/// +-----+-----+
/// | Bit | 0-7 |
/// +-----+-----+
/// | 0 | 0 |
/// +-----+-----+
/// </summary>
public
sealed
class
IpV6MobilityOptionPad1
:
IpV6MobilityOption
{
public
const
int
OptionLength
=
sizeof
(
byte
);
public
IpV6MobilityOptionPad1
()
:
base
(
IpV6MobilityOptionType
.
Pad1
)
{
}
internal
override
bool
EqualsData
(
IpV6MobilityOption
other
)
{
return
true
;
}
internal
override
int
GetDataHashCode
()
{
return
0
;
}
internal
override
IpV6MobilityOption
CreateInstance
(
DataSegment
data
)
{
throw
new
InvalidOperationException
(
"Pad1 options shouldn't be registered."
);
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/PcapDotNet.Packets.csproj
View file @
1c38d4e7
...
...
@@ -353,6 +353,7 @@
<Compile
Include=
"IpV6\ExtensionHeaders\IpV6MobilityHandoverAcknowledgeCode.cs"
/>
<Compile
Include=
"IpV6\ExtensionHeaders\IpV6MobilityHeaderType.cs"
/>
<Compile
Include=
"IpV6\ExtensionHeaders\IpV6MobilityLocalizedRoutingAcknowledgementStatus.cs"
/>
<Compile
Include=
"IpV6\Options\IIpV6MobilityOptionIpV4HomeAddress.cs"
/>
<Compile
Include=
"IpV6\Options\IIpV6OptionComplexFactory.cs"
/>
<Compile
Include=
"IpV6\Options\IpV6AccessNetworkIdentifierOperatorIdentifierType.cs"
/>
<Compile
Include=
"IpV6\Options\IpV6AccessNetworkIdentifierSubOption.cs"
/>
...
...
@@ -447,6 +448,7 @@
<Compile
Include=
"IpV6\Options\IpV6MobilityOptionNatDetection.cs"
/>
<Compile
Include=
"IpV6\Options\IpV6MobilityOptionNetworkPrefix.cs"
/>
<Compile
Include=
"IpV6\Options\IpV6MobilityOptionNonceIndices.cs"
/>
<Compile
Include=
"IpV6\Options\IpV6MobilityOptionPad1.cs"
/>
<Compile
Include=
"IpV6\Options\IpV6MobilityOptionPadN.cs"
/>
<Compile
Include=
"IpV6\Options\IpV6MobilityOptionPermanentHomeKeygenToken.cs"
/>
<Compile
Include=
"IpV6\Options\IpV6MobilityOptionRedirect.cs"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment