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
cf2a308f
Commit
cf2a308f
authored
Aug 30, 2014
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code Coverage 95.90%
parent
e7ca3ba5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
246 additions
and
46 deletions
+246
-46
IpV6Tests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/IpV6Tests.cs
+246
-46
No files found.
PcapDotNet/src/PcapDotNet.Packets.Test/IpV6Tests.cs
View file @
cf2a308f
...
@@ -198,7 +198,8 @@ namespace PcapDotNet.Packets.Test
...
@@ -198,7 +198,8 @@ namespace PcapDotNet.Packets.Test
break
;
break
;
case
IpV6MobilityOptionType
.
PermanentHomeKeygenToken
:
case
IpV6MobilityOptionType
.
PermanentHomeKeygenToken
:
IpV6MobilityOptionPermanentHomeKeygenToken
optionPermanentHomeKeygenToken
=
(
IpV6MobilityOptionPermanentHomeKeygenToken
)
option
;
IpV6MobilityOptionPermanentHomeKeygenToken
optionPermanentHomeKeygenToken
=
(
IpV6MobilityOptionPermanentHomeKeygenToken
)
option
;
Assert
.
IsNotNull
(
optionPermanentHomeKeygenToken
.
PermanentHomeKeygenToken
);
Assert
.
IsNotNull
(
optionPermanentHomeKeygenToken
.
PermanentHomeKeygenToken
);
break
;
break
;
...
@@ -1217,14 +1218,14 @@ namespace PcapDotNet.Packets.Test
...
@@ -1217,14 +1218,14 @@ namespace PcapDotNet.Packets.Test
DateTime
.
Now
,
DateTime
.
Now
,
new
EthernetLayer
(),
new
EthernetLayer
(),
new
IpV6Layer
new
IpV6Layer
{
{
ExtensionHeaders
=
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderMobilityBindingError
(
new
IpV6ExtensionHeaderMobilityBindingError
(
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionCareOfTest
(
0
))))
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionCareOfTest
(
0
))))
});
});
Assert
.
IsTrue
(
packet
.
IsValid
);
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
24
+
1
];
--
packet
.
Buffer
[
14
+
40
+
24
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
...
@@ -1238,14 +1239,14 @@ namespace PcapDotNet.Packets.Test
...
@@ -1238,14 +1239,14 @@ namespace PcapDotNet.Packets.Test
DateTime
.
Now
,
DateTime
.
Now
,
new
EthernetLayer
(),
new
EthernetLayer
(),
new
IpV6Layer
new
IpV6Layer
{
{
ExtensionHeaders
=
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderMobilityBindingError
(
new
IpV6ExtensionHeaderMobilityBindingError
(
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionIpV4CareOfAddress
(
IpV4Address
.
Zero
))))
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionIpV4CareOfAddress
(
IpV4Address
.
Zero
))))
});
});
Assert
.
IsTrue
(
packet
.
IsValid
);
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
24
+
1
];
--
packet
.
Buffer
[
14
+
40
+
24
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
...
@@ -1259,14 +1260,14 @@ namespace PcapDotNet.Packets.Test
...
@@ -1259,14 +1260,14 @@ namespace PcapDotNet.Packets.Test
DateTime
.
Now
,
DateTime
.
Now
,
new
EthernetLayer
(),
new
EthernetLayer
(),
new
IpV6Layer
new
IpV6Layer
{
{
ExtensionHeaders
=
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderMobilityBindingError
(
new
IpV6ExtensionHeaderMobilityBindingError
(
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionReplayProtection
(
0
))))
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionReplayProtection
(
0
))))
});
});
Assert
.
IsTrue
(
packet
.
IsValid
);
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
24
+
1
];
--
packet
.
Buffer
[
14
+
40
+
24
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
...
@@ -1280,14 +1281,14 @@ namespace PcapDotNet.Packets.Test
...
@@ -1280,14 +1281,14 @@ namespace PcapDotNet.Packets.Test
DateTime
.
Now
,
DateTime
.
Now
,
new
EthernetLayer
(),
new
EthernetLayer
(),
new
IpV6Layer
new
IpV6Layer
{
{
ExtensionHeaders
=
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderMobilityBindingError
(
new
IpV6ExtensionHeaderMobilityBindingError
(
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionCareOfTestInit
())))
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionCareOfTestInit
())))
});
});
Assert
.
IsTrue
(
packet
.
IsValid
);
Assert
.
IsTrue
(
packet
.
IsValid
);
++
packet
.
Buffer
[
14
+
40
+
24
+
1
];
++
packet
.
Buffer
[
14
+
40
+
24
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
...
@@ -1301,14 +1302,14 @@ namespace PcapDotNet.Packets.Test
...
@@ -1301,14 +1302,14 @@ namespace PcapDotNet.Packets.Test
DateTime
.
Now
,
DateTime
.
Now
,
new
EthernetLayer
(),
new
EthernetLayer
(),
new
IpV6Layer
new
IpV6Layer
{
{
ExtensionHeaders
=
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderMobilityBindingError
(
new
IpV6ExtensionHeaderMobilityBindingError
(
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionAlternateCareOfAddress
(
IpV6Address
.
Zero
))))
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionAlternateCareOfAddress
(
IpV6Address
.
Zero
))))
});
});
Assert
.
IsTrue
(
packet
.
IsValid
);
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
24
+
1
];
--
packet
.
Buffer
[
14
+
40
+
24
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
...
@@ -1322,14 +1323,14 @@ namespace PcapDotNet.Packets.Test
...
@@ -1322,14 +1323,14 @@ namespace PcapDotNet.Packets.Test
DateTime
.
Now
,
DateTime
.
Now
,
new
EthernetLayer
(),
new
EthernetLayer
(),
new
IpV6Layer
new
IpV6Layer
{
{
ExtensionHeaders
=
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderMobilityBindingError
(
new
IpV6ExtensionHeaderMobilityBindingError
(
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionMobileAccessGatewayIpV6Address
(
IpV6Address
.
Zero
))))
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionMobileAccessGatewayIpV6Address
(
IpV6Address
.
Zero
))))
});
});
Assert
.
IsTrue
(
packet
.
IsValid
);
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
24
+
1
];
--
packet
.
Buffer
[
14
+
40
+
24
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
...
@@ -1338,6 +1339,206 @@ namespace PcapDotNet.Packets.Test
...
@@ -1338,6 +1339,206 @@ namespace PcapDotNet.Packets.Test
[
TestMethod
]
[
TestMethod
]
public
void
IpV6MobilityOptionMobileAccessGatewayIpV6AddressWrongAddressLength
()
public
void
IpV6MobilityOptionMobileAccessGatewayIpV6AddressWrongAddressLength
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderMobilityBindingError
(
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionMobileAccessGatewayIpV6Address
(
IpV6Address
.
Zero
))))
});
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
24
+
3
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
public
void
IpV6MobilityOptionHomeNetworkPrefixDataTooShort
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderMobilityBindingError
(
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionHomeNetworkPrefix
(
0
,
IpV6Address
.
Zero
))))
});
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
24
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
public
void
IpV6OptionLineIdentificationDestinationDataTooShort
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderDestinationOptions
(
IpV4Protocol
.
Skip
,
new
IpV6Options
(
new
IpV6OptionLineIdentificationDestination
(
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
IpV6OptionLineIdentificationDestinationWrongLineIdentificationLength
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderDestinationOptions
(
IpV4Protocol
.
Skip
,
new
IpV6Options
(
new
IpV6OptionLineIdentificationDestination
(
DataSegment
.
Empty
))))
});
Assert
.
IsTrue
(
packet
.
IsValid
);
++
packet
.
Buffer
[
14
+
40
+
2
+
2
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
public
void
IpV6OptionEndpointIdentificationDataTooShort
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderDestinationOptions
(
IpV4Protocol
.
Skip
,
new
IpV6Options
(
new
IpV6OptionEndpointIdentification
(
DataSegment
.
Empty
,
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
IpV6OptionEndpointIdentificationWrongSourceLength
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderDestinationOptions
(
IpV4Protocol
.
Skip
,
new
IpV6Options
(
new
IpV6OptionEndpointIdentification
(
DataSegment
.
Empty
,
DataSegment
.
Empty
))))
});
Assert
.
IsTrue
(
packet
.
IsValid
);
++
packet
.
Buffer
[
14
+
40
+
2
+
2
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
public
void
IpV6MobilityOptionFlowSummaryDataTooShort
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderMobilityBindingError
(
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionFlowSummary
(
new
ushort
[
1
]))))
});
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
24
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
public
void
IpV6MobilityOptionBindingIdentifierDataTooShort
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderMobilityBindingError
(
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionBindingIdentifier
(
0
,
IpV6BindingAcknowledgementStatus
.
InsufficientResources
,
false
,
0
))))
});
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
24
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
public
void
IpV6MobilityOptionBindingIdentifierDataBadLength
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderMobilityBindingError
(
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionBindingIdentifier
(
0
,
IpV6BindingAcknowledgementStatus
.
InsufficientResources
,
false
,
0
,
IpV6Address
.
Zero
))))
});
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
24
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
public
void
IpV6MobilityOptionContextRequestDataTooShort
()
{
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
new
EthernetLayer
(),
new
IpV6Layer
{
ExtensionHeaders
=
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderMobilityBindingError
(
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionContextRequest
(
new
IpV6MobilityOptionContextRequestEntry
(
0
,
DataSegment
.
Empty
)))))
});
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
24
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
}
[
TestMethod
]
public
void
IpV6MobilityOptionContextRequestDataTooShortForRequestLength
()
{
{
Packet
packet
=
PacketBuilder
.
Build
(
Packet
packet
=
PacketBuilder
.
Build
(
DateTime
.
Now
,
DateTime
.
Now
,
...
@@ -1348,11 +1549,10 @@ namespace PcapDotNet.Packets.Test
...
@@ -1348,11 +1549,10 @@ namespace PcapDotNet.Packets.Test
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaders
(
new
IpV6ExtensionHeaderMobilityBindingError
(
new
IpV6ExtensionHeaderMobilityBindingError
(
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
IpV4Protocol
.
Skip
,
0
,
IpV6BindingErrorStatus
.
UnrecognizedMhTypeValue
,
IpV6Address
.
Zero
,
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionMobileAccessGatewayIpV6Address
(
IpV6Address
.
Zero
))))
new
IpV6MobilityOptions
(
new
IpV6MobilityOptionContextRequest
(
new
IpV6MobilityOptionContextRequestEntry
(
0
,
new
DataSegment
(
new
byte
[
10
]))))))
});
});
Assert
.
IsTrue
(
packet
.
IsValid
);
Assert
.
IsTrue
(
packet
.
IsValid
);
--
packet
.
Buffer
[
14
+
40
+
24
+
3
];
--
packet
.
Buffer
[
14
+
40
+
24
+
1
];
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Packet
invalidPacket
=
new
Packet
(
packet
.
Buffer
,
DateTime
.
Now
,
DataLinkKind
.
Ethernet
);
Assert
.
IsFalse
(
invalidPacket
.
IsValid
);
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