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
3736d46f
Commit
3736d46f
authored
Sep 08, 2012
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IPv6
parent
62a73ed7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
141 additions
and
3 deletions
+141
-3
IpV6Datagram.cs
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6Datagram.cs
+141
-3
No files found.
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6Datagram.cs
View file @
3736d46f
...
@@ -1964,9 +1964,147 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -1964,9 +1964,147 @@ namespace PcapDotNet.Packets.IpV6
return
IpV6OptionSmfDpdSequenceBased
.
CreateSpecificInstance
(
data
);
return
IpV6OptionSmfDpdSequenceBased
.
CreateSpecificInstance
(
data
);
}
}
}
}
// HomeAddress = 0xC9,
// EndpointIdentification = 0x8A,
/// <summary>
// RplOption = 0x63,
/// RFC 6275.
/// Home Address Option.
/// <pre>
/// +-----+-------------+--------------+
/// | Bit | 0-7 | 8-15 |
/// +-----+-------------+--------------+
/// | 0 | Option Type | Opt Data Len |
/// +-----+-------------+--------------+
/// | 16 | Home Address |
/// | | |
/// | | |
/// | | |
/// | | |
/// | | |
/// | | |
/// | | |
/// +-----+----------------------------+
/// </pre>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
HomeAddress
)]
public
class
IpV6OptionHomeAddress
:
IpV6OptionComplex
{
public
const
int
OptionDataLength
=
IpV6Address
.
SizeOf
;
public
IpV6OptionHomeAddress
(
IpV6Address
homeAddress
)
:
base
(
IpV6OptionType
.
HomeAddress
)
{
HomeAddress
=
homeAddress
;
}
/// <summary>
/// The home address of the mobile node sending the packet.
/// This address must be a unicast routable address.
/// </summary>
public
IpV6Address
HomeAddress
{
get
;
private
set
;
}
internal
IpV6OptionHomeAddress
()
:
this
(
IpV6Address
.
Zero
)
{
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
{
if
(
data
.
Length
!=
OptionDataLength
)
return
null
;
IpV6Address
homeAddress
=
data
.
ReadIpV6Address
(
0
,
Endianity
.
Big
);
return
new
IpV6OptionHomeAddress
(
homeAddress
);
}
internal
override
int
DataLength
{
get
{
return
OptionDataLength
;
}
}
internal
override
void
WriteData
(
byte
[]
buffer
,
ref
int
offset
)
{
buffer
.
Write
(
ref
offset
,
HomeAddress
,
Endianity
.
Big
);
}
}
/// <summary>
/// Charles Lynn..
/// http://ana-3.lcs.mit.edu/~jnc/nimrod/eidoption.txt
/// Endpoint Identifier Option.
/// <pre>
/// +-----+-------------+--------------+
/// | Bit | 0-7 | 8-15 |
/// +-----+-------------+--------------+
/// | 0 | Option Type | Opt Data Len |
/// +-----+-------------+--------------+
/// | 16 | Src Len | Dst Len |
/// +-----+-------------+--------------+
/// | 32 | Source EID |
/// | ... | |
/// +-----+----------------------------+
/// | | Destination EID |
/// | ... | |
/// +-----+----------------------------+
/// </pre>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
EndpointIdentification
)]
public
class
IpV6OptionEndpointIdentification
:
IpV6OptionComplex
{
private
static
class
Offset
{
public
const
int
SourceEndpointIdentifierLength
=
0
;
public
const
int
DestinationEndpointIdentifierLength
=
SourceEndpointIdentifierLength
+
sizeof
(
byte
);
public
const
int
SourceEndpointIdentifier
=
DestinationEndpointIdentifierLength
+
sizeof
(
byte
);
}
public
const
int
OptionDataMinimumLength
=
Offset
.
SourceEndpointIdentifier
;
public
IpV6OptionEndpointIdentification
(
DataSegment
sourceEndpointIdentifier
,
DataSegment
destinationEndpointIdentifier
)
:
base
(
IpV6OptionType
.
EndpointIdentification
)
{
SourceEndpointIdentifier
=
sourceEndpointIdentifier
;
DestinationEndpointIdentifier
=
destinationEndpointIdentifier
;
}
public
DataSegment
SourceEndpointIdentifier
{
get
;
private
set
;
}
public
DataSegment
DestinationEndpointIdentifier
{
get
;
private
set
;
}
internal
IpV6OptionEndpointIdentification
()
:
this
(
DataSegment
.
Empty
,
DataSegment
.
Empty
)
{
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
{
if
(
data
.
Length
<
OptionDataMinimumLength
)
return
null
;
int
sourceEndpointIdentifierLength
=
data
[
Offset
.
SourceEndpointIdentifierLength
];
int
destinationEndpointIdentifierLength
=
data
[
Offset
.
DestinationEndpointIdentifierLength
];
if
(
data
.
Length
!=
OptionDataMinimumLength
+
sourceEndpointIdentifierLength
+
destinationEndpointIdentifierLength
)
return
null
;
DataSegment
sourceEndpointIdentifier
=
data
.
Subsegment
(
Offset
.
SourceEndpointIdentifier
,
sourceEndpointIdentifierLength
);
int
destinationEndpointIdentifierOffset
=
Offset
.
SourceEndpointIdentifier
+
sourceEndpointIdentifierLength
;
DataSegment
destinationEndpointIdentifier
=
data
.
Subsegment
(
destinationEndpointIdentifierOffset
,
destinationEndpointIdentifierLength
);
return
new
IpV6OptionEndpointIdentification
(
sourceEndpointIdentifier
,
destinationEndpointIdentifier
);
}
internal
override
int
DataLength
{
get
{
return
OptionDataMinimumLength
+
SourceEndpointIdentifier
.
Length
+
DestinationEndpointIdentifier
.
Length
;
}
}
internal
override
void
WriteData
(
byte
[]
buffer
,
ref
int
offset
)
{
buffer
.
Write
(
ref
offset
,
(
byte
)
SourceEndpointIdentifier
.
Length
);
buffer
.
Write
(
ref
offset
,
(
byte
)
DestinationEndpointIdentifier
.
Length
);
buffer
.
Write
(
ref
offset
,
SourceEndpointIdentifier
);
buffer
.
Write
(
ref
offset
,
DestinationEndpointIdentifier
);
}
}
// RplOption = 0x63,
// IlnpNonce = 0x8B,
// IlnpNonce = 0x8B,
public
class
IpV6Options
:
Options
<
IpV6Option
>
public
class
IpV6Options
:
Options
<
IpV6Option
>
...
...
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