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
541b67a5
Commit
541b67a5
authored
Sep 13, 2014
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
589 warnings left
parent
404b6321
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
121 additions
and
18 deletions
+121
-18
IpV6ExtensionHeaderDestinationOptions.cs
...ExtensionHeaders/IpV6ExtensionHeaderDestinationOptions.cs
+8
-0
IpV6ExtensionHeaderHopByHopOptions.cs
...V6/ExtensionHeaders/IpV6ExtensionHeaderHopByHopOptions.cs
+9
-1
IpV6ExtensionHeaderOptions.cs
...ckets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderOptions.cs
+3
-0
IIpV6OptionComplexFactory.cs
...pDotNet.Packets/IpV6/Options/IIpV6OptionComplexFactory.cs
+5
-0
IpV6AccessNetworkIdentifierSubOptionUnknown.cs
...V6/Options/IpV6AccessNetworkIdentifierSubOptionUnknown.cs
+8
-0
IpV6FlowIdentificationSubOptionPadN.cs
...ckets/IpV6/Options/IpV6FlowIdentificationSubOptionPadN.cs
+7
-0
IpV6FlowIdentificationSubOptionUnknown.cs
...ts/IpV6/Options/IpV6FlowIdentificationSubOptionUnknown.cs
+8
-0
IpV6MobilityOption.cs
...src/PcapDotNet.Packets/IpV6/Options/IpV6MobilityOption.cs
+0
-5
IpV6MobilityOptionAccessNetworkIdentifier.cs
...IpV6/Options/IpV6MobilityOptionAccessNetworkIdentifier.cs
+4
-0
IpV6MobilityOptionCareOfTest.cs
...tNet.Packets/IpV6/Options/IpV6MobilityOptionCareOfTest.cs
+4
-0
IpV6MobilityOptionComplex.cs
...pDotNet.Packets/IpV6/Options/IpV6MobilityOptionComplex.cs
+7
-4
IpV6MobilityOptionContextRequestEntry.cs
...ets/IpV6/Options/IpV6MobilityOptionContextRequestEntry.cs
+8
-2
IpV6MobilityOptionPad1.cs
...PcapDotNet.Packets/IpV6/Options/IpV6MobilityOptionPad1.cs
+5
-0
IpV6MobilityOptionReplayProtection.cs
...ackets/IpV6/Options/IpV6MobilityOptionReplayProtection.cs
+4
-0
IpV6MobilityOptionUnknown.cs
...pDotNet.Packets/IpV6/Options/IpV6MobilityOptionUnknown.cs
+8
-0
IpV6OptionComplex.cs
.../src/PcapDotNet.Packets/IpV6/Options/IpV6OptionComplex.cs
+7
-4
IpV6OptionIlnpNonce.cs
...rc/PcapDotNet.Packets/IpV6/Options/IpV6OptionIlnpNonce.cs
+9
-0
IpV6OptionPadN.cs
...Net/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionPadN.cs
+12
-0
PppFrameCheckSequenceCalculator.cs
...t.Packets/IpV6/Options/PppFrameCheckSequenceCalculator.cs
+4
-1
Packet.cs
PcapDotNet/src/PcapDotNet.Packets/Packet.cs
+1
-1
No files found.
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderDestinationOptions.cs
View file @
541b67a5
...
@@ -18,11 +18,19 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -18,11 +18,19 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
sealed
class
IpV6ExtensionHeaderDestinationOptions
:
IpV6ExtensionHeaderOptions
public
sealed
class
IpV6ExtensionHeaderDestinationOptions
:
IpV6ExtensionHeaderOptions
{
{
/// <summary>
/// Creates an instance from next header and options.
/// </summary>
/// <param name="nextHeader">Identifies the type of header immediately following this extension header.</param>
/// <param name="options">Extension header options.</param>
public
IpV6ExtensionHeaderDestinationOptions
(
IpV4Protocol
nextHeader
,
IpV6Options
options
)
public
IpV6ExtensionHeaderDestinationOptions
(
IpV4Protocol
nextHeader
,
IpV6Options
options
)
:
base
(
nextHeader
,
options
)
:
base
(
nextHeader
,
options
)
{
{
}
}
/// <summary>
/// Identifies the type of this extension header.
/// </summary>
public
override
IpV4Protocol
Protocol
public
override
IpV4Protocol
Protocol
{
{
get
{
return
IpV4Protocol
.
IpV6Opts
;
}
get
{
return
IpV4Protocol
.
IpV6Opts
;
}
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderHopByHopOptions.cs
View file @
541b67a5
...
@@ -15,13 +15,21 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -15,13 +15,21 @@ namespace PcapDotNet.Packets.IpV6
/// +-----+---------------------------------------+
/// +-----+---------------------------------------+
/// </pre>
/// </pre>
/// </summary>
/// </summary>
public
class
IpV6ExtensionHeaderHopByHopOptions
:
IpV6ExtensionHeaderOptions
public
sealed
class
IpV6ExtensionHeaderHopByHopOptions
:
IpV6ExtensionHeaderOptions
{
{
/// <summary>
/// Creates an instance from next header and options.
/// </summary>
/// <param name="nextHeader">Identifies the type of header immediately following this extension header.</param>
/// <param name="options">Options for the extension header.</param>
public
IpV6ExtensionHeaderHopByHopOptions
(
IpV4Protocol
nextHeader
,
IpV6Options
options
)
public
IpV6ExtensionHeaderHopByHopOptions
(
IpV4Protocol
nextHeader
,
IpV6Options
options
)
:
base
(
nextHeader
,
options
)
:
base
(
nextHeader
,
options
)
{
{
}
}
/// <summary>
/// Identifies the type of this extension header.
/// </summary>
public
override
IpV4Protocol
Protocol
public
override
IpV4Protocol
Protocol
{
{
get
{
return
IpV4Protocol
.
IpV6HopByHopOption
;
}
get
{
return
IpV4Protocol
.
IpV6HopByHopOption
;
}
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/ExtensionHeaders/IpV6ExtensionHeaderOptions.cs
View file @
541b67a5
...
@@ -18,6 +18,9 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -18,6 +18,9 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
abstract
class
IpV6ExtensionHeaderOptions
:
IpV6ExtensionHeaderStandard
public
abstract
class
IpV6ExtensionHeaderOptions
:
IpV6ExtensionHeaderStandard
{
{
/// <summary>
/// Extension header options.
/// </summary>
public
IpV6Options
Options
{
get
;
private
set
;
}
public
IpV6Options
Options
{
get
;
private
set
;
}
public
sealed
override
bool
IsValid
public
sealed
override
bool
IsValid
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IIpV6OptionComplexFactory.cs
View file @
541b67a5
...
@@ -2,6 +2,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -2,6 +2,11 @@ namespace PcapDotNet.Packets.IpV6
{
{
internal
interface
IIpV6OptionComplexFactory
internal
interface
IIpV6OptionComplexFactory
{
{
/// <summary>
/// Parses an option from the given data.
/// </summary>
/// <param name="data">The data to parse.</param>
/// <returns>The option if parsing was successful, null otherwise.</returns>
IpV6Option
CreateInstance
(
DataSegment
data
);
IpV6Option
CreateInstance
(
DataSegment
data
);
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6AccessNetworkIdentifierSubOptionUnknown.cs
View file @
541b67a5
...
@@ -17,12 +17,20 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -17,12 +17,20 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
sealed
class
IpV6AccessNetworkIdentifierSubOptionUnknown
:
IpV6AccessNetworkIdentifierSubOption
public
sealed
class
IpV6AccessNetworkIdentifierSubOptionUnknown
:
IpV6AccessNetworkIdentifierSubOption
{
{
/// <summary>
/// Creates an instance from type and data.
/// </summary>
/// <param name="type">The type of the option.</param>
/// <param name="data">The data of the option.</param>
public
IpV6AccessNetworkIdentifierSubOptionUnknown
(
IpV6AccessNetworkIdentifierSubOptionType
type
,
DataSegment
data
)
public
IpV6AccessNetworkIdentifierSubOptionUnknown
(
IpV6AccessNetworkIdentifierSubOptionType
type
,
DataSegment
data
)
:
base
(
type
)
:
base
(
type
)
{
{
Data
=
data
;
Data
=
data
;
}
}
/// <summary>
/// The data of the option.
/// </summary>
public
DataSegment
Data
{
get
;
private
set
;
}
public
DataSegment
Data
{
get
;
private
set
;
}
internal
override
IpV6AccessNetworkIdentifierSubOption
CreateInstance
(
DataSegment
data
)
internal
override
IpV6AccessNetworkIdentifierSubOption
CreateInstance
(
DataSegment
data
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6FlowIdentificationSubOptionPadN.cs
View file @
541b67a5
...
@@ -18,12 +18,19 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -18,12 +18,19 @@ namespace PcapDotNet.Packets.IpV6
[
IpV6FlowIdentificationSubOptionTypeRegistration
(
IpV6FlowIdentificationSubOptionType
.
PadN
)]
[
IpV6FlowIdentificationSubOptionTypeRegistration
(
IpV6FlowIdentificationSubOptionType
.
PadN
)]
public
sealed
class
IpV6FlowIdentificationSubOptionPadN
:
IpV6FlowIdentificationSubOptionComplex
public
sealed
class
IpV6FlowIdentificationSubOptionPadN
:
IpV6FlowIdentificationSubOptionComplex
{
{
/// <summary>
/// Creates an instance from padding data length.
/// </summary>
/// <param name="paddingDataLength">The size of the padding in bytes.</param>
public
IpV6FlowIdentificationSubOptionPadN
(
int
paddingDataLength
)
public
IpV6FlowIdentificationSubOptionPadN
(
int
paddingDataLength
)
:
base
(
IpV6FlowIdentificationSubOptionType
.
PadN
)
:
base
(
IpV6FlowIdentificationSubOptionType
.
PadN
)
{
{
PaddingDataLength
=
paddingDataLength
;
PaddingDataLength
=
paddingDataLength
;
}
}
/// <summary>
/// The size of the padding in bytes.
/// </summary>
public
int
PaddingDataLength
{
get
;
private
set
;
}
public
int
PaddingDataLength
{
get
;
private
set
;
}
internal
override
IpV6FlowIdentificationSubOption
CreateInstance
(
DataSegment
data
)
internal
override
IpV6FlowIdentificationSubOption
CreateInstance
(
DataSegment
data
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6FlowIdentificationSubOptionUnknown.cs
View file @
541b67a5
...
@@ -17,12 +17,20 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -17,12 +17,20 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
sealed
class
IpV6FlowIdentificationSubOptionUnknown
:
IpV6FlowIdentificationSubOptionComplex
public
sealed
class
IpV6FlowIdentificationSubOptionUnknown
:
IpV6FlowIdentificationSubOptionComplex
{
{
/// <summary>
/// Creates an instance from type and data.
/// </summary>
/// <param name="type">The type of the option.</param>
/// <param name="data">The data of the option.</param>
public
IpV6FlowIdentificationSubOptionUnknown
(
IpV6FlowIdentificationSubOptionType
type
,
DataSegment
data
)
public
IpV6FlowIdentificationSubOptionUnknown
(
IpV6FlowIdentificationSubOptionType
type
,
DataSegment
data
)
:
base
(
type
)
:
base
(
type
)
{
{
Data
=
data
;
Data
=
data
;
}
}
/// <summary>
/// The data of the option.
/// </summary>
public
DataSegment
Data
{
get
;
private
set
;
}
public
DataSegment
Data
{
get
;
private
set
;
}
internal
override
IpV6FlowIdentificationSubOption
CreateInstance
(
DataSegment
data
)
internal
override
IpV6FlowIdentificationSubOption
CreateInstance
(
DataSegment
data
)
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6MobilityOption.cs
View file @
541b67a5
...
@@ -24,11 +24,6 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -24,11 +24,6 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
IpV6MobilityOptionType
OptionType
{
get
;
private
set
;
}
public
IpV6MobilityOptionType
OptionType
{
get
;
private
set
;
}
public
override
int
Length
{
get
{
return
sizeof
(
byte
);
}
}
public
sealed
override
bool
Equals
(
Option
option
)
public
sealed
override
bool
Equals
(
Option
option
)
{
{
return
Equals
(
option
as
IpV6MobilityOption
);
return
Equals
(
option
as
IpV6MobilityOption
);
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6MobilityOptionAccessNetworkIdentifier.cs
View file @
541b67a5
...
@@ -18,6 +18,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -18,6 +18,10 @@ namespace PcapDotNet.Packets.IpV6
[
IpV6MobilityOptionTypeRegistration
(
IpV6MobilityOptionType
.
AccessNetworkIdentifier
)]
[
IpV6MobilityOptionTypeRegistration
(
IpV6MobilityOptionType
.
AccessNetworkIdentifier
)]
public
sealed
class
IpV6MobilityOptionAccessNetworkIdentifier
:
IpV6MobilityOptionComplex
public
sealed
class
IpV6MobilityOptionAccessNetworkIdentifier
:
IpV6MobilityOptionComplex
{
{
/// <summary>
/// Creates an instance from sub options.
/// </summary>
/// <param name="subOptions">Sub options.</param>
public
IpV6MobilityOptionAccessNetworkIdentifier
(
IpV6AccessNetworkIdentifierSubOptions
subOptions
)
public
IpV6MobilityOptionAccessNetworkIdentifier
(
IpV6AccessNetworkIdentifierSubOptions
subOptions
)
:
base
(
IpV6MobilityOptionType
.
AccessNetworkIdentifier
)
:
base
(
IpV6MobilityOptionType
.
AccessNetworkIdentifier
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6MobilityOptionCareOfTest.cs
View file @
541b67a5
...
@@ -18,6 +18,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -18,6 +18,10 @@ namespace PcapDotNet.Packets.IpV6
[
IpV6MobilityOptionTypeRegistration
(
IpV6MobilityOptionType
.
CareOfTest
)]
[
IpV6MobilityOptionTypeRegistration
(
IpV6MobilityOptionType
.
CareOfTest
)]
public
sealed
class
IpV6MobilityOptionCareOfTest
:
IpV6MobilityOptionULong
public
sealed
class
IpV6MobilityOptionCareOfTest
:
IpV6MobilityOptionULong
{
{
/// <summary>
/// Creates an instance from care of keygen token.
/// </summary>
/// <param name="careOfKeygenToken">Contains the care-of keygen token generated by the correspondent node.</param>
public
IpV6MobilityOptionCareOfTest
(
ulong
careOfKeygenToken
)
public
IpV6MobilityOptionCareOfTest
(
ulong
careOfKeygenToken
)
:
base
(
IpV6MobilityOptionType
.
CareOfTest
,
careOfKeygenToken
)
:
base
(
IpV6MobilityOptionType
.
CareOfTest
,
careOfKeygenToken
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6MobilityOptionComplex.cs
View file @
541b67a5
...
@@ -17,14 +17,17 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -17,14 +17,17 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
abstract
class
IpV6MobilityOptionComplex
:
IpV6MobilityOption
public
abstract
class
IpV6MobilityOptionComplex
:
IpV6MobilityOption
{
{
protected
IpV6MobilityOptionComplex
(
IpV6MobilityOptionType
type
)
/// <summary>
:
base
(
type
)
/// The number of bytes the option takes.
/// </summary>
public
sealed
override
int
Length
{
{
get
{
return
sizeof
(
byte
)
+
sizeof
(
byte
)
+
DataLength
;
}
}
}
public
sealed
override
int
Length
internal
IpV6MobilityOptionComplex
(
IpV6MobilityOptionType
type
)
:
base
(
type
)
{
{
get
{
return
base
.
Length
+
sizeof
(
byte
)
+
DataLength
;
}
}
}
internal
const
int
MaxDataLength
=
byte
.
MaxValue
-
sizeof
(
byte
)
-
sizeof
(
byte
);
internal
const
int
MaxDataLength
=
byte
.
MaxValue
-
sizeof
(
byte
)
-
sizeof
(
byte
);
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6MobilityOptionContextRequestEntry.cs
View file @
541b67a5
using
System
;
using
System
;
using
PcapDotNet.Base
;
namespace
PcapDotNet.Packets.IpV6
namespace
PcapDotNet.Packets.IpV6
{
{
...
@@ -63,14 +64,19 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -63,14 +64,19 @@ namespace PcapDotNet.Packets.IpV6
Option
.
Write
(
buffer
,
ref
offset
);
Option
.
Write
(
buffer
,
ref
offset
);
}
}
public
override
bool
Equals
(
object
obj
)
{
return
Equals
(
obj
as
IpV6MobilityOptionContextRequestEntry
);
}
public
bool
Equals
(
IpV6MobilityOptionContextRequestEntry
other
)
public
bool
Equals
(
IpV6MobilityOptionContextRequestEntry
other
)
{
{
return
(
other
!=
null
&&
RequestType
.
Equals
(
other
.
RequestType
)
&&
Option
.
Equals
(
other
.
Option
));
return
(
other
!=
null
&&
RequestType
.
Equals
(
other
.
RequestType
)
&&
Option
.
Equals
(
other
.
Option
));
}
}
public
override
bool
Equals
(
object
obj
)
public
override
int
GetHashCode
(
)
{
{
return
Equals
(
obj
as
IpV6MobilityOptionContextRequestEntry
);
return
Sequence
.
GetHashCode
(
RequestType
,
Option
);
}
}
}
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6MobilityOptionPad1.cs
View file @
541b67a5
...
@@ -25,6 +25,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -25,6 +25,11 @@ namespace PcapDotNet.Packets.IpV6
{
{
}
}
public
override
int
Length
{
get
{
return
sizeof
(
byte
);
}
}
internal
override
bool
EqualsData
(
IpV6MobilityOption
other
)
internal
override
bool
EqualsData
(
IpV6MobilityOption
other
)
{
{
return
true
;
return
true
;
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6MobilityOptionReplayProtection.cs
View file @
541b67a5
...
@@ -18,6 +18,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -18,6 +18,10 @@ namespace PcapDotNet.Packets.IpV6
[
IpV6MobilityOptionTypeRegistration
(
IpV6MobilityOptionType
.
ReplayProtection
)]
[
IpV6MobilityOptionTypeRegistration
(
IpV6MobilityOptionType
.
ReplayProtection
)]
public
sealed
class
IpV6MobilityOptionReplayProtection
:
IpV6MobilityOptionULong
public
sealed
class
IpV6MobilityOptionReplayProtection
:
IpV6MobilityOptionULong
{
{
/// <summary>
/// Creates an instance from timestamp.
/// </summary>
/// <param name="timestamp">64 bit timestamp.</param>
public
IpV6MobilityOptionReplayProtection
(
ulong
timestamp
)
public
IpV6MobilityOptionReplayProtection
(
ulong
timestamp
)
:
base
(
IpV6MobilityOptionType
.
ReplayProtection
,
timestamp
)
:
base
(
IpV6MobilityOptionType
.
ReplayProtection
,
timestamp
)
{
{
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6MobilityOptionUnknown.cs
View file @
541b67a5
...
@@ -17,11 +17,19 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -17,11 +17,19 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
sealed
class
IpV6MobilityOptionUnknown
:
IpV6MobilityOptionSingleDataSegmentField
public
sealed
class
IpV6MobilityOptionUnknown
:
IpV6MobilityOptionSingleDataSegmentField
{
{
/// <summary>
/// Creates an instance from type and data.
/// </summary>
/// <param name="type">The type of the option.</param>
/// <param name="data">The data of the option.</param>
public
IpV6MobilityOptionUnknown
(
IpV6MobilityOptionType
type
,
DataSegment
data
)
public
IpV6MobilityOptionUnknown
(
IpV6MobilityOptionType
type
,
DataSegment
data
)
:
base
(
type
,
data
)
:
base
(
type
,
data
)
{
{
}
}
/// <summary>
/// The data of the option.
/// </summary>
public
DataSegment
Data
public
DataSegment
Data
{
{
get
{
return
Value
;
}
get
{
return
Value
;
}
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionComplex.cs
View file @
541b67a5
...
@@ -17,14 +17,17 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -17,14 +17,17 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
abstract
class
IpV6OptionComplex
:
IpV6Option
public
abstract
class
IpV6OptionComplex
:
IpV6Option
{
{
protected
IpV6OptionComplex
(
IpV6OptionType
type
)
/// <summary>
:
base
(
type
)
/// The number of bytes the option takes.
/// </summary>
public
sealed
override
int
Length
{
{
get
{
return
sizeof
(
byte
)
+
sizeof
(
byte
)
+
DataLength
;
}
}
}
public
sealed
override
int
Length
internal
IpV6OptionComplex
(
IpV6OptionType
type
)
:
base
(
type
)
{
{
get
{
return
sizeof
(
byte
)
+
sizeof
(
byte
)
+
DataLength
;
}
}
}
internal
abstract
int
DataLength
{
get
;
}
internal
abstract
int
DataLength
{
get
;
}
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionIlnpNonce.cs
View file @
541b67a5
...
@@ -18,6 +18,10 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -18,6 +18,10 @@ namespace PcapDotNet.Packets.IpV6
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
IlnpNonce
)]
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
IlnpNonce
)]
public
sealed
class
IpV6OptionIlnpNonce
:
IpV6OptionComplex
,
IIpV6OptionComplexFactory
public
sealed
class
IpV6OptionIlnpNonce
:
IpV6OptionComplex
,
IIpV6OptionComplexFactory
{
{
/// <summary>
/// Creates an instance from nonce.
/// </summary>
/// <param name="nonce">An unpredictable cryptographically random value used to prevent off-path attacks on an ILNP session.</param>
public
IpV6OptionIlnpNonce
(
DataSegment
nonce
)
public
IpV6OptionIlnpNonce
(
DataSegment
nonce
)
:
base
(
IpV6OptionType
.
IlnpNonce
)
:
base
(
IpV6OptionType
.
IlnpNonce
)
{
{
...
@@ -29,6 +33,11 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -29,6 +33,11 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
/// </summary>
public
DataSegment
Nonce
{
get
;
private
set
;
}
public
DataSegment
Nonce
{
get
;
private
set
;
}
/// <summary>
/// Parses an option from the given data.
/// </summary>
/// <param name="data">The data to parse.</param>
/// <returns>The option if parsing was successful, null otherwise.</returns>
public
IpV6Option
CreateInstance
(
DataSegment
data
)
public
IpV6Option
CreateInstance
(
DataSegment
data
)
{
{
return
new
IpV6OptionIlnpNonce
(
data
);
return
new
IpV6OptionIlnpNonce
(
data
);
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/IpV6OptionPadN.cs
View file @
541b67a5
...
@@ -18,13 +18,25 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -18,13 +18,25 @@ namespace PcapDotNet.Packets.IpV6
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
PadN
)]
[
IpV6OptionTypeRegistration
(
IpV6OptionType
.
PadN
)]
public
sealed
class
IpV6OptionPadN
:
IpV6OptionComplex
,
IIpV6OptionComplexFactory
public
sealed
class
IpV6OptionPadN
:
IpV6OptionComplex
,
IIpV6OptionComplexFactory
{
{
/// <summary>
/// Creates an option from padding data length.
/// </summary>
/// <param name="paddingDataLength">The size of the padding in bytes.</param>
public
IpV6OptionPadN
(
int
paddingDataLength
)
:
base
(
IpV6OptionType
.
PadN
)
public
IpV6OptionPadN
(
int
paddingDataLength
)
:
base
(
IpV6OptionType
.
PadN
)
{
{
PaddingDataLength
=
paddingDataLength
;
PaddingDataLength
=
paddingDataLength
;
}
}
/// <summary>
/// The size of the padding in bytes.
/// </summary>
public
int
PaddingDataLength
{
get
;
private
set
;
}
public
int
PaddingDataLength
{
get
;
private
set
;
}
/// <summary>
/// Parses an option from the given data.
/// </summary>
/// <param name="data">The data to parse.</param>
/// <returns>The option if parsing was successful, null otherwise.</returns>
public
IpV6Option
CreateInstance
(
DataSegment
data
)
public
IpV6Option
CreateInstance
(
DataSegment
data
)
{
{
return
new
IpV6OptionPadN
(
data
.
Length
);
return
new
IpV6OptionPadN
(
data
.
Length
);
...
...
PcapDotNet/src/PcapDotNet.Packets/IpV6/Options/PppFrameCheckSequenceCalculator.cs
View file @
541b67a5
...
@@ -10,13 +10,16 @@ namespace PcapDotNet.Packets.IpV6
...
@@ -10,13 +10,16 @@ namespace PcapDotNet.Packets.IpV6
private
const
ushort
InitialValue
=
0xffff
;
private
const
ushort
InitialValue
=
0xffff
;
/// <summary>
/// <summary>
/// Calculate FCS16.
/// Calculate
s
FCS16.
/// </summary>
/// </summary>
public
static
ushort
CalculateFcs16
(
IEnumerable
<
byte
>
values
)
public
static
ushort
CalculateFcs16
(
IEnumerable
<
byte
>
values
)
{
{
return
CalculateFcs16
(
InitialValue
,
values
);
return
CalculateFcs16
(
InitialValue
,
values
);
}
}
/// <summary>
/// Calculates FCS16.
/// </summary>
public
static
ushort
CalculateFcs16
(
ushort
fcs
,
IEnumerable
<
byte
>
values
)
public
static
ushort
CalculateFcs16
(
ushort
fcs
,
IEnumerable
<
byte
>
values
)
{
{
foreach
(
byte
value
in
values
)
foreach
(
byte
value
in
values
)
...
...
PcapDotNet/src/PcapDotNet.Packets/Packet.cs
View file @
541b67a5
...
@@ -17,7 +17,7 @@ namespace PcapDotNet.Packets
...
@@ -17,7 +17,7 @@ namespace PcapDotNet.Packets
{
{
/// <summary>
/// <summary>
/// Creates a packet from a string that represents bytes in a hexadecimal format.
/// Creates a packet from a string that represents bytes in a hexadecimal format.
/// <
returns></returns
>
/// <
/summary
>
public
static
Packet
FromHexadecimalString
(
string
value
,
DateTime
timestamp
,
DataLinkKind
dataLink
)
public
static
Packet
FromHexadecimalString
(
string
value
,
DateTime
timestamp
,
DataLinkKind
dataLink
)
{
{
return
FromHexadecimalString
(
value
,
timestamp
,
new
DataLink
(
dataLink
));
return
FromHexadecimalString
(
value
,
timestamp
,
new
DataLink
(
dataLink
));
...
...
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