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
a1d11f17
Commit
a1d11f17
authored
Jun 28, 2013
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IPv6
parent
14e2149e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1041 additions
and
29 deletions
+1041
-29
ByteArrayExtensions.cs
PcapDotNet/src/PcapDotNet.Packets/ByteArrayExtensions.cs
+12
-0
IpV6OptionPad1.cs
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6OptionPad1.cs
+3
-8
IpV6OptionPadN.cs
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6OptionPadN.cs
+10
-8
IpV6OptionSimple.cs
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6OptionSimple.cs
+8
-1
IpV6OptionType.cs
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6OptionType.cs
+5
-5
IpV6OptionUnknown.cs
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6OptionUnknown.cs
+1003
-7
No files found.
PcapDotNet/src/PcapDotNet.Packets/ByteArrayExtensions.cs
View file @
a1d11f17
...
@@ -687,6 +687,18 @@ namespace PcapDotNet.Packets
...
@@ -687,6 +687,18 @@ namespace PcapDotNet.Packets
buffer
.
Write
(
offset
,
(
long
)
value
,
endianity
);
buffer
.
Write
(
offset
,
(
long
)
value
,
endianity
);
}
}
/// <summary>
/// Writes the given value to the buffer using the given endianity and increments the offset by the number of bytes written.
/// </summary>
/// <param name="buffer">The buffer to write the value to.</param>
/// <param name="offset">The offset in the buffer to start writing.</param>
/// <param name="value">The value to write.</param>
/// <param name="endianity">The endianity to use when converting the value to bytes.</param>
public
static
void
Write
(
this
byte
[]
buffer
,
ref
int
offset
,
ulong
value
,
Endianity
endianity
)
{
buffer
.
Write
(
offset
,
(
long
)
value
,
endianity
);
}
/// <summary>
/// <summary>
/// Writes the given value to the buffer using the given endianity.
/// Writes the given value to the buffer using the given endianity.
/// </summary>
/// </summary>
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6OptionPad1.cs
View file @
a1d11f17
using
System
;
namespace
PcapDotNet.Packets.IpV6
namespace
PcapDotNet.Packets.IpV6
{
{
/// <summary>
/// <summary>
...
@@ -7,7 +9,6 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -7,7 +9,6 @@ namespace PcapDotNet.Packets.IpV6
/// | 0 | 0 |
/// | 0 | 0 |
/// +-----+-----+
/// +-----+-----+
/// </summary>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
Pad1
)]
public
class
IpV6OptionPad1
:
IpV6OptionSimple
public
class
IpV6OptionPad1
:
IpV6OptionSimple
{
{
public
const
int
OptionLength
=
sizeof
(
byte
);
public
const
int
OptionLength
=
sizeof
(
byte
);
...
@@ -16,11 +17,6 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -16,11 +17,6 @@ namespace PcapDotNet.Packets.IpV6
:
base
(
IpV6OptionType
.
Pad1
)
:
base
(
IpV6OptionType
.
Pad1
)
{
{
}
}
internal
override
IpV6Option
CreateInstance
(
DataSegment
data
)
{
return
new
IpV6OptionPad1
();
}
}
}
/// <summary>
/// <summary>
...
@@ -31,7 +27,6 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -31,7 +27,6 @@ namespace PcapDotNet.Packets.IpV6
/// | 0 | 0 |
/// | 0 | 0 |
/// +-----+-----+
/// +-----+-----+
/// </summary>
/// </summary>
[
IpV6MobilityOptionTypeRegistration
(
IpV6MobilityOptionType
.
Pad1
)]
public
class
IpV6MobilityOptionPad1
:
IpV6MobilityOption
public
class
IpV6MobilityOptionPad1
:
IpV6MobilityOption
{
{
public
const
int
OptionLength
=
sizeof
(
byte
);
public
const
int
OptionLength
=
sizeof
(
byte
);
...
@@ -43,7 +38,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -43,7 +38,7 @@ namespace PcapDotNet.Packets.IpV6
internal
override
IpV6MobilityOption
CreateInstance
(
DataSegment
data
)
internal
override
IpV6MobilityOption
CreateInstance
(
DataSegment
data
)
{
{
return
new
IpV6MobilityOptionPad1
(
);
throw
new
InvalidOperationException
(
"Pad1 options shouldn't be registered."
);
}
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6OptionPadN.cs
View file @
a1d11f17
...
@@ -3,14 +3,16 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -3,14 +3,16 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// <summary>
/// RFC 2460.
/// RFC 2460.
/// <pre>
/// <pre>
/// +-----+-------------+--------------+
/// +-----+-------------+
/// | Bit | 0-7 | 8-15 |
/// | Bit | 0-7 |
/// +-----+-------------+--------------+
/// +-----+-------------+
/// | 0 | Option Type | N |
/// | 0 | Option Type |
/// +-----+-------------+--------------+
/// +-----+-------------+
/// | 16 | 0 |
/// | 8 | N |
/// | ... | |
/// +-----+-------------+
/// +-----+----------------------------+
/// | 16 | 0 |
/// | ... | |
/// +-----+-------------+
/// </pre>
/// </pre>
/// </summary>
/// </summary>
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
PadN
)]
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
PadN
)]
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6OptionSimple.cs
View file @
a1d11f17
using
System
;
namespace
PcapDotNet.Packets.IpV6
namespace
PcapDotNet.Packets.IpV6
{
{
/// <summary>
/// <summary>
...
@@ -25,5 +27,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -25,5 +27,10 @@ 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."
);
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6OptionType.cs
View file @
a1d11f17
...
@@ -99,7 +99,7 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -99,7 +99,7 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// <summary>
/// RFC 6275.
/// RFC 6275.
/// </summary>
/// </summary>
AuthorizationData
=
0x05
,
Binding
AuthorizationData
=
0x05
,
/// <summary>
/// <summary>
/// RFC 3963.
/// RFC 3963.
...
@@ -111,25 +111,25 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -111,25 +111,25 @@ namespace PcapDotNet.Packets.IpV6
/// RFC 5568.
/// RFC 5568.
/// Mobility Header Link-Layer Address option.
/// Mobility Header Link-Layer Address option.
/// </summary>
/// </summary>
MobilityHeader
LinkLayerAddress
=
0x07
,
LinkLayerAddress
=
0x07
,
/// <summary>
/// <summary>
/// RFC 4283.
/// RFC 4283.
/// MN-ID-OPTION-TYPE.
/// MN-ID-OPTION-TYPE.
/// </summary>
/// </summary>
M
nId
=
0x08
,
M
obileNodeIdentifier
=
0x08
,
/// <summary>
/// <summary>
/// RFC 4285.
/// RFC 4285.
/// AUTH-OPTION-TYPE.
/// AUTH-OPTION-TYPE.
/// </summary>
/// </summary>
Auth
=
0x09
,
Auth
entication
=
0x09
,
/// <summary>
/// <summary>
/// RFC 4285.
/// RFC 4285.
/// MESG-ID-OPTION-TYPE
/// MESG-ID-OPTION-TYPE
/// </summary>
/// </summary>
MesgId
=
0x0A
,
ReplayProtection
=
0x0A
,
/// <summary>
/// <summary>
/// RFC 4866.
/// RFC 4866.
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/IpV6OptionUnknown.cs
View file @
a1d11f17
This diff is collapsed.
Click to expand it.
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