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
2eef92c2
Commit
2eef92c2
authored
Feb 12, 2010
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ICMP
parent
bab1a144
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
175 additions
and
75 deletions
+175
-75
IcmpTests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/IcmpTests.cs
+77
-56
IcmpAddressMaskReplyDatagram.cs
...c/PcapDotNet.Packets/Icmp/IcmpAddressMaskReplyDatagram.cs
+14
-0
IcmpAddressMaskRequestLayer.cs
...rc/PcapDotNet.Packets/Icmp/IcmpAddressMaskRequestLayer.cs
+2
-2
IcmpDatagram.cs
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpDatagram.cs
+2
-0
IcmpLayer.cs
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpLayer.cs
+7
-2
IcmpRouterAdvertisementDatagram.cs
...capDotNet.Packets/Icmp/IcmpRouterAdvertisementDatagram.cs
+1
-1
IcmpRouterAdvertisementLayer.cs
...c/PcapDotNet.Packets/Icmp/IcmpRouterAdvertisementLayer.cs
+2
-2
IcmpRouterSolicitationDatagram.cs
...PcapDotNet.Packets/Icmp/IcmpRouterSolicitationDatagram.cs
+27
-0
IcmpSourceQuenchDatagram.cs
...t/src/PcapDotNet.Packets/Icmp/IcmpSourceQuenchDatagram.cs
+2
-1
IcmpTimestampLayer.cs
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpTimestampLayer.cs
+2
-2
IcmpTimestampReplyDatagram.cs
...src/PcapDotNet.Packets/Icmp/IcmpTimestampReplyDatagram.cs
+18
-0
IcmpTracerouteLayer.cs
...DotNet/src/PcapDotNet.Packets/Icmp/IcmpTracerouteLayer.cs
+2
-2
IcmpUnknownDatagram.cs
...DotNet/src/PcapDotNet.Packets/Icmp/IcmpUnknownDatagram.cs
+2
-7
IcmpUnknownLayer.cs
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpUnknownLayer.cs
+16
-0
PcapDotNet.Packets.csproj
PcapDotNet/src/PcapDotNet.Packets/PcapDotNet.Packets.csproj
+1
-0
No files found.
PcapDotNet/src/PcapDotNet.Packets.Test/IcmpTests.cs
View file @
2eef92c2
This diff is collapsed.
Click to expand it.
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpAddressMaskReplyDatagram.cs
View file @
2eef92c2
namespace
PcapDotNet.Packets.Icmp
{
/// <summary>
/// RFC 950.
/// <pre>
/// +-----+------+------+-----------------+
/// | Bit | 0-7 | 8-15 | 16-31 |
/// +-----+------+------+-----------------+
/// | 0 | Type | Code | Checksum |
/// +-----+------+------+-----------------+
/// | 32 | Identifier | Sequence Number |
/// +-----+-------------+-----------------+
/// | 64 | Address Mask |
/// +-----+-------------------------------+
/// </pre>
/// </summary>
public
class
IcmpAddressMaskReplyDatagram
:
IcmpAddressMaskRequestDatagram
{
internal
IcmpAddressMaskReplyDatagram
(
byte
[]
buffer
,
int
offset
,
int
length
)
...
...
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpAddressMaskRequestLayer.cs
View file @
2eef92c2
...
...
@@ -11,11 +11,11 @@ namespace PcapDotNet.Packets.Icmp
get
{
return
IcmpMessageType
.
AddressMaskRequest
;
}
}
p
ublic
override
int
Length
p
rotected
override
int
Payload
Length
{
get
{
return
base
.
Length
+
IcmpAddressMaskRequestDatagram
.
PayloadLength
;
return
IcmpAddressMaskRequestDatagram
.
PayloadLength
;
}
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpDatagram.cs
View file @
2eef92c2
...
...
@@ -208,6 +208,8 @@ namespace PcapDotNet.Packets.Icmp
return
new
IcmpSecurityFailuresDatagram
(
buffer
,
offset
,
length
);
case
IcmpMessageType
.
RouterSolicitation
:
return
new
IcmpRouterSolicitationDatagram
(
buffer
,
offset
,
length
);
case
IcmpMessageType
.
DomainNameReply
:
// Domain Name Reply is unsupported
default
:
return
new
IcmpUnknownDatagram
(
buffer
,
offset
,
length
);
...
...
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpLayer.cs
View file @
2eef92c2
...
...
@@ -24,9 +24,14 @@ namespace PcapDotNet.Packets.Icmp
get
{
return
0
;
}
}
public
override
int
Length
public
override
sealed
int
Length
{
get
{
return
IcmpDatagram
.
HeaderLength
;
}
get
{
return
IcmpDatagram
.
HeaderLength
+
PayloadLength
;
}
}
protected
virtual
int
PayloadLength
{
get
{
return
0
;
}
}
protected
override
sealed
void
Write
(
byte
[]
buffer
,
int
offset
)
...
...
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpRouterAdvertisementDatagram.cs
View file @
2eef92c2
...
...
@@ -121,7 +121,7 @@ namespace PcapDotNet.Packets.Icmp
{
}
internal
static
int
Get
HeaderAdditional
Length
(
int
numEntries
)
internal
static
int
Get
Payload
Length
(
int
numEntries
)
{
return
numEntries
*
DefaultAddressEntrySize
*
IpV4Address
.
SizeOf
;
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpRouterAdvertisementLayer.cs
View file @
2eef92c2
...
...
@@ -24,11 +24,11 @@ namespace PcapDotNet.Packets.Icmp
}
}
p
ublic
override
int
Length
p
rotected
override
int
Payload
Length
{
get
{
return
base
.
Length
+
IcmpRouterAdvertisementDatagram
.
GetHeaderAdditional
Length
(
Entries
.
Count
);
return
IcmpRouterAdvertisementDatagram
.
GetPayload
Length
(
Entries
.
Count
);
}
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpRouterSolicitationDatagram.cs
0 → 100644
View file @
2eef92c2
namespace
PcapDotNet.Packets.Icmp
{
/// <summary>
/// RFC 1256.
/// <pre>
/// +-----+------+------+-----------+
/// | Bit | 0-7 | 8-15 | 16-31 |
/// +-----+------+------+-----------+
/// | 0 | Type | Code | Checksum |
/// +-----+------+------+-----------+
/// | 32 | reserved |
/// +-----+-------------------------+
/// </pre>
/// </summary>
public
class
IcmpRouterSolicitationDatagram
:
IcmpDatagram
{
internal
IcmpRouterSolicitationDatagram
(
byte
[]
buffer
,
int
offset
,
int
length
)
:
base
(
buffer
,
offset
,
length
)
{
}
public
override
ILayer
ExtractLayer
()
{
return
new
IcmpRouterSolicitationLayer
();
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpSourceQuenchDatagram.cs
View file @
2eef92c2
using
System
;
namespace
PcapDotNet.Packets.Icmp
{
/// <summary>
...
...
@@ -30,6 +32,5 @@ namespace PcapDotNet.Packets.Icmp
Checksum
=
Checksum
};
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpTimestampLayer.cs
View file @
2eef92c2
...
...
@@ -12,11 +12,11 @@ namespace PcapDotNet.Packets.Icmp
get
{
return
IcmpMessageType
.
Timestamp
;
}
}
p
ublic
override
int
Length
p
rotected
override
int
Payload
Length
{
get
{
return
base
.
Length
+
IcmpTimestampDatagram
.
PayloadLength
;
return
IcmpTimestampDatagram
.
PayloadLength
;
}
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpTimestampReplyDatagram.cs
View file @
2eef92c2
namespace
PcapDotNet.Packets.Icmp
{
/// <summary>
/// RFC 792.
/// <pre>
/// +-----+------+------+-----------------+
/// | Bit | 0-7 | 8-15 | 16-31 |
/// +-----+------+------+-----------------+
/// | 0 | Type | Code | Checksum |
/// +-----+------+------+-----------------+
/// | 32 | Identifier | Sequence Number |
/// +-----+-------------+-----------------+
/// | 64 | Originate Timestamp |
/// +-----+-------------------------------+
/// | 96 | Receive Timestamp |
/// +-----+-------------------------------+
/// | 128 | Transmit Timestamp |
/// +-----+-------------------------------+
/// </pre>
/// </summary>
public
class
IcmpTimestampReplyDatagram
:
IcmpTimestampDatagram
{
internal
IcmpTimestampReplyDatagram
(
byte
[]
buffer
,
int
offset
,
int
length
)
...
...
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpTracerouteLayer.cs
View file @
2eef92c2
...
...
@@ -21,11 +21,11 @@ namespace PcapDotNet.Packets.Icmp
get
{
return
IcmpMessageType
.
Traceroute
;
}
}
p
ublic
override
int
Length
p
rotected
override
int
Payload
Length
{
get
{
return
base
.
Length
+
IcmpTracerouteDatagram
.
PayloadLength
;
return
IcmpTracerouteDatagram
.
PayloadLength
;
}
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpUnknownDatagram.cs
View file @
2eef92c2
...
...
@@ -19,14 +19,9 @@ namespace PcapDotNet.Packets.Icmp
};
}
protected
override
b
yte
MinCodeValue
protected
override
b
ool
CalculateIsValid
()
{
get
{
return
byte
.
MinValue
;
}
}
protected
override
byte
MaxCodeValue
{
get
{
return
byte
.
MaxValue
;
}
return
false
;
}
}
}
\ No newline at end of file
PcapDotNet/src/PcapDotNet.Packets/Icmp/IcmpUnknownLayer.cs
View file @
2eef92c2
...
...
@@ -15,6 +15,22 @@ namespace PcapDotNet.Packets.Icmp
}
}
public
override
byte
CodeValue
{
get
{
return
LayerCode
;
}
}
protected
override
int
PayloadLength
{
get
{
return
Payload
.
Length
;
}
}
protected
override
uint
Value
{
get
{
return
LayerValue
;
}
...
...
PcapDotNet/src/PcapDotNet.Packets/PcapDotNet.Packets.csproj
View file @
2eef92c2
...
...
@@ -99,6 +99,7 @@
<Compile
Include=
"Icmp\IcmpRedirectLayer.cs"
/>
<Compile
Include=
"Icmp\IcmpRouterAdvertisementEntry.cs"
/>
<Compile
Include=
"Icmp\IcmpRouterAdvertisementLayer.cs"
/>
<Compile
Include=
"Icmp\IcmpRouterSolicitationDatagram.cs"
/>
<Compile
Include=
"Icmp\IcmpRouterSolicitationLayer.cs"
/>
<Compile
Include=
"Icmp\IcmpSecurityFailuresLayer.cs"
/>
<Compile
Include=
"Icmp\IcmpSourceQuenchDatagram.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