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
a156a551
Commit
a156a551
authored
Aug 02, 2014
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IPv6
Code Coverage 95.17%
parent
27c3ee0f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
9 deletions
+36
-9
WiresharkDatagramComparerIpV6MobilityHeader.cs
....Core.Test/WiresharkDatagramComparerIpV6MobilityHeader.cs
+1
-0
IpV6Tests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/IpV6Tests.cs
+35
-9
No files found.
PcapDotNet/src/PcapDotNet.Core.Test/WiresharkDatagramComparerIpV6MobilityHeader.cs
View file @
a156a551
...
...
@@ -106,6 +106,7 @@ namespace PcapDotNet.Core.Test
protocol
==
IpV4Protocol
.
InternetReliableTransactionProtocol
||
protocol
==
IpV4Protocol
.
MeritInternodalProtocol
||
protocol
==
IpV4Protocol
.
Skip
||
protocol
==
IpV4Protocol
.
Bna
||
protocol
==
IpV4Protocol
.
RemoteVirtualDiskProtocol
))
return
false
;
...
...
PcapDotNet/src/PcapDotNet.Packets.Test/IpV6Tests.cs
View file @
a156a551
...
...
@@ -85,6 +85,20 @@ namespace PcapDotNet.Packets.Test
Assert
.
AreEqual
(
string
.
Format
(
"{0} -> {1} ({2})"
,
ipV6Layer
.
Source
,
ipV6Layer
.
CurrentDestination
,
ipV6Layer
.
NextHeader
),
ipV6Layer
.
ToString
());
foreach
(
IpV6ExtensionHeader
extensionHeader
in
packet
.
Ethernet
.
IpV6
.
ExtensionHeaders
)
{
IpV6ExtensionHeaderOptions
extensionHeaderOptions
=
extensionHeader
as
IpV6ExtensionHeaderOptions
;
if
(
extensionHeaderOptions
!=
null
)
{
foreach
(
IpV6Option
option
in
extensionHeaderOptions
.
Options
)
{
switch
(
option
.
OptionType
)
{
case
IpV6OptionType
.
SmfDpd
:
IpV6OptionSmfDpd
optionSmfDpd
=
(
IpV6OptionSmfDpd
)
option
;
Assert
.
AreEqual
(
optionSmfDpd
is
IpV6OptionSmfDpdSequenceHashAssistValue
,
optionSmfDpd
.
HashIndicator
);
break
;
}
}
}
IpV6ExtensionHeaderMobility
extensionHeaderMobility
=
extensionHeader
as
IpV6ExtensionHeaderMobility
;
if
(
extensionHeaderMobility
!=
null
)
{
...
...
@@ -152,15 +166,6 @@ namespace PcapDotNet.Packets.Test
}
}
}
/*
if (packet.Ethernet.IpV6.NextHeader == IpV4Protocol.Tcp)
Assert.IsInstanceOfType(packet.Ethernet.IpV6.Transport, typeof(TcpDatagram));
else if (packet.Ethernet.IpV6.NextHeader == IpV4Protocol.Udp)
Assert.IsInstanceOfType(packet.Ethernet.IpV6.Transport, typeof(UdpDatagram));
else
Assert.IsNull(packet.Ethernet.IpV6.Transport);
*/
// Assert.AreEqual(payloadLayer.Data, packet.Ethernet.IpV6.Payload, "IP Payload");
}
}
...
...
@@ -425,5 +430,26 @@ namespace PcapDotNet.Packets.Test
{
Assert
.
IsNull
(
new
IpV6OptionSmfDpdDefault
(
DataSegment
.
Empty
,
DataSegment
.
Empty
));
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentOutOfRangeException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6MobilityOptionMobileNodeIdentifierIdentifierTooShort
()
{
Assert
.
IsNull
(
new
IpV6MobilityOptionMobileNodeIdentifier
(
IpV6MobileNodeIdentifierSubtype
.
NetworkAccessIdentifier
,
DataSegment
.
Empty
));
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentOutOfRangeException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6MobilityOptionContextRequestEntryOptionLengthTooBig
()
{
Assert
.
IsNull
(
new
IpV6MobilityOptionContextRequestEntry
(
0
,
new
DataSegment
(
new
byte
[
256
])));
}
[
TestMethod
]
[
ExpectedException
(
typeof
(
ArgumentOutOfRangeException
),
AllowDerivedTypes
=
false
)]
public
void
IpV6MobilityOptionBindingIdentifierPriorityTooBig
()
{
Assert
.
IsNull
(
new
IpV6MobilityOptionBindingIdentifier
(
0
,
IpV6BindingAcknowledgementStatus
.
AcceptedBut
,
false
,
0x80
));
}
}
}
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