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
4a21e82c
Commit
4a21e82c
authored
May 19, 2010
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved GRE comparison to Wireshark
parent
e5864da8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
9 deletions
+19
-9
LivePacketDeviceTests.cs
PcapDotNet/src/PcapDotNet.Core.Test/LivePacketDeviceTests.cs
+1
-1
WiresharkCompareTests.cs
PcapDotNet/src/PcapDotNet.Core.Test/WiresharkCompareTests.cs
+12
-2
XElementExtensions.cs
PcapDotNet/src/PcapDotNet.Core.Test/XElementExtensions.cs
+6
-6
No files found.
PcapDotNet/src/PcapDotNet.Core.Test/LivePacketDeviceTests.cs
View file @
4a21e82c
...
@@ -284,7 +284,7 @@ namespace PcapDotNet.Core.Test
...
@@ -284,7 +284,7 @@ namespace PcapDotNet.Core.Test
// Normal
// Normal
TestGetStatistics
(
SourceMac
,
DestinationMac
,
NumPacketsToSend
,
NumStatisticsToGather
,
int
.
MaxValue
,
5
,
PacketSize
,
TestGetStatistics
(
SourceMac
,
DestinationMac
,
NumPacketsToSend
,
NumStatisticsToGather
,
int
.
MaxValue
,
5
,
PacketSize
,
PacketCommunicatorReceiveResult
.
Ok
,
NumStatisticsToGather
,
NumPacketsToSend
,
NumStatisticsToGather
,
NumStatisticsToGather
+
0.
05
);
PacketCommunicatorReceiveResult
.
Ok
,
NumStatisticsToGather
,
NumPacketsToSend
,
NumStatisticsToGather
,
NumStatisticsToGather
+
0.
16
);
// Wait for less statistics
// Wait for less statistics
TestGetStatistics
(
SourceMac
,
DestinationMac
,
NumPacketsToSend
,
NumStatisticsToGather
/
2
,
int
.
MaxValue
,
5
,
PacketSize
,
TestGetStatistics
(
SourceMac
,
DestinationMac
,
NumPacketsToSend
,
NumStatisticsToGather
/
2
,
int
.
MaxValue
,
5
,
PacketSize
,
...
...
PcapDotNet/src/PcapDotNet.Core.Test/WiresharkCompareTests.cs
View file @
4a21e82c
...
@@ -987,11 +987,21 @@ namespace PcapDotNet.Core.Test
...
@@ -987,11 +987,21 @@ namespace PcapDotNet.Core.Test
case
"data"
:
case
"data"
:
case
"data.data"
:
case
"data.data"
:
field
.
AssertValue
(
greDatagram
.
Payload
);
if
(
greDatagram
.
Version
!=
GreVersion
.
EnhancedGre
&&
greDatagram
.
AcknowledgmentSequenceNumberPresent
)
{
Assert
.
AreEqual
(
field
.
Value
().
Skip
(
8
).
SequenceToString
(),
greDatagram
.
Payload
.
BytesSequenceToHexadecimalString
(),
"GRE data.data"
);
}
else
field
.
AssertValue
(
greDatagram
.
Payload
,
"GRE data.data"
);
break
;
break
;
case
"data.len"
:
case
"data.len"
:
field
.
AssertShowDecimal
(
greDatagram
.
Payload
.
Length
);
field
.
AssertShowDecimal
(
greDatagram
.
Payload
.
Length
+
(
greDatagram
.
Version
!=
GreVersion
.
EnhancedGre
&&
greDatagram
.
AcknowledgmentSequenceNumberPresent
?
4
:
0
),
"GRE data.len"
);
break
;
break
;
default
:
default
:
...
...
PcapDotNet/src/PcapDotNet.Core.Test/XElementExtensions.cs
View file @
4a21e82c
...
@@ -47,9 +47,9 @@ namespace PcapDotNet.Core.Test
...
@@ -47,9 +47,9 @@ namespace PcapDotNet.Core.Test
Assert
.
AreEqual
(
element
.
Name
(),
expectedName
);
Assert
.
AreEqual
(
element
.
Name
(),
expectedName
);
}
}
public
static
void
AssertShow
(
this
XElement
element
,
string
expectedValue
)
public
static
void
AssertShow
(
this
XElement
element
,
string
expectedValue
,
string
message
=
null
)
{
{
Assert
.
AreEqual
(
expectedValue
,
element
.
Show
(),
element
.
Name
());
Assert
.
AreEqual
(
expectedValue
,
element
.
Show
(),
message
??
element
.
Name
());
}
}
public
static
void
AssertShow
(
this
XElement
element
,
IEnumerable
<
byte
>
expectedValue
)
public
static
void
AssertShow
(
this
XElement
element
,
IEnumerable
<
byte
>
expectedValue
)
...
@@ -77,9 +77,9 @@ namespace PcapDotNet.Core.Test
...
@@ -77,9 +77,9 @@ namespace PcapDotNet.Core.Test
element
.
AssertShow
(
expectedValue
.
ToString
());
element
.
AssertShow
(
expectedValue
.
ToString
());
}
}
public
static
void
AssertShowDecimal
(
this
XElement
element
,
int
expectedValue
)
public
static
void
AssertShowDecimal
(
this
XElement
element
,
int
expectedValue
,
string
message
=
null
)
{
{
element
.
AssertShow
(
expectedValue
.
ToString
());
element
.
AssertShow
(
expectedValue
.
ToString
()
,
message
);
}
}
public
static
void
AssertShowDecimal
(
this
XElement
element
,
uint
expectedValue
)
public
static
void
AssertShowDecimal
(
this
XElement
element
,
uint
expectedValue
)
...
@@ -137,9 +137,9 @@ namespace PcapDotNet.Core.Test
...
@@ -137,9 +137,9 @@ namespace PcapDotNet.Core.Test
Assert
.
AreEqual
(
element
.
Value
(),
expectedValue
,
message
??
element
.
Name
());
Assert
.
AreEqual
(
element
.
Value
(),
expectedValue
,
message
??
element
.
Name
());
}
}
public
static
void
AssertValue
(
this
XElement
element
,
IEnumerable
<
byte
>
expectedValue
)
public
static
void
AssertValue
(
this
XElement
element
,
IEnumerable
<
byte
>
expectedValue
,
string
message
=
null
)
{
{
element
.
AssertValue
(
expectedValue
.
BytesSequenceToHexadecimalString
());
element
.
AssertValue
(
expectedValue
.
BytesSequenceToHexadecimalString
()
,
message
);
}
}
public
static
void
AssertValue
(
this
XElement
element
,
byte
expectedValue
)
public
static
void
AssertValue
(
this
XElement
element
,
byte
expectedValue
)
...
...
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