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
ec3b6965
Commit
ec3b6965
authored
Sep 07, 2013
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IPv6
parent
ea4bf9ef
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
393 additions
and
85 deletions
+393
-85
UInt24.cs
PcapDotNet/src/PcapDotNet.Base/UInt24.cs
+5
-0
IpV6Tests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/IpV6Tests.cs
+3
-3
RandomIpV6Extensions.cs
.../src/PcapDotNet.Packets.TestUtils/RandomIpV6Extensions.cs
+3
-2
IpV6ExtensionHeaderAuthentication.cs
...pDotNet.Packets/IpV6/IpV6ExtensionHeaderAuthentication.cs
+1
-1
IpV6Option.cs
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6Option.cs
+0
-2
IpV6OptionCalipso.cs
.../src/PcapDotNet.Packets/IpV6/Options/IpV6OptionCalipso.cs
+7
-2
IpV6OptionEndpointIdentification.cs
....Packets/IpV6/Options/IpV6OptionEndpointIdentification.cs
+7
-7
IpV6OptionHomeAddress.cs
.../PcapDotNet.Packets/IpV6/Options/IpV6OptionHomeAddress.cs
+7
-7
IpV6OptionIlnpNonce.cs
...rc/PcapDotNet.Packets/IpV6/Options/IpV6OptionIlnpNonce.cs
+7
-7
IpV6OptionJumboPayload.cs
...PcapDotNet.Packets/IpV6/Options/IpV6OptionJumboPayload.cs
+7
-2
IpV6OptionLineIdentificationDestination.cs
...s/IpV6/Options/IpV6OptionLineIdentificationDestination.cs
+7
-7
IpV6OptionPadN.cs
...Net/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionPadN.cs
+7
-2
IpV6OptionQuickStart.cs
...c/PcapDotNet.Packets/IpV6/Options/IpV6OptionQuickStart.cs
+7
-2
IpV6OptionRouterAlert.cs
.../PcapDotNet.Packets/IpV6/Options/IpV6OptionRouterAlert.cs
+7
-2
IpV6OptionRoutingProtocolLowPowerAndLossyNetworks.cs
...ions/IpV6OptionRoutingProtocolLowPowerAndLossyNetworks.cs
+7
-7
IpV6OptionSimple.cs
...t/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionSimple.cs
+0
-5
IpV6OptionSmfDpd.cs
...t/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionSmfDpd.cs
+10
-3
IpV6OptionTunnelEncapsulationLimit.cs
...ackets/IpV6/Options/IpV6OptionTunnelEncapsulationLimit.cs
+7
-2
IpV6OptionUnknown.cs
.../src/PcapDotNet.Packets/IpV6/Options/IpV6OptionUnknown.cs
+281
-13
IpV6Options.cs
...DotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6Options.cs
+13
-9
No files found.
PcapDotNet/src/PcapDotNet.Base/UInt24.cs
View file @
ec3b6965
...
@@ -19,6 +19,11 @@ namespace PcapDotNet.Base
...
@@ -19,6 +19,11 @@ namespace PcapDotNet.Base
/// </summary>
/// </summary>
public
static
readonly
UInt24
MaxValue
=
(
UInt24
)
0x00FFFFFF
;
public
static
readonly
UInt24
MaxValue
=
(
UInt24
)
0x00FFFFFF
;
public
static
implicit
operator
UInt24
(
ushort
value
)
{
return
new
UInt24
(
value
);
}
/// <summary>
/// <summary>
/// Converts a 32 bit signed integer to a 24 bit unsigned integer by taking the 24 least significant bits.
/// Converts a 32 bit signed integer to a 24 bit unsigned integer by taking the 24 least significant bits.
/// </summary>
/// </summary>
...
...
PcapDotNet/src/PcapDotNet.Packets.Test/IpV6Tests.cs
View file @
ec3b6965
...
@@ -69,14 +69,14 @@ namespace PcapDotNet.Packets.Test
...
@@ -69,14 +69,14 @@ namespace PcapDotNet.Packets.Test
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
ethernetLayer
,
ipV6Layer
,
payloadLayer
);
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
ethernetLayer
,
ipV6Layer
,
payloadLayer
);
Assert
.
IsTrue
(
packet
.
IsValid
,
string
.
Format
(
"IsValid ({0})"
,
ipV6Layer
.
NextHeader
));
//
Assert.IsTrue(packet.IsValid, string.Format("IsValid ({0})", ipV6Layer.NextHeader));
// Ethernet
// Ethernet
Assert
.
AreEqual
(
packet
.
Length
-
EthernetDatagram
.
HeaderLengthValue
,
packet
.
Ethernet
.
PayloadLength
,
"PayloadLength"
);
Assert
.
AreEqual
(
packet
.
Length
-
EthernetDatagram
.
HeaderLengthValue
,
packet
.
Ethernet
.
PayloadLength
,
"PayloadLength"
);
Assert
.
AreEqual
(
ethernetLayer
,
packet
.
Ethernet
.
ExtractLayer
(),
"Ethernet Layer"
);
//
Assert.AreEqual(ethernetLayer, packet.Ethernet.ExtractLayer(), "Ethernet Layer");
// IpV6
// IpV6
Assert
.
AreEqual
(
ipV6Layer
,
packet
.
Ethernet
.
IpV6
.
ExtractLayer
(),
"IP Layer"
);
//
Assert.AreEqual(ipV6Layer, packet.Ethernet.IpV6.ExtractLayer(), "IP Layer");
/*
/*
if (packet.Ethernet.IpV6.NextHeader == IpV4Protocol.Tcp)
if (packet.Ethernet.IpV6.NextHeader == IpV4Protocol.Tcp)
Assert.IsInstanceOfType(packet.Ethernet.IpV6.Transport, typeof(TcpDatagram));
Assert.IsInstanceOfType(packet.Ethernet.IpV6.Transport, typeof(TcpDatagram));
...
...
PcapDotNet/src/PcapDotNet.Packets.TestUtils/RandomIpV6Extensions.cs
View file @
ec3b6965
...
@@ -247,7 +247,7 @@ namespace PcapDotNet.Packets.TestUtils
...
@@ -247,7 +247,7 @@ namespace PcapDotNet.Packets.TestUtils
case
IpV6OptionType
.
SmfDpd
:
case
IpV6OptionType
.
SmfDpd
:
if
(
random
.
NextBool
())
if
(
random
.
NextBool
())
return
new
IpV6OptionSmfDpdSequenceHashAssistValue
(
random
.
NextDataSegment
(
random
.
NextInt
(
0
,
100
)));
return
new
IpV6OptionSmfDpdSequenceHashAssistValue
(
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
)
...
@@ -391,7 +391,8 @@ namespace PcapDotNet.Packets.TestUtils
...
@@ -391,7 +391,8 @@ namespace PcapDotNet.Packets.TestUtils
return
new
IpV6MobilityOptionRestartCounter
(
random
.
NextUInt
());
return
new
IpV6MobilityOptionRestartCounter
(
random
.
NextUInt
());
case
IpV6MobilityOptionType
.
IpV4HomeAddress
:
case
IpV6MobilityOptionType
.
IpV4HomeAddress
:
return
new
IpV6MobilityOptionIpV4HomeAddress
(
random
.
NextByte
(),
random
.
NextBool
(),
random
.
NextIpV4Address
());
return
new
IpV6MobilityOptionIpV4HomeAddress
(
random
.
NextByte
(
IpV6MobilityOptionIpV4HomeAddress
.
MaxPrefixLength
+
1
),
random
.
NextBool
(),
random
.
NextIpV4Address
());
case
IpV6MobilityOptionType
.
IpV4AddressAcknowledgement
:
case
IpV6MobilityOptionType
.
IpV4AddressAcknowledgement
:
return
new
IpV6MobilityOptionIpV4AddressAcknowledgement
(
random
.
NextEnum
<
IpV6AddressAcknowledgementStatus
>(),
return
new
IpV6MobilityOptionIpV4AddressAcknowledgement
(
random
.
NextEnum
<
IpV6AddressAcknowledgementStatus
>(),
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6ExtensionHeaderAuthentication.cs
View file @
ec3b6965
...
@@ -117,7 +117,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -117,7 +117,7 @@ namespace PcapDotNet.Packets.IpV6
}
}
nextNextHeader
=
(
IpV4Protocol
)
extensionHeader
[
Offset
.
NextHeader
];
nextNextHeader
=
(
IpV4Protocol
)
extensionHeader
[
Offset
.
NextHeader
];
extensionHeaderLength
=
extensionHeader
[
Offset
.
PayloadLength
]
*
4
;
extensionHeaderLength
=
(
extensionHeader
[
Offset
.
PayloadLength
]
+
2
)
*
4
;
}
}
public
override
IpV4Protocol
Protocol
public
override
IpV4Protocol
Protocol
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6Option.cs
View file @
ec3b6965
...
@@ -22,8 +22,6 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -22,8 +22,6 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
IpV6OptionType
OptionType
{
get
;
private
set
;
}
public
IpV6OptionType
OptionType
{
get
;
private
set
;
}
internal
abstract
IpV6Option
CreateInstance
(
DataSegment
data
);
protected
IpV6Option
(
IpV6OptionType
type
)
protected
IpV6Option
(
IpV6OptionType
type
)
{
{
OptionType
=
type
;
OptionType
=
type
;
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionCalipso.cs
View file @
ec3b6965
...
@@ -25,7 +25,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -25,7 +25,7 @@ namespace PcapDotNet.Packets.IpV6
/// </pre>
/// </pre>
/// </summary>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
Calipso
)]
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
Calipso
)]
public
class
IpV6OptionCalipso
:
IpV6OptionComplex
public
class
IpV6OptionCalipso
:
IpV6OptionComplex
,
IIpV6OptionComplexFactory
{
{
private
static
class
Offset
private
static
class
Offset
{
{
...
@@ -138,7 +138,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -138,7 +138,7 @@ namespace PcapDotNet.Packets.IpV6
get
{
return
OptionDataMinimumLength
+
CompartmentLengthInBytes
;
}
get
{
return
OptionDataMinimumLength
+
CompartmentLengthInBytes
;
}
}
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
public
IpV6Option
CreateInstance
(
DataSegment
data
)
{
{
if
(
data
.
Length
<
OptionDataMinimumLength
)
if
(
data
.
Length
<
OptionDataMinimumLength
)
return
null
;
return
null
;
...
@@ -165,6 +165,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -165,6 +165,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
ref
offset
,
CompartmentBitmap
);
buffer
.
Write
(
ref
offset
,
CompartmentBitmap
);
}
}
private
IpV6OptionCalipso
()
:
this
(
IpV6CalipsoDomainOfInterpretation
.
Null
,
0
,
0
,
DataSegment
.
Empty
)
{
}
private
bool
?
_isChecksumCorrect
;
private
bool
?
_isChecksumCorrect
;
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionEndpointIdentification.cs
View file @
ec3b6965
...
@@ -21,7 +21,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -21,7 +21,7 @@ namespace PcapDotNet.Packets.IpV6
/// </pre>
/// </pre>
/// </summary>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
EndpointIdentification
)]
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
EndpointIdentification
)]
public
class
IpV6OptionEndpointIdentification
:
IpV6OptionComplex
public
class
IpV6OptionEndpointIdentification
:
IpV6OptionComplex
,
IIpV6OptionComplexFactory
{
{
private
static
class
Offset
private
static
class
Offset
{
{
...
@@ -43,12 +43,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -43,12 +43,7 @@ namespace PcapDotNet.Packets.IpV6
public
DataSegment
DestinationEndpointIdentifier
{
get
;
private
set
;
}
public
DataSegment
DestinationEndpointIdentifier
{
get
;
private
set
;
}
internal
IpV6OptionEndpointIdentification
()
public
IpV6Option
CreateInstance
(
DataSegment
data
)
:
this
(
DataSegment
.
Empty
,
DataSegment
.
Empty
)
{
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
{
{
if
(
data
.
Length
<
OptionDataMinimumLength
)
if
(
data
.
Length
<
OptionDataMinimumLength
)
return
null
;
return
null
;
...
@@ -76,5 +71,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -76,5 +71,10 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
ref
offset
,
SourceEndpointIdentifier
);
buffer
.
Write
(
ref
offset
,
SourceEndpointIdentifier
);
buffer
.
Write
(
ref
offset
,
DestinationEndpointIdentifier
);
buffer
.
Write
(
ref
offset
,
DestinationEndpointIdentifier
);
}
}
private
IpV6OptionEndpointIdentification
()
:
this
(
DataSegment
.
Empty
,
DataSegment
.
Empty
)
{
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionHomeAddress.cs
View file @
ec3b6965
...
@@ -21,7 +21,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -21,7 +21,7 @@ namespace PcapDotNet.Packets.IpV6
/// </pre>
/// </pre>
/// </summary>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
HomeAddress
)]
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
HomeAddress
)]
public
class
IpV6OptionHomeAddress
:
IpV6OptionComplex
public
class
IpV6OptionHomeAddress
:
IpV6OptionComplex
,
IIpV6OptionComplexFactory
{
{
public
const
int
OptionDataLength
=
IpV6Address
.
SizeOf
;
public
const
int
OptionDataLength
=
IpV6Address
.
SizeOf
;
...
@@ -37,12 +37,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -37,12 +37,7 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
IpV6Address
HomeAddress
{
get
;
private
set
;
}
public
IpV6Address
HomeAddress
{
get
;
private
set
;
}
internal
IpV6OptionHomeAddress
()
public
IpV6Option
CreateInstance
(
DataSegment
data
)
:
this
(
IpV6Address
.
Zero
)
{
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
{
{
if
(
data
.
Length
!=
OptionDataLength
)
if
(
data
.
Length
!=
OptionDataLength
)
return
null
;
return
null
;
...
@@ -60,5 +55,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -60,5 +55,10 @@ namespace PcapDotNet.Packets.IpV6
{
{
buffer
.
Write
(
ref
offset
,
HomeAddress
,
Endianity
.
Big
);
buffer
.
Write
(
ref
offset
,
HomeAddress
,
Endianity
.
Big
);
}
}
private
IpV6OptionHomeAddress
()
:
this
(
IpV6Address
.
Zero
)
{
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionIlnpNonce.cs
View file @
ec3b6965
...
@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.IpV6
/// </pre>
/// </pre>
/// </summary>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
IlnpNonce
)]
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
IlnpNonce
)]
public
class
IpV6OptionIlnpNonce
:
IpV6OptionComplex
public
class
IpV6OptionIlnpNonce
:
IpV6OptionComplex
,
IIpV6OptionComplexFactory
{
{
public
IpV6OptionIlnpNonce
(
DataSegment
nonce
)
public
IpV6OptionIlnpNonce
(
DataSegment
nonce
)
:
base
(
IpV6OptionType
.
IlnpNonce
)
:
base
(
IpV6OptionType
.
IlnpNonce
)
...
@@ -29,12 +29,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -29,12 +29,7 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
DataSegment
Nonce
{
get
;
private
set
;
}
public
DataSegment
Nonce
{
get
;
private
set
;
}
internal
IpV6OptionIlnpNonce
()
public
IpV6Option
CreateInstance
(
DataSegment
data
)
:
this
(
DataSegment
.
Empty
)
{
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
{
{
return
new
IpV6OptionIlnpNonce
(
data
);
return
new
IpV6OptionIlnpNonce
(
data
);
}
}
...
@@ -48,5 +43,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -48,5 +43,10 @@ namespace PcapDotNet.Packets.IpV6
{
{
buffer
.
Write
(
ref
offset
,
Nonce
);
buffer
.
Write
(
ref
offset
,
Nonce
);
}
}
private
IpV6OptionIlnpNonce
()
:
this
(
DataSegment
.
Empty
)
{
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionJumboPayload.cs
View file @
ec3b6965
...
@@ -14,7 +14,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -14,7 +14,7 @@ namespace PcapDotNet.Packets.IpV6
/// </pre>
/// </pre>
/// </summary>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
JumboPayload
)]
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
JumboPayload
)]
public
class
IpV6OptionJumboPayload
:
IpV6OptionComplex
public
class
IpV6OptionJumboPayload
:
IpV6OptionComplex
,
IIpV6OptionComplexFactory
{
{
public
const
int
OptionDataLength
=
sizeof
(
uint
);
public
const
int
OptionDataLength
=
sizeof
(
uint
);
...
@@ -29,7 +29,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -29,7 +29,7 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
uint
JumboPayloadLength
{
get
;
private
set
;
}
public
uint
JumboPayloadLength
{
get
;
private
set
;
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
public
IpV6Option
CreateInstance
(
DataSegment
data
)
{
{
if
(
data
.
Length
!=
OptionDataLength
)
if
(
data
.
Length
!=
OptionDataLength
)
return
null
;
return
null
;
...
@@ -46,5 +46,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -46,5 +46,10 @@ namespace PcapDotNet.Packets.IpV6
{
{
buffer
.
Write
(
ref
offset
,
JumboPayloadLength
,
Endianity
.
Big
);
buffer
.
Write
(
ref
offset
,
JumboPayloadLength
,
Endianity
.
Big
);
}
}
private
IpV6OptionJumboPayload
()
:
this
(
0
)
{
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionLineIdentificationDestination.cs
View file @
ec3b6965
...
@@ -22,7 +22,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -22,7 +22,7 @@ namespace PcapDotNet.Packets.IpV6
/// </pre>
/// </pre>
/// </summary>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
LineIdentification
)]
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
LineIdentification
)]
public
class
IpV6OptionLineIdentificationDestination
:
IpV6OptionComplex
public
class
IpV6OptionLineIdentificationDestination
:
IpV6OptionComplex
,
IIpV6OptionComplexFactory
{
{
private
static
class
Offset
private
static
class
Offset
{
{
...
@@ -50,12 +50,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -50,12 +50,7 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
DataSegment
LineIdentification
{
get
;
private
set
;
}
public
DataSegment
LineIdentification
{
get
;
private
set
;
}
internal
IpV6OptionLineIdentificationDestination
()
public
IpV6Option
CreateInstance
(
DataSegment
data
)
:
this
(
DataSegment
.
Empty
)
{
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
{
{
if
(
data
.
Length
<
OptionDataMinimumLength
)
if
(
data
.
Length
<
OptionDataMinimumLength
)
return
null
;
return
null
;
...
@@ -78,5 +73,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -78,5 +73,10 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
ref
offset
,
(
byte
)
LineIdentification
.
Length
);
buffer
.
Write
(
ref
offset
,
(
byte
)
LineIdentification
.
Length
);
buffer
.
Write
(
ref
offset
,
LineIdentification
);
buffer
.
Write
(
ref
offset
,
LineIdentification
);
}
}
private
IpV6OptionLineIdentificationDestination
()
:
this
(
DataSegment
.
Empty
)
{
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionPadN.cs
View file @
ec3b6965
...
@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.IpV6
/// </pre>
/// </pre>
/// </summary>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
PadN
)]
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
PadN
)]
public
class
IpV6OptionPadN
:
IpV6OptionComplex
public
class
IpV6OptionPadN
:
IpV6OptionComplex
,
IIpV6OptionComplexFactory
{
{
public
IpV6OptionPadN
(
int
paddingDataLength
)
:
base
(
IpV6OptionType
.
PadN
)
public
IpV6OptionPadN
(
int
paddingDataLength
)
:
base
(
IpV6OptionType
.
PadN
)
{
{
...
@@ -25,7 +25,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -25,7 +25,7 @@ namespace PcapDotNet.Packets.IpV6
public
int
PaddingDataLength
{
get
;
private
set
;
}
public
int
PaddingDataLength
{
get
;
private
set
;
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
public
IpV6Option
CreateInstance
(
DataSegment
data
)
{
{
return
new
IpV6OptionPadN
(
data
.
Length
);
return
new
IpV6OptionPadN
(
data
.
Length
);
}
}
...
@@ -39,5 +39,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -39,5 +39,10 @@ namespace PcapDotNet.Packets.IpV6
{
{
offset
+=
PaddingDataLength
;
offset
+=
PaddingDataLength
;
}
}
private
IpV6OptionPadN
()
:
this
(
0
)
{
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionQuickStart.cs
View file @
ec3b6965
...
@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -16,7 +16,7 @@ namespace PcapDotNet.Packets.IpV6
/// </pre>
/// </pre>
/// </summary>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
QuickStart
)]
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
QuickStart
)]
public
class
IpV6OptionQuickStart
:
IpV6OptionComplex
,
IIpOptionQuickStart
public
class
IpV6OptionQuickStart
:
IpV6OptionComplex
,
IIpOptionQuickStart
,
IIpV6OptionComplexFactory
{
{
public
const
int
OptionDataLength
=
IpOptionQuickStartCommon
.
DataLength
;
public
const
int
OptionDataLength
=
IpOptionQuickStartCommon
.
DataLength
;
...
@@ -47,7 +47,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -47,7 +47,7 @@ namespace PcapDotNet.Packets.IpV6
get
{
return
OptionDataLength
;
}
get
{
return
OptionDataLength
;
}
}
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
public
IpV6Option
CreateInstance
(
DataSegment
data
)
{
{
if
(
data
.
Length
!=
OptionDataLength
)
if
(
data
.
Length
!=
OptionDataLength
)
return
null
;
return
null
;
...
@@ -65,5 +65,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -65,5 +65,10 @@ namespace PcapDotNet.Packets.IpV6
{
{
IpOptionQuickStartCommon
.
WriteData
(
buffer
,
ref
offset
,
Function
,
Rate
,
Ttl
,
Nonce
);
IpOptionQuickStartCommon
.
WriteData
(
buffer
,
ref
offset
,
Function
,
Rate
,
Ttl
,
Nonce
);
}
}
private
IpV6OptionQuickStart
()
:
this
(
IpV4OptionQuickStartFunction
.
RateRequest
,
0
,
0
,
0
)
{
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionRouterAlert.cs
View file @
ec3b6965
...
@@ -13,7 +13,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -13,7 +13,7 @@ namespace PcapDotNet.Packets.IpV6
/// </pre>
/// </pre>
/// </summary>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
RouterAlert
)]
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
RouterAlert
)]
public
class
IpV6OptionRouterAlert
:
IpV6OptionComplex
public
class
IpV6OptionRouterAlert
:
IpV6OptionComplex
,
IIpV6OptionComplexFactory
{
{
public
const
int
OptionDataLength
=
sizeof
(
ushort
);
public
const
int
OptionDataLength
=
sizeof
(
ushort
);
...
@@ -28,7 +28,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -28,7 +28,7 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
IpV6RouterAlertType
RouterAlertType
{
get
;
private
set
;
}
public
IpV6RouterAlertType
RouterAlertType
{
get
;
private
set
;
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
public
IpV6Option
CreateInstance
(
DataSegment
data
)
{
{
if
(
data
.
Length
!=
OptionDataLength
)
if
(
data
.
Length
!=
OptionDataLength
)
return
null
;
return
null
;
...
@@ -45,5 +45,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -45,5 +45,10 @@ namespace PcapDotNet.Packets.IpV6
{
{
buffer
.
Write
(
ref
offset
,
(
ushort
)
RouterAlertType
,
Endianity
.
Big
);
buffer
.
Write
(
ref
offset
,
(
ushort
)
RouterAlertType
,
Endianity
.
Big
);
}
}
private
IpV6OptionRouterAlert
()
:
this
(
IpV6RouterAlertType
.
MulticastListenerDiscovery
)
{
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionRoutingProtocolLowPowerAndLossyNetworks.cs
View file @
ec3b6965
...
@@ -19,7 +19,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -19,7 +19,7 @@ namespace PcapDotNet.Packets.IpV6
/// </pre>
/// </pre>
/// </summary>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
RplOption
)]
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
RplOption
)]
public
class
IpV6OptionRoutingProtocolLowPowerAndLossyNetworks
:
IpV6OptionComplex
public
class
IpV6OptionRoutingProtocolLowPowerAndLossyNetworks
:
IpV6OptionComplex
,
IIpV6OptionComplexFactory
{
{
private
static
class
Offset
private
static
class
Offset
{
{
...
@@ -89,12 +89,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -89,12 +89,7 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
DataSegment
SubTlvs
{
get
;
private
set
;
}
public
DataSegment
SubTlvs
{
get
;
private
set
;
}
internal
IpV6OptionRoutingProtocolLowPowerAndLossyNetworks
()
public
IpV6Option
CreateInstance
(
DataSegment
data
)
:
this
(
false
,
false
,
false
,
0
,
0
,
DataSegment
.
Empty
)
{
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
{
{
if
(
data
.
Length
<
OptionDataMinimumLength
)
if
(
data
.
Length
<
OptionDataMinimumLength
)
return
null
;
return
null
;
...
@@ -122,5 +117,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -122,5 +117,10 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
ref
offset
,
SenderRank
,
Endianity
.
Big
);
buffer
.
Write
(
ref
offset
,
SenderRank
,
Endianity
.
Big
);
buffer
.
Write
(
ref
offset
,
SubTlvs
);
buffer
.
Write
(
ref
offset
,
SubTlvs
);
}
}
private
IpV6OptionRoutingProtocolLowPowerAndLossyNetworks
()
:
this
(
false
,
false
,
false
,
0
,
0
,
DataSegment
.
Empty
)
{
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionSimple.cs
View file @
ec3b6965
...
@@ -27,10 +27,5 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -27,10 +27,5 @@ namespace PcapDotNet.Packets.IpV6
{
{
base
.
Write
(
buffer
,
ref
offset
);
base
.
Write
(
buffer
,
ref
offset
);
}
}
internal
override
sealed
IpV6Option
CreateInstance
(
DataSegment
data
)
{
throw
new
InvalidOperationException
(
"Simple options shouldn't be registered."
);
}
}
}
}
}
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionSmfDpd.cs
View file @
ec3b6965
...
@@ -17,7 +17,6 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -17,7 +17,6 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+----------------------+
/// +-----+----------------------+
/// </pre>
/// </pre>
/// </summary>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
SmfDpd
)]
public
abstract
class
IpV6OptionSmfDpd
:
IpV6OptionComplex
public
abstract
class
IpV6OptionSmfDpd
:
IpV6OptionComplex
{
{
private
static
class
Offset
private
static
class
Offset
...
@@ -43,8 +42,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -43,8 +42,7 @@ namespace PcapDotNet.Packets.IpV6
/// 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
static
IpV6Option
CreateInstance
(
DataSegment
data
)
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
{
{
if
(
data
.
Length
<
OptionDataMinimumLength
)
if
(
data
.
Length
<
OptionDataMinimumLength
)
return
null
;
return
null
;
...
@@ -55,4 +53,13 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -55,4 +53,13 @@ namespace PcapDotNet.Packets.IpV6
return
IpV6OptionSmfDpdSequenceBased
.
CreateSpecificInstance
(
data
);
return
IpV6OptionSmfDpdSequenceBased
.
CreateSpecificInstance
(
data
);
}
}
}
}
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
SmfDpd
)]
internal
class
IpV6OptionSmfDpdFactory
:
IIpV6OptionComplexFactory
{
public
IpV6Option
CreateInstance
(
DataSegment
data
)
{
return
IpV6OptionSmfDpd
.
CreateInstance
(
data
);
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionTunnelEncapsulationLimit.cs
View file @
ec3b6965
...
@@ -13,7 +13,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -13,7 +13,7 @@ namespace PcapDotNet.Packets.IpV6
/// </pre>
/// </pre>
/// </summary>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
TunnelEncapsulationLimit
)]
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
TunnelEncapsulationLimit
)]
public
class
IpV6OptionTunnelEncapsulationLimit
:
IpV6OptionComplex
public
class
IpV6OptionTunnelEncapsulationLimit
:
IpV6OptionComplex
,
IIpV6OptionComplexFactory
{
{
public
const
int
OptionDataLength
=
sizeof
(
byte
);
public
const
int
OptionDataLength
=
sizeof
(
byte
);
...
@@ -28,7 +28,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -28,7 +28,7 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
byte
TunnelEncapsulationLimit
{
get
;
private
set
;
}
public
byte
TunnelEncapsulationLimit
{
get
;
private
set
;
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
public
IpV6Option
CreateInstance
(
DataSegment
data
)
{
{
if
(
data
.
Length
!=
OptionDataLength
)
if
(
data
.
Length
!=
OptionDataLength
)
return
null
;
return
null
;
...
@@ -45,5 +45,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -45,5 +45,10 @@ namespace PcapDotNet.Packets.IpV6
{
{
buffer
.
Write
(
ref
offset
,
TunnelEncapsulationLimit
);
buffer
.
Write
(
ref
offset
,
TunnelEncapsulationLimit
);
}
}
private
IpV6OptionTunnelEncapsulationLimit
()
:
this
(
0
)
{
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionUnknown.cs
View file @
ec3b6965
...
@@ -32,11 +32,6 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -32,11 +32,6 @@ namespace PcapDotNet.Packets.IpV6
public
DataSegment
Data
{
get
;
private
set
;
}
public
DataSegment
Data
{
get
;
private
set
;
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
{
throw
new
InvalidOperationException
(
"IpV6OptionUnknown shouldn't be registered."
);
}
internal
override
int
DataLength
internal
override
int
DataLength
{
{
get
{
return
Data
.
Length
;
}
get
{
return
Data
.
Length
;
}
...
@@ -119,6 +114,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -119,6 +114,11 @@ namespace PcapDotNet.Packets.IpV6
{
{
offset
+=
PaddingDataLength
;
offset
+=
PaddingDataLength
;
}
}
internal
IpV6MobilityOptionPadN
()
:
this
(
0
)
{
}
}
}
...
@@ -168,6 +168,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -168,6 +168,11 @@ namespace PcapDotNet.Packets.IpV6
{
{
buffer
.
Write
(
ref
offset
,
RefreshInterval
,
Endianity
.
Big
);
buffer
.
Write
(
ref
offset
,
RefreshInterval
,
Endianity
.
Big
);
}
}
private
IpV6MobilityOptionBindingRefreshAdvice
()
:
this
(
0
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -250,6 +255,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -250,6 +255,11 @@ namespace PcapDotNet.Packets.IpV6
{
{
}
}
private
IpV6MobilityOptionAlternateCareOfAddress
()
:
this
(
IpV6Address
.
Zero
)
{
}
/// <summary>
/// <summary>
/// Contains an address to use as the care-of address for the binding, rather than using the Source Address of the packet as the care-of address.
/// Contains an address to use as the care-of address for the binding, rather than using the Source Address of the packet as the care-of address.
/// </summary>
/// </summary>
...
@@ -332,6 +342,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -332,6 +342,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
ref
offset
,
HomeNonceIndex
,
Endianity
.
Big
);
buffer
.
Write
(
ref
offset
,
HomeNonceIndex
,
Endianity
.
Big
);
buffer
.
Write
(
ref
offset
,
CareOfNonceIndex
,
Endianity
.
Big
);
buffer
.
Write
(
ref
offset
,
CareOfNonceIndex
,
Endianity
.
Big
);
}
}
private
IpV6MobilityOptionNonceIndices
()
:
this
(
0
,
0
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -403,6 +418,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -403,6 +418,11 @@ namespace PcapDotNet.Packets.IpV6
{
{
return
new
IpV6MobilityOptionBindingAuthorizationData
(
data
);
return
new
IpV6MobilityOptionBindingAuthorizationData
(
data
);
}
}
private
IpV6MobilityOptionBindingAuthorizationData
()
:
this
(
DataSegment
.
Empty
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -519,6 +539,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -519,6 +539,11 @@ namespace PcapDotNet.Packets.IpV6
return
new
IpV6MobilityOptionMobileNetworkPrefix
(
prefixLength
,
mobileNetworkPrefix
);
return
new
IpV6MobilityOptionMobileNetworkPrefix
(
prefixLength
,
mobileNetworkPrefix
);
}
}
private
IpV6MobilityOptionMobileNetworkPrefix
()
:
this
(
0
,
IpV6Address
.
Zero
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -559,6 +584,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -559,6 +584,10 @@ namespace PcapDotNet.Packets.IpV6
return
new
IpV6MobilityOptionHomeNetworkPrefix
(
prefixLength
,
mobileNetworkPrefix
);
return
new
IpV6MobilityOptionHomeNetworkPrefix
(
prefixLength
,
mobileNetworkPrefix
);
}
}
private
IpV6MobilityOptionHomeNetworkPrefix
()
:
this
(
0
,
IpV6Address
.
Zero
)
{
}
}
}
public
enum
IpV6MobilityLinkLayerAddressCode
:
byte
public
enum
IpV6MobilityLinkLayerAddressCode
:
byte
...
@@ -644,6 +673,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -644,6 +673,11 @@ namespace PcapDotNet.Packets.IpV6
LinkLayerAddress
=
linkLayerAddress
;
LinkLayerAddress
=
linkLayerAddress
;
}
}
private
IpV6MobilityOptionLinkLayerAddress
()
:
this
(
IpV6MobilityLinkLayerAddressCode
.
Wildcard
,
DataSegment
.
Empty
)
{
}
public
IpV6MobilityLinkLayerAddressCode
Code
{
get
;
private
set
;
}
public
IpV6MobilityLinkLayerAddressCode
Code
{
get
;
private
set
;
}
/// <summary>
/// <summary>
...
@@ -754,6 +788,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -754,6 +788,11 @@ namespace PcapDotNet.Packets.IpV6
Identifier
.
Write
(
buffer
,
offset
+
Offset
.
Identifier
);
Identifier
.
Write
(
buffer
,
offset
+
Offset
.
Identifier
);
offset
+=
DataLength
;
offset
+=
DataLength
;
}
}
private
IpV6MobilityOptionMobileNodeIdentifier
()
:
this
(
IpV6MobileNodeIdentifierSubtype
.
NetworkAccessIdentifier
,
DataSegment
.
Empty
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -890,6 +929,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -890,6 +929,11 @@ namespace PcapDotNet.Packets.IpV6
AuthenticationData
.
Write
(
buffer
,
offset
+
Offset
.
AuthenticationData
);
AuthenticationData
.
Write
(
buffer
,
offset
+
Offset
.
AuthenticationData
);
offset
+=
DataLength
;
offset
+=
DataLength
;
}
}
private
IpV6MobilityOptionAuthentication
()
:
this
(
IpV6AuthenticationSubtype
.
HomeAgent
,
0
,
DataSegment
.
Empty
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -980,6 +1024,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -980,6 +1024,11 @@ namespace PcapDotNet.Packets.IpV6
return
new
IpV6MobilityOptionReplayProtection
(
timestamp
);
return
new
IpV6MobilityOptionReplayProtection
(
timestamp
);
}
}
private
IpV6MobilityOptionReplayProtection
()
:
this
(
0
)
{
}
}
}
public
abstract
class
IpV6MobilityOptionEmpty
:
IpV6MobilityOptionComplex
public
abstract
class
IpV6MobilityOptionEmpty
:
IpV6MobilityOptionComplex
...
@@ -1106,7 +1155,12 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -1106,7 +1155,12 @@ namespace PcapDotNet.Packets.IpV6
return
new
IpV6MobilityOptionCgaParameters
(
data
);
return
new
IpV6MobilityOptionCgaParameters
(
data
);
}
}
private
IpV6MobilityOptionCgaParameters
()
:
this
(
DataSegment
.
Empty
)
{
}
}
}
/// <summary>
/// <summary>
/// RFC 4866.
/// RFC 4866.
...
@@ -1141,6 +1195,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -1141,6 +1195,11 @@ namespace PcapDotNet.Packets.IpV6
{
{
return
new
IpV6MobilityOptionSignature
(
data
);
return
new
IpV6MobilityOptionSignature
(
data
);
}
}
private
IpV6MobilityOptionSignature
()
:
this
(
DataSegment
.
Empty
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -1179,6 +1238,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -1179,6 +1238,11 @@ namespace PcapDotNet.Packets.IpV6
{
{
return
new
IpV6MobilityOptionPermanentHomeKeygenToken
(
data
);
return
new
IpV6MobilityOptionPermanentHomeKeygenToken
(
data
);
}
}
private
IpV6MobilityOptionPermanentHomeKeygenToken
()
:
this
(
DataSegment
.
Empty
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -1247,6 +1311,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -1247,6 +1311,11 @@ namespace PcapDotNet.Packets.IpV6
return
new
IpV6MobilityOptionCareOfTest
(
careOfKeygenToken
);
return
new
IpV6MobilityOptionCareOfTest
(
careOfKeygenToken
);
}
}
private
IpV6MobilityOptionCareOfTest
()
:
this
(
0
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -1352,6 +1421,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -1352,6 +1421,10 @@ namespace PcapDotNet.Packets.IpV6
get
{
return
OptionDataMinimumLength
+
MobileNodeIdentity
.
Length
;
}
get
{
return
OptionDataMinimumLength
+
MobileNodeIdentity
.
Length
;
}
}
}
private
IpV6MobilityOptionDnsUpdate
()
:
this
(
IpV6DnsUpdateStatus
.
DnsUpdatePerformed
,
false
,
DataSegment
.
Empty
)
{
}
internal
override
void
WriteData
(
byte
[]
buffer
,
ref
int
offset
)
internal
override
void
WriteData
(
byte
[]
buffer
,
ref
int
offset
)
{
{
buffer
.
Write
(
offset
+
Offset
.
Status
,
(
byte
)
Status
);
buffer
.
Write
(
offset
+
Offset
.
Status
,
(
byte
)
Status
);
...
@@ -1397,7 +1470,12 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -1397,7 +1470,12 @@ namespace PcapDotNet.Packets.IpV6
{
{
return
new
IpV6MobilityOptionExperimental
(
data
);
return
new
IpV6MobilityOptionExperimental
(
data
);
}
}
private
IpV6MobilityOptionExperimental
()
:
this
(
DataSegment
.
Empty
)
{
}
}
}
/// <summary>
/// <summary>
/// RFC 5094.
/// RFC 5094.
...
@@ -1481,6 +1559,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -1481,6 +1559,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
Data
,
Data
);
buffer
.
Write
(
offset
+
Offset
.
Data
,
Data
);
offset
+=
DataLength
;
offset
+=
DataLength
;
}
}
private
IpV6MobilityOptionVendorSpecific
()
:
this
(
0
,
0
,
DataSegment
.
Empty
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -1522,6 +1605,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -1522,6 +1605,11 @@ namespace PcapDotNet.Packets.IpV6
{
{
return
new
IpV6MobilityOptionServiceSelection
(
data
);
return
new
IpV6MobilityOptionServiceSelection
(
data
);
}
}
private
IpV6MobilityOptionServiceSelection
()
:
this
(
DataSegment
.
Empty
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -1625,6 +1713,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -1625,6 +1713,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
Authenticator
,
Authenticator
);
buffer
.
Write
(
offset
+
Offset
.
Authenticator
,
Authenticator
);
offset
+=
DataLength
;
offset
+=
DataLength
;
}
}
private
IpV6MobilityOptionBindingAuthorizationDataForFmIpV6
()
:
this
(
0
,
DataSegment
.
Empty
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -1700,6 +1793,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -1700,6 +1793,11 @@ namespace PcapDotNet.Packets.IpV6
{
{
}
}
private
IpV6MobilityOptionHandoffIndicator
()
:
this
(
IpV6HandoffIndicator
.
AttachmentOverNewInterface
)
{
}
/// <summary>
/// <summary>
/// Specifies the type of handoff.
/// Specifies the type of handoff.
/// </summary>
/// </summary>
...
@@ -1785,6 +1883,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -1785,6 +1883,11 @@ namespace PcapDotNet.Packets.IpV6
return
new
IpV6MobilityOptionAccessTechnologyType
((
IpV6AccessTechnologyType
)
value
);
return
new
IpV6MobilityOptionAccessTechnologyType
((
IpV6AccessTechnologyType
)
value
);
}
}
private
IpV6MobilityOptionAccessTechnologyType
()
:
this
(
IpV6AccessTechnologyType
.
Reserved
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -1882,6 +1985,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -1882,6 +1985,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
LinkLayerIdentifier
,
LinkLayerIdentifier
);
buffer
.
Write
(
offset
+
Offset
.
LinkLayerIdentifier
,
LinkLayerIdentifier
);
offset
+=
DataLength
;
offset
+=
DataLength
;
}
}
private
IpV6MobilityOptionMobileNodeLinkLayerIdentifier
()
:
this
(
DataSegment
.
Empty
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -1927,6 +2035,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -1927,6 +2035,11 @@ namespace PcapDotNet.Packets.IpV6
return
new
IpV6MobilityOptionLinkLocalAddress
(
linkLocalAddress
);
return
new
IpV6MobilityOptionLinkLocalAddress
(
linkLocalAddress
);
}
}
private
IpV6MobilityOptionLinkLocalAddress
()
:
this
(
IpV6Address
.
Zero
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -1970,6 +2083,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -1970,6 +2083,11 @@ namespace PcapDotNet.Packets.IpV6
return
new
IpV6MobilityOptionTimestamp
(
timestamp
);
return
new
IpV6MobilityOptionTimestamp
(
timestamp
);
}
}
private
IpV6MobilityOptionTimestamp
()
:
this
(
0
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -2019,6 +2137,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -2019,6 +2137,11 @@ namespace PcapDotNet.Packets.IpV6
{
{
buffer
.
Write
(
ref
offset
,
RestartCounter
,
Endianity
.
Big
);
buffer
.
Write
(
ref
offset
,
RestartCounter
,
Endianity
.
Big
);
}
}
private
IpV6MobilityOptionRestartCounter
()
:
this
(
0
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -2117,7 +2240,12 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -2117,7 +2240,12 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
HomeAddress
,
HomeAddress
,
Endianity
.
Big
);
buffer
.
Write
(
offset
+
Offset
.
HomeAddress
,
HomeAddress
,
Endianity
.
Big
);
offset
+=
OptionDataLength
;
offset
+=
OptionDataLength
;
}
}
private
IpV6MobilityOptionIpV4AddressAcknowledgement
()
:
this
(
IpV6AddressAcknowledgementStatus
.
Success
,
0
,
IpV4Address
.
Zero
)
{
}
}
}
/// <summary>
/// <summary>
/// RFC 5555.
/// RFC 5555.
...
@@ -2263,6 +2391,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -2263,6 +2391,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
HomeAddress
,
HomeAddress
,
Endianity
.
Big
);
buffer
.
Write
(
offset
+
Offset
.
HomeAddress
,
HomeAddress
,
Endianity
.
Big
);
offset
+=
OptionDataLength
;
offset
+=
OptionDataLength
;
}
}
private
IpV6MobilityOptionIpV4HomeAddress
()
:
this
(
0
,
false
,
IpV4Address
.
Zero
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -2346,6 +2479,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -2346,6 +2479,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
RefreshTime
,
RefreshTime
,
Endianity
.
Big
);
buffer
.
Write
(
offset
+
Offset
.
RefreshTime
,
RefreshTime
,
Endianity
.
Big
);
offset
+=
OptionDataLength
;
offset
+=
OptionDataLength
;
}
}
private
IpV6MobilityOptionNatDetection
()
:
this
(
false
,
0
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -2404,7 +2542,12 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -2404,7 +2542,12 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
CareOfAddress
,
CareOfAddress
,
Endianity
.
Big
);
buffer
.
Write
(
offset
+
Offset
.
CareOfAddress
,
CareOfAddress
,
Endianity
.
Big
);
offset
+=
OptionDataLength
;
offset
+=
OptionDataLength
;
}
}
private
IpV6MobilityOptionIpV4CareOfAddress
()
:
this
(
IpV4Address
.
Zero
)
{
}
}
}
/// <summary>
/// <summary>
/// RFC 5845.
/// RFC 5845.
...
@@ -2463,7 +2606,12 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -2463,7 +2606,12 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
GreKeyIdentifier
,
GreKeyIdentifier
,
Endianity
.
Big
);
buffer
.
Write
(
offset
+
Offset
.
GreKeyIdentifier
,
GreKeyIdentifier
,
Endianity
.
Big
);
offset
+=
OptionDataLength
;
offset
+=
OptionDataLength
;
}
}
private
IpV6MobilityOptionGreKey
()
:
this
(
0
)
{
}
}
}
/// <summary>
/// <summary>
/// RFC 5845.
/// RFC 5845.
...
@@ -2578,6 +2726,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -2578,6 +2726,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
AddressOrPrefix
,
AddressOrPrefix
,
Endianity
.
Big
);
buffer
.
Write
(
offset
+
Offset
.
AddressOrPrefix
,
AddressOrPrefix
,
Endianity
.
Big
);
offset
+=
OptionDataLength
;
offset
+=
OptionDataLength
;
}
}
private
IpV6MobilityOptionIpV6AddressPrefix
()
:
this
(
IpV6MobilityIpV6AddressPrefixCode
.
NewCareOfAddress
,
0
,
IpV6Address
.
Zero
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -2750,6 +2903,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -2750,6 +2903,11 @@ namespace PcapDotNet.Packets.IpV6
offset
+=
OptionDataMinimumLength
;
offset
+=
OptionDataMinimumLength
;
}
}
private
IpV6MobilityOptionBindingIdentifier
()
:
this
(
0
,
IpV6BindingAcknowledgementStatus
.
BindingUpdateAccepted
,
false
,
0
)
{
}
private
IpV6MobilityOptionBindingIdentifier
(
ushort
bindingId
,
IpV6BindingAcknowledgementStatus
status
,
bool
simultaneousHomeAndForeignBinding
,
private
IpV6MobilityOptionBindingIdentifier
(
ushort
bindingId
,
IpV6BindingAcknowledgementStatus
status
,
bool
simultaneousHomeAndForeignBinding
,
byte
priority
,
IpV4Address
?
ipV4CareOfAddress
,
IpV6Address
?
ipV6CareOfAddress
)
byte
priority
,
IpV4Address
?
ipV4CareOfAddress
,
IpV6Address
?
ipV6CareOfAddress
)
:
base
(
IpV6MobilityOptionType
.
BindingIdentifier
)
:
base
(
IpV6MobilityOptionType
.
BindingIdentifier
)
...
@@ -2845,6 +3003,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -2845,6 +3003,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
HomeAddress
,
HomeAddress
,
Endianity
.
Big
);
buffer
.
Write
(
offset
+
Offset
.
HomeAddress
,
HomeAddress
,
Endianity
.
Big
);
offset
+=
OptionDataLength
;
offset
+=
OptionDataLength
;
}
}
private
IpV6MobilityOptionIpV4HomeAddressRequest
()
:
this
(
0
,
IpV4Address
.
Zero
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -2973,6 +3136,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -2973,6 +3136,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
HomeAddress
,
HomeAddress
,
Endianity
.
Big
);
buffer
.
Write
(
offset
+
Offset
.
HomeAddress
,
HomeAddress
,
Endianity
.
Big
);
offset
+=
OptionDataLength
;
offset
+=
OptionDataLength
;
}
}
private
IpV6MobilityOptionIpV4HomeAddressReply
()
:
this
(
IpV6IpV4HomeAddressReplyStatus
.
Success
,
0
,
IpV4Address
.
Zero
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -3030,6 +3198,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -3030,6 +3198,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
DefaultRouterAddress
,
DefaultRouterAddress
,
Endianity
.
Big
);
buffer
.
Write
(
offset
+
Offset
.
DefaultRouterAddress
,
DefaultRouterAddress
,
Endianity
.
Big
);
offset
+=
OptionDataLength
;
offset
+=
OptionDataLength
;
}
}
private
IpV6MobilityOptionIpV4DefaultRouterAddress
()
:
this
(
IpV4Address
.
Zero
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -3092,6 +3265,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -3092,6 +3265,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
IsServer
,
Mask
.
IsServer
);
buffer
.
Write
(
offset
+
Offset
.
IsServer
,
Mask
.
IsServer
);
offset
+=
OptionDataLength
;
offset
+=
OptionDataLength
;
}
}
private
IpV6MobilityOptionIpV4DhcpSupportMode
()
:
this
(
false
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -3226,6 +3404,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -3226,6 +3404,11 @@ namespace PcapDotNet.Packets.IpV6
request
.
Write
(
buffer
,
ref
offset
);
request
.
Write
(
buffer
,
ref
offset
);
}
}
private
IpV6MobilityOptionContextRequest
()
:
this
(
new
IpV6MobilityOptionContextRequestEntry
[
0
])
{
}
private
readonly
int
_dataLength
;
private
readonly
int
_dataLength
;
}
}
...
@@ -3364,6 +3547,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -3364,6 +3547,11 @@ namespace PcapDotNet.Packets.IpV6
LocalMobilityAnchorAddressIpV6
=
localMobilityAnchorAddressIpV6
;
LocalMobilityAnchorAddressIpV6
=
localMobilityAnchorAddressIpV6
;
LocalMobilityAnchorAddressIpV4
=
localMobilityAnchorAddressIpV4
;
LocalMobilityAnchorAddressIpV4
=
localMobilityAnchorAddressIpV4
;
}
}
private
IpV6MobilityOptionLocalMobilityAnchorAddress
()
:
this
(
IpV6Address
.
Zero
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -3423,6 +3611,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -3423,6 +3611,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
InterfaceIdentifier
,
InterfaceIdentifier
,
Endianity
.
Big
);
buffer
.
Write
(
offset
+
Offset
.
InterfaceIdentifier
,
InterfaceIdentifier
,
Endianity
.
Big
);
offset
+=
DataLength
;
offset
+=
DataLength
;
}
}
private
IpV6MobilityOptionMobileNodeLinkLocalAddressInterfaceIdentifier
()
:
this
(
0
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -3494,6 +3687,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -3494,6 +3687,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
Lifetime
,
Lifetime
);
buffer
.
Write
(
offset
+
Offset
.
Lifetime
,
Lifetime
);
offset
+=
DataLength
;
offset
+=
DataLength
;
}
}
private
IpV6MobilityOptionTransientBinding
()
:
this
(
false
,
0
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -3564,6 +3762,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -3564,6 +3762,11 @@ namespace PcapDotNet.Packets.IpV6
foreach
(
ushort
flowIdentifier
in
FlowIdentifiers
)
foreach
(
ushort
flowIdentifier
in
FlowIdentifiers
)
buffer
.
Write
(
ref
offset
,
flowIdentifier
,
Endianity
.
Big
);
buffer
.
Write
(
ref
offset
,
flowIdentifier
,
Endianity
.
Big
);
}
}
private
IpV6MobilityOptionFlowSummary
()
:
this
(
new
ushort
[
1
])
{
}
}
}
/// <summary>
/// <summary>
...
@@ -3832,7 +4035,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -3832,7 +4035,7 @@ namespace PcapDotNet.Packets.IpV6
select
new
select
new
{
{
GetRegistrationAttribute
(
type
).
OptionType
,
GetRegistrationAttribute
(
type
).
OptionType
,
Option
=
(
IpV6FlowIdentificationSubOption
)
Activator
.
CreateInstance
(
type
)
Option
=
(
IpV6FlowIdentificationSubOption
)
Activator
.
CreateInstance
(
type
,
true
)
};
};
return
prototypes
.
ToDictionary
(
option
=>
option
.
OptionType
,
option
=>
option
.
Option
);
return
prototypes
.
ToDictionary
(
option
=>
option
.
OptionType
,
option
=>
option
.
Option
);
...
@@ -3910,6 +4113,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -3910,6 +4113,11 @@ namespace PcapDotNet.Packets.IpV6
{
{
offset
+=
PaddingDataLength
;
offset
+=
PaddingDataLength
;
}
}
private
IpV6FlowIdentificationSubOptionPadN
()
:
this
(
0
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -4015,6 +4223,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -4015,6 +4223,11 @@ namespace PcapDotNet.Packets.IpV6
foreach
(
ushort
bindingId
in
BindingIds
)
foreach
(
ushort
bindingId
in
BindingIds
)
buffer
.
Write
(
ref
offset
,
bindingId
,
Endianity
.
Big
);
buffer
.
Write
(
ref
offset
,
bindingId
,
Endianity
.
Big
);
}
}
private
IpV6FlowIdentificationSubOptionBindingReference
()
:
this
(
new
ushort
[
0
])
{
}
}
}
/// <summary>
/// <summary>
...
@@ -4097,6 +4310,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -4097,6 +4310,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
TrafficSelector
,
TrafficSelector
);
buffer
.
Write
(
offset
+
Offset
.
TrafficSelector
,
TrafficSelector
);
offset
+=
DataLength
;
offset
+=
DataLength
;
}
}
private
IpV6FlowIdentificationSubOptionTrafficSelector
()
:
this
(
IpV6FlowIdentificationTrafficSelectorFormat
.
IpV4Binary
,
DataSegment
.
Empty
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -4199,7 +4417,12 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -4199,7 +4417,12 @@ namespace PcapDotNet.Packets.IpV6
SubOptions
.
Write
(
buffer
,
offset
+
Offset
.
SubOptions
);
SubOptions
.
Write
(
buffer
,
offset
+
Offset
.
SubOptions
);
offset
+=
DataLength
;
offset
+=
DataLength
;
}
}
private
IpV6MobilityOptionFlowIdentification
()
:
this
(
0
,
0
,
IpV6FlowIdentificationStatus
.
FlowBindingSuccessful
,
IpV6FlowIdentificationSubOptions
.
None
)
{
}
}
}
/// <summary>
/// <summary>
/// RFC 6463.
/// RFC 6463.
...
@@ -4354,6 +4577,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -4354,6 +4577,11 @@ namespace PcapDotNet.Packets.IpV6
LocalMobilityAddressIpV4
=
localMobilityAddressIpV4
;
LocalMobilityAddressIpV4
=
localMobilityAddressIpV4
;
LocalMobilityAddressIpV6
=
localMobilityAddressIpV6
;
LocalMobilityAddressIpV6
=
localMobilityAddressIpV6
;
}
}
private
IpV6MobilityOptionRedirect
()
:
this
(
IpV6Address
.
Zero
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -4454,6 +4682,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -4454,6 +4682,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
MaximumCapacity
,
MaximumCapacity
,
Endianity
.
Big
);
buffer
.
Write
(
offset
+
Offset
.
MaximumCapacity
,
MaximumCapacity
,
Endianity
.
Big
);
offset
+=
OptionDataLength
;
offset
+=
OptionDataLength
;
}
}
private
IpV6MobilityOptionLoadInformation
()
:
this
(
0
,
0
,
0
,
0
,
0
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -4503,6 +4736,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -4503,6 +4736,11 @@ namespace PcapDotNet.Packets.IpV6
{
{
buffer
.
Write
(
ref
offset
,
AlternateCareOfAddress
,
Endianity
.
Big
);
buffer
.
Write
(
ref
offset
,
AlternateCareOfAddress
,
Endianity
.
Big
);
}
}
private
IpV6MobilityOptionAlternateIpV4CareOfAddress
()
:
this
(
IpV4Address
.
Zero
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -4584,6 +4822,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -4584,6 +4822,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
MobileNodeGroupIdentifier
,
MobileNodeGroupIdentifier
,
Endianity
.
Big
);
buffer
.
Write
(
offset
+
Offset
.
MobileNodeGroupIdentifier
,
MobileNodeGroupIdentifier
,
Endianity
.
Big
);
offset
+=
OptionDataLength
;
offset
+=
OptionDataLength
;
}
}
private
IpV6MobilityOptionMobileNodeGroupIdentifier
()
:
this
(
IpV6MobileNodeGroupIdentifierSubType
.
BulkBindingUpdateGroup
,
0
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -4653,6 +4896,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -4653,6 +4896,11 @@ namespace PcapDotNet.Packets.IpV6
buffer
.
Write
(
offset
+
Offset
.
Address
,
Address
,
Endianity
.
Big
);
buffer
.
Write
(
offset
+
Offset
.
Address
,
Address
,
Endianity
.
Big
);
offset
+=
OptionDataLength
;
offset
+=
OptionDataLength
;
}
}
private
IpV6MobilityOptionMobileAccessGatewayIpV6Address
()
:
this
(
IpV6Address
.
Zero
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -4697,6 +4945,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -4697,6 +4945,11 @@ namespace PcapDotNet.Packets.IpV6
SubOptions
.
Write
(
buffer
,
offset
);
SubOptions
.
Write
(
buffer
,
offset
);
offset
+=
DataLength
;
offset
+=
DataLength
;
}
}
private
IpV6MobilityOptionAccessNetworkIdentifier
()
:
this
(
IpV6AccessNetworkIdentifierSubOptions
.
None
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -4793,7 +5046,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -4793,7 +5046,7 @@ namespace PcapDotNet.Packets.IpV6
select
new
select
new
{
{
GetRegistrationAttribute
(
type
).
OptionType
,
GetRegistrationAttribute
(
type
).
OptionType
,
Option
=
(
IpV6AccessNetworkIdentifierSubOption
)
Activator
.
CreateInstance
(
type
)
Option
=
(
IpV6AccessNetworkIdentifierSubOption
)
Activator
.
CreateInstance
(
type
,
true
)
};
};
return
prototypes
.
ToDictionary
(
option
=>
option
.
OptionType
,
option
=>
option
.
Option
);
return
prototypes
.
ToDictionary
(
option
=>
option
.
OptionType
,
option
=>
option
.
Option
);
...
@@ -4999,6 +5252,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -4999,6 +5252,11 @@ namespace PcapDotNet.Packets.IpV6
private
int
AccessPointNameLengthOffset
{
get
{
return
Offset
.
NetworkName
+
NetworkName
.
Length
;
}
}
private
int
AccessPointNameLengthOffset
{
get
{
return
Offset
.
NetworkName
+
NetworkName
.
Length
;
}
}
private
int
AccessPointNameOffset
{
get
{
return
AccessPointNameLengthOffset
+
sizeof
(
byte
);
}
}
private
int
AccessPointNameOffset
{
get
{
return
AccessPointNameLengthOffset
+
sizeof
(
byte
);
}
}
private
IpV6AccessNetworkIdentifierSubOptionNetworkIdentifier
()
:
this
(
false
,
DataSegment
.
Empty
,
DataSegment
.
Empty
)
{
}
}
}
/// <summary>
/// <summary>
...
@@ -5131,6 +5389,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -5131,6 +5389,11 @@ namespace PcapDotNet.Packets.IpV6
offset
+=
OptionDataLength
;
offset
+=
OptionDataLength
;
}
}
private
IpV6AccessNetworkIdentifierSubOptionGeoLocation
()
:
this
(
0
,
0
)
{
}
private
static
double
ToReal
(
UInt24
twosComplementFixedPointWith9WholeBits
)
private
static
double
ToReal
(
UInt24
twosComplementFixedPointWith9WholeBits
)
{
{
bool
isPositive
=
twosComplementFixedPointWith9WholeBits
>>
23
==
1
;
bool
isPositive
=
twosComplementFixedPointWith9WholeBits
>>
23
==
1
;
...
@@ -5232,5 +5495,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -5232,5 +5495,10 @@ namespace PcapDotNet.Packets.IpV6
Identifier
.
Write
(
buffer
,
offset
+
Offset
.
Identifier
);
Identifier
.
Write
(
buffer
,
offset
+
Offset
.
Identifier
);
offset
+=
DataLength
;
offset
+=
DataLength
;
}
}
private
IpV6AccessNetworkIdentifierSubOptionOperatorIdentifier
()
:
this
(
IpV6AccessNetworkIdentifierOperatorIdentifierType
.
PrivateEnterpriseNumber
,
DataSegment
.
Empty
)
{
}
}
}
}
}
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6Options.cs
View file @
ec3b6965
...
@@ -7,6 +7,11 @@ using PcapDotNet.Packets.Ip;
...
@@ -7,6 +7,11 @@ using PcapDotNet.Packets.Ip;
namespace
PcapDotNet.Packets.IpV6
namespace
PcapDotNet.Packets.IpV6
{
{
internal
interface
IIpV6OptionComplexFactory
{
IpV6Option
CreateInstance
(
DataSegment
data
);
}
public
class
IpV6Options
:
Options
<
IpV6Option
>
public
class
IpV6Options
:
Options
<
IpV6Option
>
{
{
public
IpV6Options
(
IList
<
IpV6Option
>
options
)
public
IpV6Options
(
IList
<
IpV6Option
>
options
)
...
@@ -65,24 +70,23 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -65,24 +70,23 @@ namespace PcapDotNet.Packets.IpV6
private
static
IpV6Option
CreateOption
(
IpV6OptionType
optionType
,
DataSegment
data
)
private
static
IpV6Option
CreateOption
(
IpV6OptionType
optionType
,
DataSegment
data
)
{
{
I
pV6Option
prototype
;
I
IpV6OptionComplexFactory
factory
;
if
(!
_
prototypes
.
TryGetValue
(
optionType
,
out
prototype
))
if
(!
_
factories
.
TryGetValue
(
optionType
,
out
factory
))
return
new
IpV6OptionUnknown
(
optionType
,
data
);
return
new
IpV6OptionUnknown
(
optionType
,
data
);
return
prototype
.
CreateInstance
(
data
);
return
factory
.
CreateInstance
(
data
);
}
}
private
static
readonly
Dictionary
<
IpV6OptionType
,
I
pV6Option
>
_prototypes
=
InitializePrototyp
es
();
private
static
readonly
Dictionary
<
IpV6OptionType
,
I
IpV6OptionComplexFactory
>
_factories
=
InitializeFactori
es
();
private
static
Dictionary
<
IpV6OptionType
,
I
pV6Option
>
InitializePrototyp
es
()
private
static
Dictionary
<
IpV6OptionType
,
I
IpV6OptionComplexFactory
>
InitializeFactori
es
()
{
{
var
prototypes
=
var
prototypes
=
from
type
in
Assembly
.
GetExecutingAssembly
().
GetTypes
()
from
type
in
Assembly
.
GetExecutingAssembly
().
GetTypes
()
where
typeof
(
IpV6Option
).
IsAssignableFrom
(
type
)
&&
where
GetRegistrationAttribute
(
type
)
!=
null
GetRegistrationAttribute
(
type
)
!=
null
select
new
select
new
{
{
GetRegistrationAttribute
(
type
).
OptionType
,
GetRegistrationAttribute
(
type
).
OptionType
,
Option
=
(
I
pV6Option
)
Activator
.
CreateInstance
(
typ
e
)
Option
=
(
I
IpV6OptionComplexFactory
)
Activator
.
CreateInstance
(
type
,
tru
e
)
};
};
return
prototypes
.
ToDictionary
(
option
=>
option
.
OptionType
,
option
=>
option
.
Option
);
return
prototypes
.
ToDictionary
(
option
=>
option
.
OptionType
,
option
=>
option
.
Option
);
...
@@ -195,7 +199,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -195,7 +199,7 @@ namespace PcapDotNet.Packets.IpV6
select
new
select
new
{
{
GetRegistrationAttribute
(
type
).
OptionType
,
GetRegistrationAttribute
(
type
).
OptionType
,
Option
=
(
IpV6MobilityOption
)
Activator
.
CreateInstance
(
type
)
Option
=
(
IpV6MobilityOption
)
Activator
.
CreateInstance
(
type
,
true
)
};
};
return
prototypes
.
ToDictionary
(
option
=>
option
.
OptionType
,
option
=>
option
.
Option
);
return
prototypes
.
ToDictionary
(
option
=>
option
.
OptionType
,
option
=>
option
.
Option
);
...
...
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