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
b1f027ad
Commit
b1f027ad
authored
Apr 23, 2010
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GRE
parent
44e35af5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
GreTests.cs
PcapDotNet/src/PcapDotNet.Packets.Test/GreTests.cs
+6
-0
RandomPacketsExtensions.cs
...c/PcapDotNet.Packets.TestUtils/RandomPacketsExtensions.cs
+4
-4
GreDatagram.cs
PcapDotNet/src/PcapDotNet.Packets/Gre/GreDatagram.cs
+2
-2
No files found.
PcapDotNet/src/PcapDotNet.Packets.Test/GreTests.cs
View file @
b1f027ad
...
...
@@ -99,6 +99,12 @@ namespace PcapDotNet.Packets.Test
greLayer
.
Checksum
=
actualGre
.
Checksum
;
}
Assert
.
AreEqual
(
greLayer
,
actualGreLayer
,
"Layer"
);
Assert
.
AreEqual
(
greLayer
.
Length
,
actualGre
.
HeaderLength
);
Assert
.
IsTrue
(
actualGre
.
KeyPresent
^
(
greLayer
.
Key
==
null
));
MoreAssert
.
IsSmaller
(
8
,
actualGre
.
RecursionControl
);
Assert
.
IsTrue
(
actualGre
.
RoutingPresent
^
(
greLayer
.
Routing
==
null
&&
greLayer
.
RoutingOffset
==
null
));
Assert
.
IsTrue
(
actualGre
.
SequenceNumberPresent
^
(
greLayer
.
SequenceNumber
==
null
));
Assert
.
IsTrue
(!
actualGre
.
StrictSourceRoute
||
actualGre
.
RoutingPresent
);
}
}
}
...
...
PcapDotNet/src/PcapDotNet.Packets.TestUtils/RandomPacketsExtensions.cs
View file @
b1f027ad
...
...
@@ -600,19 +600,19 @@ namespace PcapDotNet.Packets.TestUtils
{
case
GreSourceRouteEntryAddressFamily
.
AsSourceRoute
:
{
ushort
[]
asNumbers
=
new
ushort
[
random
.
Next
(
5
)];
ushort
[]
asNumbers
=
new
ushort
[
random
.
Next
(
1
,
5
)];
for
(
int
j
=
0
;
j
!=
asNumbers
.
Length
;
++
j
)
asNumbers
[
j
]
=
random
.
NextUShort
();
routing
[
i
]
=
new
GreSourceRouteEntryAs
(
asNumbers
.
AsReadOnly
(),
asNumbers
.
IsEmpty
()
?
0
:
random
.
Next
(
asNumbers
.
Length
));
routing
[
i
]
=
new
GreSourceRouteEntryAs
(
asNumbers
.
AsReadOnly
(),
random
.
Next
(
asNumbers
.
Length
+
1
));
break
;
}
case
GreSourceRouteEntryAddressFamily
.
IpSourceRoute
:
{
IpV4Address
[]
ips
=
new
IpV4Address
[
random
.
Next
(
5
)];
IpV4Address
[]
ips
=
new
IpV4Address
[
random
.
Next
(
1
,
5
)];
for
(
int
j
=
0
;
j
!=
ips
.
Length
;
++
j
)
ips
[
j
]
=
random
.
NextIpV4Address
();
routing
[
i
]
=
new
GreSourceRouteEntryIp
(
ips
.
AsReadOnly
(),
ips
.
IsEmpty
()
?
0
:
random
.
Next
(
ips
.
Length
));
routing
[
i
]
=
new
GreSourceRouteEntryIp
(
ips
.
AsReadOnly
(),
random
.
Next
(
ips
.
Length
+
1
));
break
;
}
...
...
PcapDotNet/src/PcapDotNet.Packets/Gre/GreDatagram.cs
View file @
b1f027ad
...
...
@@ -400,7 +400,7 @@ namespace PcapDotNet.Packets.Gre
return
false
;
// Address Family
GreSourceRouteEntryAddressFamily
addressFamily
=
(
GreSourceRouteEntryAddressFamily
)
buffer
.
ReadUShort
(
offset
,
Endianity
.
Big
);
GreSourceRouteEntryAddressFamily
addressFamily
=
(
GreSourceRouteEntryAddressFamily
)
buffer
.
ReadUShort
(
offset
+
Offset
.
AddressFamily
,
Endianity
.
Big
);
// SRE Length
byte
sreLength
=
buffer
[
offset
+
Offset
.
SreLength
];
...
...
@@ -420,7 +420,7 @@ namespace PcapDotNet.Packets.Gre
return
false
;
// Change offset
offset
+=
sre
Length
;
offset
+=
entry
.
Length
;
return
true
;
}
...
...
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