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
8cce3bb8
Commit
8cce3bb8
authored
Aug 30, 2014
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IPv6
Code Coverage 96.13%
parent
5b1f8c19
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
135 additions
and
0 deletions
+135
-0
WiresharkDatagramComparerIpV6MobilityHeader.cs
....Core.Test/WiresharkDatagramComparerIpV6MobilityHeader.cs
+1
-0
IpV6Tests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/IpV6Tests.cs
+134
-0
No files found.
PcapDotNet/src/PcapDotNet.Core.Test/WiresharkDatagramComparerIpV6MobilityHeader.cs
View file @
8cce3bb8
...
...
@@ -112,6 +112,7 @@ namespace PcapDotNet.Core.Test
protocol
==
IpV4Protocol
.
SpectraLinkRadioProtocol
||
protocol
==
IpV4Protocol
.
MobileAdHocNetwork
||
protocol
==
IpV4Protocol
.
DissimilarGatewayProtocol
||
protocol
==
IpV4Protocol
.
SpriteRpc
||
protocol
==
IpV4Protocol
.
Shim6
||
// TODO: Implement Shim6.
protocol
==
IpV4Protocol
.
RemoteVirtualDiskProtocol
))
return
false
;
...
...
PcapDotNet/src/PcapDotNet.Packets.Test/IpV6Tests.cs
View file @
8cce3bb8
...
...
@@ -2239,5 +2239,139 @@ namespace PcapDotNet.Packets.Test
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
public
void
IpV6OptionHomeAddressDataTooShort
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderDestinationOptions
(
IpV4Protocol
.
Skip
,
new
IpV6Options
(
new
IpV6OptionHomeAddress
(
IpV6Address
.
Zero
))))
});
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
2
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
public
void
IpV6OptionJumboPayloadDataTooShort
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderDestinationOptions
(
IpV4Protocol
.
Skip
,
new
IpV6Options
(
new
IpV6OptionJumboPayload
(
0
))))
});
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
2
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
public
void
IpV6OptionQuickStartDataTooShort
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderDestinationOptions
(
IpV4Protocol
.
Skip
,
new
IpV6Options
(
new
IpV6OptionQuickStart
(
IpV4OptionQuickStartFunction
.
RateRequest
,
0
,
0
,
0
))))
});
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
2
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
public
void
IpV6OptionRouterAlertDataTooShort
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderDestinationOptions
(
IpV4Protocol
.
Skip
,
new
IpV6Options
(
new
IpV6OptionRouterAlert
(
IpV6RouterAlertType
.
Rsvp
))))
});
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
2
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
public
void
IpV6OptionRoutingProtocolLowPowerAndLossyNetworksDataTooShort
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderDestinationOptions
(
IpV4Protocol
.
Skip
,
new
IpV6Options
(
new
IpV6OptionRoutingProtocolLowPowerAndLossyNetworks
(
false
,
false
,
false
,
0
,
0
,
DataSegment
.
Empty
))))
});
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
2
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
public
void
IpV6OptionTunnelEncapsulationLimitDataTooShort
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderDestinationOptions
(
IpV4Protocol
.
Skip
,
new
IpV6Options
(
new
IpV6OptionTunnelEncapsulationLimit
(
0
))))
});
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
2
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
public
void
IpV6OptionSmfDpdSequenceHashAssistValueDataTooShort
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderDestinationOptions
(
IpV4Protocol
.
Skip
,
new
IpV6Options
(
new
IpV6OptionSmfDpdSequenceHashAssistValue
(
new
DataSegment
(
new
byte
[
1
])))))
});
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
2
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
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