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
44f22cf6
Commit
44f22cf6
authored
Feb 06, 2015
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wireshark 1.12.3
parent
5c6a0eb2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
107 additions
and
17 deletions
+107
-17
WiresharkDatagramComparerDns.cs
.../src/PcapDotNet.Core.Test/WiresharkDatagramComparerDns.cs
+5
-4
WiresharkDatagramComparerIpV6MobilityHeader.cs
....Core.Test/WiresharkDatagramComparerIpV6MobilityHeader.cs
+100
-13
WiresharkDatagramComparerTcp.cs
.../src/PcapDotNet.Core.Test/WiresharkDatagramComparerTcp.cs
+2
-0
No files found.
PcapDotNet/src/PcapDotNet.Core.Test/WiresharkDatagramComparerDns.cs
View file @
44f22cf6
...
@@ -178,14 +178,12 @@ namespace PcapDotNet.Core.Test
...
@@ -178,14 +178,12 @@ namespace PcapDotNet.Core.Test
break
;
break
;
case
"dns.qry.name.len"
:
case
"dns.qry.name.len"
:
// TODO: Remove the IsRoot condition when https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=10674 is fixed.
resourceRecordAttributeField
.
AssertShowDecimal
(
resourceRecord
.
DomainName
.
IsRoot
?
0
:
resourceRecord
.
DomainName
.
NonCompressedLength
-
2
);
resourceRecordAttributeField
.
AssertShowDecimal
(
resourceRecord
.
DomainName
.
IsRoot
?
6
:
resourceRecord
.
DomainName
.
NonCompressedLength
-
2
);
resourceRecordAttributeField
.
AssertNoFields
();
resourceRecordAttributeField
.
AssertNoFields
();
break
;
break
;
case
"dns.count.labels"
:
case
"dns.count.labels"
:
// TODO: Remove the IsRoot condition when https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=10674 is fixed.
resourceRecordAttributeField
.
AssertShowDecimal
(
resourceRecord
.
DomainName
.
LabelsCount
);
resourceRecordAttributeField
.
AssertShowDecimal
(
resourceRecord
.
DomainName
.
IsRoot
?
1
:
resourceRecord
.
DomainName
.
LabelsCount
);
resourceRecordAttributeField
.
AssertNoFields
();
resourceRecordAttributeField
.
AssertNoFields
();
break
;
break
;
...
@@ -1122,7 +1120,10 @@ namespace PcapDotNet.Core.Test
...
@@ -1122,7 +1120,10 @@ namespace PcapDotNet.Core.Test
break
;
break
;
case
"dns.apl.afdpart.data"
:
case
"dns.apl.afdpart.data"
:
case
"dns.apl.afdpart.ipv4"
:
case
"dns.apl.afdpart.ipv6"
:
case
"dns.apl.afdpart.ipv6"
:
if
(
dataFieldName
!=
"dns.apl.afdpart.data"
)
Assert
.
AreEqual
(
AddressFamily
.
IpV4
,
aplData
.
Items
[
_aplItemIndex
-
1
].
AddressFamily
);
dataField
.
AssertValue
(
aplData
.
Items
[
_aplItemIndex
-
1
].
AddressFamilyDependentPart
);
dataField
.
AssertValue
(
aplData
.
Items
[
_aplItemIndex
-
1
].
AddressFamilyDependentPart
);
break
;
break
;
...
...
PcapDotNet/src/PcapDotNet.Core.Test/WiresharkDatagramComparerIpV6MobilityHeader.cs
View file @
44f22cf6
...
@@ -151,6 +151,11 @@ namespace PcapDotNet.Core.Test
...
@@ -151,6 +151,11 @@ namespace PcapDotNet.Core.Test
field
.
AssertShowDecimal
(
mobilityHeader
.
Checksum
);
field
.
AssertShowDecimal
(
mobilityHeader
.
Checksum
);
break
;
break
;
case
"mip6.em.data"
:
IpV6ExtensionHeaderMobilityExperimental
experimentalHeader
=
(
IpV6ExtensionHeaderMobilityExperimental
)
mobilityHeader
;
field
.
AssertValue
(
experimentalHeader
.
MessageData
);
break
;
case
""
:
case
""
:
switch
(
field
.
Show
())
switch
(
field
.
Show
())
{
{
...
@@ -1253,9 +1258,12 @@ namespace PcapDotNet.Core.Test
...
@@ -1253,9 +1258,12 @@ namespace PcapDotNet.Core.Test
optionSubfield
.
AssertShowDecimal
(
ipV6AddressPrefix
.
PrefixLength
);
optionSubfield
.
AssertShowDecimal
(
ipV6AddressPrefix
.
PrefixLength
);
break
;
break
;
case
""
:
case
"mip6.mhipv6ap.ipv6_address"
:
optionSubfield
.
AssertShow
(
"IPv6 Address/Prefix"
);
optionSubfield
.
AssertValue
(
ipV6AddressPrefix
.
AddressOrPrefix
.
ToValue
());
// TODO: Compare the AddressPrefix property after https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=10576 is fixed.
break
;
case
"mip6.mhipv6ap.ipv6_address_prefix"
:
Assert
.
IsTrue
(
optionSubfield
.
Value
().
EndsWith
(
ipV6AddressPrefix
.
AddressOrPrefix
.
ToValue
().
ToString
(
"x32"
)));
break
;
break
;
default
:
default
:
...
@@ -1383,6 +1391,9 @@ namespace PcapDotNet.Core.Test
...
@@ -1383,6 +1391,9 @@ namespace PcapDotNet.Core.Test
case
IpV6MobilityOptionType
.
AccessNetworkIdentifier
:
case
IpV6MobilityOptionType
.
AccessNetworkIdentifier
:
foreach
(
XElement
optionSubfield
in
optionField
.
Fields
())
foreach
(
XElement
optionSubfield
in
optionField
.
Fields
())
{
{
if
(
HandleCommonMobilityOptionSubfield
(
optionSubfield
,
option
))
continue
;
switch
(
optionSubfield
.
Name
())
switch
(
optionSubfield
.
Name
())
{
{
case
"_ws.expert"
:
case
"_ws.expert"
:
...
@@ -1462,6 +1473,14 @@ namespace PcapDotNet.Core.Test
...
@@ -1462,6 +1473,14 @@ namespace PcapDotNet.Core.Test
optionSubfield
.
AssertShowDecimal
(
0
);
optionSubfield
.
AssertShowDecimal
(
0
);
break
;
break
;
case
"mip6.redir.addr_r2lma_ipv4"
:
optionSubfield
.
AssertShow
(
redirect
.
LocalMobilityAddressIpV4
.
ToString
());
break
;
case
"mip6.redir.addr_r2lma_ipv6"
:
optionSubfield
.
AssertValue
(
redirect
.
LocalMobilityAddressIpV6
.
Value
.
ToValue
());
break
;
default
:
default
:
throw
new
InvalidOperationException
(
string
.
Format
(
"Invalid IPv6 Mobility option subfield {0}"
,
throw
new
InvalidOperationException
(
string
.
Format
(
"Invalid IPv6 Mobility option subfield {0}"
,
optionSubfield
.
Name
()));
optionSubfield
.
Name
()));
...
@@ -1774,8 +1793,21 @@ namespace PcapDotNet.Core.Test
...
@@ -1774,8 +1793,21 @@ namespace PcapDotNet.Core.Test
case
IpV6MobilityOptionType
.
TransientBinding
:
case
IpV6MobilityOptionType
.
TransientBinding
:
optionField
.
AssertShow
(
"Transient Binding(2 bytes)"
);
optionField
.
AssertShow
(
"Transient Binding(2 bytes)"
);
optionField
.
AssertNumFields
(
1
);
foreach
(
XElement
optionSubfield
in
optionField
.
Fields
())
optionField
.
Fields
().
First
().
AssertName
(
"_ws.expert"
);
{
if
(
HandleCommonMobilityOptionSubfield
(
optionSubfield
,
option
))
continue
;
switch
(
optionSubfield
.
Name
())
{
case
"_ws.expert"
:
break
;
default
:
throw
new
InvalidOperationException
(
string
.
Format
(
"Invalid IPv6 Mobility option subfield {0}"
,
optionSubfield
.
Name
()));
}
}
break
;
break
;
case
IpV6MobilityOptionType
.
Timestamp
:
case
IpV6MobilityOptionType
.
Timestamp
:
...
@@ -1844,8 +1876,21 @@ namespace PcapDotNet.Core.Test
...
@@ -1844,8 +1876,21 @@ namespace PcapDotNet.Core.Test
case
IpV6MobilityOptionType
.
FlowIdentification
:
case
IpV6MobilityOptionType
.
FlowIdentification
:
optionField
.
AssertShow
(
"Flow Identification("
+
(
option
.
Length
-
2
)
+
" bytes)"
);
optionField
.
AssertShow
(
"Flow Identification("
+
(
option
.
Length
-
2
)
+
" bytes)"
);
optionField
.
AssertNumFields
(
1
);
foreach
(
XElement
optionSubfield
in
optionField
.
Fields
())
optionField
.
Fields
().
First
().
AssertName
(
"_ws.expert"
);
{
if
(
HandleCommonMobilityOptionSubfield
(
optionSubfield
,
option
))
continue
;
switch
(
optionSubfield
.
Name
())
{
case
"_ws.expert"
:
break
;
default
:
throw
new
InvalidOperationException
(
string
.
Format
(
"Invalid IPv6 Mobility option subfield {0}"
,
optionSubfield
.
Name
()));
}
}
break
;
break
;
case
IpV6MobilityOptionType
.
NatDetection
:
case
IpV6MobilityOptionType
.
NatDetection
:
...
@@ -1880,8 +1925,21 @@ namespace PcapDotNet.Core.Test
...
@@ -1880,8 +1925,21 @@ namespace PcapDotNet.Core.Test
case
IpV6MobilityOptionType
.
FlowSummary
:
case
IpV6MobilityOptionType
.
FlowSummary
:
optionField
.
AssertShow
(
"Flow Summary("
+
(
option
.
Length
-
2
)
+
" bytes)"
);
optionField
.
AssertShow
(
"Flow Summary("
+
(
option
.
Length
-
2
)
+
" bytes)"
);
optionField
.
AssertNumFields
(
1
);
foreach
(
XElement
optionSubfield
in
optionField
.
Fields
())
optionField
.
Fields
().
First
().
AssertName
(
"_ws.expert"
);
{
if
(
HandleCommonMobilityOptionSubfield
(
optionSubfield
,
option
))
continue
;
switch
(
optionSubfield
.
Name
())
{
case
"_ws.expert"
:
break
;
default
:
throw
new
InvalidOperationException
(
string
.
Format
(
"Invalid IPv6 Mobility option subfield {0}"
,
optionSubfield
.
Name
()));
}
}
break
;
break
;
case
IpV6MobilityOptionType
.
Experimental
:
case
IpV6MobilityOptionType
.
Experimental
:
...
@@ -1910,8 +1968,23 @@ namespace PcapDotNet.Core.Test
...
@@ -1910,8 +1968,23 @@ namespace PcapDotNet.Core.Test
case
IpV6MobilityOptionType
.
MobileAccessGatewayIpV6Address
:
case
IpV6MobilityOptionType
.
MobileAccessGatewayIpV6Address
:
optionField
.
AssertShow
(
"MAG IPv6 Address(18 bytes)"
);
optionField
.
AssertShow
(
"MAG IPv6 Address(18 bytes)"
);
optionField
.
AssertNumFields
(
1
);
optionField
.
Fields
().
First
().
AssertName
(
"_ws.expert"
);
// TODO: Dedup this code.
foreach
(
XElement
optionSubfield
in
optionField
.
Fields
())
{
if
(
HandleCommonMobilityOptionSubfield
(
optionSubfield
,
option
))
continue
;
switch
(
optionSubfield
.
Name
())
{
case
"_ws.expert"
:
break
;
default
:
throw
new
InvalidOperationException
(
string
.
Format
(
"Invalid IPv6 Mobility option subfield {0}"
,
optionSubfield
.
Name
()));
}
}
break
;
break
;
case
IpV6MobilityOptionType
.
CareOfTestInit
:
case
IpV6MobilityOptionType
.
CareOfTestInit
:
...
@@ -1932,8 +2005,22 @@ namespace PcapDotNet.Core.Test
...
@@ -1932,8 +2005,22 @@ namespace PcapDotNet.Core.Test
case
IpV6MobilityOptionType
.
MobileNodeLinkLocalAddressInterfaceIdentifier
:
case
IpV6MobilityOptionType
.
MobileNodeLinkLocalAddressInterfaceIdentifier
:
optionField
.
AssertShow
(
"Mobile Node Link-local Address Interface Identifier(10 bytes)"
);
optionField
.
AssertShow
(
"Mobile Node Link-local Address Interface Identifier(10 bytes)"
);
optionField
.
AssertNumFields
(
1
);
optionField
.
Fields
().
First
().
AssertName
(
"_ws.expert"
);
foreach
(
XElement
optionSubfield
in
optionField
.
Fields
())
{
if
(
HandleCommonMobilityOptionSubfield
(
optionSubfield
,
option
))
continue
;
switch
(
optionSubfield
.
Name
())
{
case
"_ws.expert"
:
break
;
default
:
throw
new
InvalidOperationException
(
string
.
Format
(
"Invalid IPv6 Mobility option subfield {0}"
,
optionSubfield
.
Name
()));
}
}
break
;
break
;
case
IpV6MobilityOptionType
.
AlternateCareOfAddress
:
case
IpV6MobilityOptionType
.
AlternateCareOfAddress
:
...
...
PcapDotNet/src/PcapDotNet.Core.Test/WiresharkDatagramComparerTcp.cs
View file @
44f22cf6
...
@@ -256,6 +256,8 @@ namespace PcapDotNet.Core.Test
...
@@ -256,6 +256,8 @@ namespace PcapDotNet.Core.Test
int
currentOptionIndex
=
0
;
int
currentOptionIndex
=
0
;
foreach
(
var
field
in
element
.
Fields
())
foreach
(
var
field
in
element
.
Fields
())
{
{
if
(
field
.
Name
()
==
"_ws.expert"
)
continue
;
if
(
currentOptionIndex
>=
options
.
Count
)
if
(
currentOptionIndex
>=
options
.
Count
)
{
{
Assert
.
IsFalse
(
options
.
IsValid
,
"Options IsValid"
);
Assert
.
IsFalse
(
options
.
IsValid
,
"Options IsValid"
);
...
...
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