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
f1adbe20
Commit
f1adbe20
authored
Sep 08, 2012
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IPv6
parent
19ed05da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
5 deletions
+83
-5
IpV6Datagram.cs
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6Datagram.cs
+83
-5
No files found.
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6Datagram.cs
View file @
f1adbe20
...
...
@@ -402,6 +402,11 @@ namespace PcapDotNet.Packets.IpV6
/// RFC irtf-rrg-ilnp-noncev6-06.
/// </summary>
IlnpNonce
=
0x8B
,
/// <summary>
/// RFC ietf-6man-lineid-08.
/// </summary>
LineIdentification
=
0x8C
,
}
/// <summary>
...
...
@@ -529,11 +534,6 @@ namespace PcapDotNet.Packets.IpV6
public
DataSegment
Data
{
get
;
private
set
;
}
internal
Option
Read
(
byte
[]
buffer
,
ref
int
offset
,
int
length
)
{
throw
new
NotImplementedException
();
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
{
throw
new
InvalidOperationException
(
"IpV6OptionUnknown shouldn't be registered."
);
...
...
@@ -2279,6 +2279,84 @@ namespace PcapDotNet.Packets.IpV6
}
}
/// <summary>
/// RFC ietf-6man-lineid-08.
/// http://tools.ietf.org/html/draft-ietf-6man-lineid-08
/// Line Identification Destination Option.
/// <pre>
/// +-----+---------------------+
/// | Bit | 0-7 |
/// +-----+---------------------+
/// | 0 | Option Type |
/// +-----+---------------------+
/// | 8 | Opt Data Len |
/// +-----+---------------------+
/// | 16 | LineIDLen |
/// +-----+---------------------+
/// | 24 | Line Identification |
/// | ... | |
/// +-----+---------------------+
/// </pre>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
LineIdentification
)]
public
class
IpV6OptionLineIdentificationDestination
:
IpV6OptionComplex
{
private
static
class
Offset
{
public
const
int
LineIdentificationLength
=
0
;
public
const
int
LineIdentification
=
LineIdentificationLength
+
sizeof
(
byte
);
}
public
const
int
OptionDataMinimumLength
=
Offset
.
LineIdentification
;
public
IpV6OptionLineIdentificationDestination
(
DataSegment
lineIdentification
)
:
base
(
IpV6OptionType
.
LineIdentification
)
{
if
(
lineIdentification
.
Length
>
byte
.
MaxValue
)
{
throw
new
ArgumentOutOfRangeException
(
"lineIdentification"
,
lineIdentification
,
string
.
Format
(
"Cannot be longer than {0} bytes."
,
byte
.
MaxValue
));
}
LineIdentification
=
lineIdentification
;
}
/// <summary>
/// Variable length data inserted by the AN describing the subscriber agent circuit identifier
/// corresponding to the logical access loop port of the AN from which the RS was initiated.
/// The line identification must be unique across all the ANs that share a link to the edge router.
/// </summary>
public
DataSegment
LineIdentification
{
get
;
private
set
;
}
internal
IpV6OptionLineIdentificationDestination
()
:
this
(
DataSegment
.
Empty
)
{
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
{
if
(
data
.
Length
<
OptionDataMinimumLength
)
return
null
;
int
lineIdentificationLegnth
=
data
[
Offset
.
LineIdentificationLength
];
if
(
data
.
Length
!=
OptionDataMinimumLength
+
lineIdentificationLegnth
)
return
null
;
DataSegment
lineIdentification
=
data
.
Subsegment
(
Offset
.
LineIdentification
,
data
.
Length
-
Offset
.
LineIdentification
);
return
new
IpV6OptionLineIdentificationDestination
(
lineIdentification
);
}
internal
override
int
DataLength
{
get
{
return
OptionDataMinimumLength
+
LineIdentification
.
Length
;
}
}
internal
override
void
WriteData
(
byte
[]
buffer
,
ref
int
offset
)
{
buffer
.
Write
(
ref
offset
,
(
byte
)
LineIdentification
.
Length
);
buffer
.
Write
(
ref
offset
,
LineIdentification
);
}
}
public
class
IpV6Options
:
Options
<
IpV6Option
>
{
public
IpV6Options
(
DataSegment
data
)
:
this
(
Read
(
data
))
...
...
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