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
6b9c23dc
Commit
6b9c23dc
authored
Sep 18, 2012
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IPv6
parent
97e2aff3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
24 deletions
+86
-24
IpV6ExtensionHeader.cs
...DotNet/src/PcapDotNet.Packets/IpV6/IpV6ExtensionHeader.cs
+23
-19
IpV6ExtensionHeaderDestinationOptions.cs
...Net.Packets/IpV6/IpV6ExtensionHeaderDestinationOptions.cs
+31
-0
IpV6ExtensionHeaderHopByHopOptions.cs
...DotNet.Packets/IpV6/IpV6ExtensionHeaderHopByHopOptions.cs
+2
-5
IpV6ExtensionHeaderOptions.cs
...src/PcapDotNet.Packets/IpV6/IpV6ExtensionHeaderOptions.cs
+28
-0
PcapDotNet.Packets.csproj
PcapDotNet/src/PcapDotNet.Packets/PcapDotNet.Packets.csproj
+2
-0
No files found.
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6ExtensionHeader.cs
View file @
6b9c23dc
...
...
@@ -39,31 +39,21 @@ namespace PcapDotNet.Packets.IpV6
{
switch
(
nextHeader
)
{
case
IpV4Protocol
.
IpV6HopByHopOption
:
// 0
case
IpV4Protocol
.
IpV6Route
:
// 43
case
IpV4Protocol
.
IpV6HopByHopOption
:
// 0
case
IpV4Protocol
.
IpV6Route
:
// 43
case
IpV4Protocol
.
FragmentHeaderForIpV6
:
// 44
numBytesRead
=
0
;
if
(
extensionHeaderData
.
Length
<
MinimumLength
)
return
null
;
IpV4Protocol
nextNextHeader
=
(
IpV4Protocol
)
extensionHeaderData
[
Offset
.
NextHeader
];
int
length
=
(
extensionHeaderData
[
Offset
.
HeaderExtensionLength
]
+
1
)
*
8
;
if
(
extensionHeaderData
.
Length
<
length
)
return
null
;
DataSegment
data
=
extensionHeaderData
.
Subsegment
(
Offset
.
Data
,
length
-
Offset
.
Data
);
numBytesRead
=
data
.
Length
;
return
CreateStandardInstance
(
nextHeader
,
nextNextHeader
,
data
);
case
IpV4Protocol
.
IpV6Opts
:
// 60
return
CreateStandardInstance
(
nextHeader
,
extensionHeaderData
,
out
numBytesRead
);
case
IpV4Protocol
.
EncapsulatingSecurityPayload
:
// 50
return
IpV6ExtensionHeaderEncapsulatingSecurityPayload
.
CreateInstance
(
extensionHeaderData
,
out
numBytesRead
);
case
IpV4Protocol
.
AuthenticationHeader
:
// 51
return
IpV6ExtensionHeaderAuthentication
.
CreateInstance
(
extensionHeaderData
,
out
numBytesRead
);
/*
case IpV4Protocol.IpV6Opts: // 60
return IpV6ExtensionHeaderDestinationOptions.Parse(data);
case IpV4Protocol.MobilityHeader: // 135
return IpV6MobilityExtensionHeader.Parse(data);
*/
...
...
@@ -73,8 +63,19 @@ namespace PcapDotNet.Packets.IpV6
}
private
static
IpV6ExtensionHeader
CreateStandardInstance
(
IpV4Protocol
nextHeader
,
IpV4Protocol
nextNextHeader
,
DataSegment
data
)
private
static
IpV6ExtensionHeader
CreateStandardInstance
(
IpV4Protocol
nextHeader
,
DataSegment
extensionHeaderData
,
out
int
numBytesRead
)
{
numBytesRead
=
0
;
if
(
extensionHeaderData
.
Length
<
MinimumLength
)
return
null
;
IpV4Protocol
nextNextHeader
=
(
IpV4Protocol
)
extensionHeaderData
[
Offset
.
NextHeader
];
int
length
=
(
extensionHeaderData
[
Offset
.
HeaderExtensionLength
]
+
1
)
*
8
;
if
(
extensionHeaderData
.
Length
<
length
)
return
null
;
DataSegment
data
=
extensionHeaderData
.
Subsegment
(
Offset
.
Data
,
length
-
Offset
.
Data
);
numBytesRead
=
data
.
Length
;
switch
(
nextHeader
)
{
case
IpV4Protocol
.
IpV6HopByHopOption
:
// 0
...
...
@@ -85,10 +86,13 @@ namespace PcapDotNet.Packets.IpV6
case
IpV4Protocol
.
FragmentHeaderForIpV6
:
// 44
return
IpV6ExtensionHeaderFragmentData
.
ParseData
(
nextNextHeader
,
data
);
case
IpV4Protocol
.
IpV6Opts
:
// 60
return
IpV6ExtensionHeaderDestinationOptions
.
ParseData
(
nextNextHeader
,
data
);
default
:
throw
new
InvalidOperationException
(
"Invalid nextHeader value"
+
nextHeader
);
}
}
}
}
\ No newline at end of file
}
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6ExtensionHeaderDestinationOptions.cs
0 → 100644
View file @
6b9c23dc
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
{
/// <summary>
/// RFC 2460.
/// <pre>
/// +-----+-------------+-------------------------+
/// | Bit | 0-7 | 8-15 |
/// +-----+-------------+-------------------------+
/// | 0 | Next Header | Header Extension Length |
/// +-----+-------------+-------------------------+
/// | 32 | Options |
/// | ... | |
/// +-----+---------------------------------------+
/// </pre>
/// </summary>
public
class
IpV6ExtensionHeaderDestinationOptions
:
IpV6ExtensionHeaderOptions
{
public
IpV6ExtensionHeaderDestinationOptions
(
IpV4Protocol
nextHeader
,
IpV6Options
options
)
:
base
(
nextHeader
,
options
)
{
}
internal
static
IpV6ExtensionHeaderDestinationOptions
ParseData
(
IpV4Protocol
nextHeader
,
DataSegment
data
)
{
IpV6Options
options
=
new
IpV6Options
(
data
);
return
new
IpV6ExtensionHeaderDestinationOptions
(
nextHeader
,
options
);
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6ExtensionHeaderHopByHopOptions.cs
View file @
6b9c23dc
...
...
@@ -15,16 +15,13 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+---------------------------------------+
/// </pre>
/// </summary>
public
class
IpV6ExtensionHeaderHopByHopOptions
:
IpV6ExtensionHeader
public
class
IpV6ExtensionHeaderHopByHopOptions
:
IpV6ExtensionHeader
Options
{
private
IpV6ExtensionHeaderHopByHopOptions
(
IpV4Protocol
nextHeader
,
IpV6Options
options
)
:
base
(
nextHeader
)
:
base
(
nextHeader
,
options
)
{
Options
=
options
;
}
public
IpV6Options
Options
{
get
;
private
set
;
}
internal
static
IpV6ExtensionHeaderHopByHopOptions
ParseData
(
IpV4Protocol
nextHeader
,
DataSegment
data
)
{
IpV6Options
options
=
new
IpV6Options
(
data
);
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6ExtensionHeaderOptions.cs
0 → 100644
View file @
6b9c23dc
using
PcapDotNet.Packets.IpV4
;
namespace
PcapDotNet.Packets.IpV6
{
/// <summary>
/// RFC 2460.
/// <pre>
/// +-----+-------------+-------------------------+
/// | Bit | 0-7 | 8-15 |
/// +-----+-------------+-------------------------+
/// | 0 | Next Header | Header Extension Length |
/// +-----+-------------+-------------------------+
/// | 16 | Options |
/// | ... | |
/// +-----+---------------------------------------+
/// </pre>
/// </summary>
public
abstract
class
IpV6ExtensionHeaderOptions
:
IpV6ExtensionHeader
{
public
IpV6Options
Options
{
get
;
private
set
;
}
internal
IpV6ExtensionHeaderOptions
(
IpV4Protocol
nextHeader
,
IpV6Options
options
)
:
base
(
nextHeader
)
{
Options
=
options
;
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/PcapDotNet.Packets.csproj
View file @
6b9c23dc
...
...
@@ -319,9 +319,11 @@
<Compile
Include=
"IpV6\IpV6CalipsoDomainOfInterpretation.cs"
/>
<Compile
Include=
"IpV6\IpV6ExtensionHeader.cs"
/>
<Compile
Include=
"IpV6\IpV6ExtensionHeaderAuthentication.cs"
/>
<Compile
Include=
"IpV6\IpV6ExtensionHeaderDestinationOptions.cs"
/>
<Compile
Include=
"IpV6\IpV6ExtensionHeaderEncapsulatingSecurityPayload.cs"
/>
<Compile
Include=
"IpV6\IpV6ExtensionHeaderFragmentData.cs"
/>
<Compile
Include=
"IpV6\IpV6ExtensionHeaderHopByHopOptions.cs"
/>
<Compile
Include=
"IpV6\IpV6ExtensionHeaderOptions.cs"
/>
<Compile
Include=
"IpV6\IpV6ExtensionHeaderRouting.cs"
/>
<Compile
Include=
"IpV6\IpV6ExtensionHeaderRoutingHomeAddress.cs"
/>
<Compile
Include=
"IpV6\IpV6ExtensionHeaderRoutingRpl.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