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
6fb13730
Commit
6fb13730
authored
Nov 23, 2012
by
Brickner_cp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Linux SLL datalink support.
parent
fe133491
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
WiresharkCompareTests.cs
PcapDotNet/src/PcapDotNet.Core.Test/WiresharkCompareTests.cs
+10
-1
PcapDataLink.cpp
PcapDotNet/src/PcapDotNet.Core/PcapDataLink.cpp
+8
-2
DataLinkKind.cs
PcapDotNet/src/PcapDotNet.Packets/DataLinkKind.cs
+5
-0
No files found.
PcapDotNet/src/PcapDotNet.Core.Test/WiresharkCompareTests.cs
View file @
6fb13730
...
...
@@ -172,6 +172,15 @@ namespace PcapDotNet.Core.Test
DateTime
.
Now
,
DataLinkKind
.
IpV4
));
}
[
TestMethod
]
public
void
CompareLinuxSllDataLinkToWiresharkTest
()
{
ComparePacketsToWireshark
(
Packet
.
FromHexadecimalString
(
"000402120000000000000000000008004500003996e1400040118e5a1bfd9042ca209f18140300350025668c10e3010000010000000000000169057974696d67"
,
DateTime
.
Now
,
new
DataLink
(
DataLinkKind
.
LinuxSll
)));
}
[
TestMethod
]
public
void
CompareTcpZeroChecksumToWiresharkTest
()
{
...
...
@@ -525,7 +534,7 @@ namespace PcapDotNet.Core.Test
MoreAssert
.
IsInRange
(
fieldTimestamp
.
AddMilliseconds
(-
1
),
fieldTimestamp
.
AddMilliseconds
(
1
),
packet
.
Timestamp
.
ToUniversalTime
(),
"Timestamp"
);
break
;
case
"frame.len"
:
case
"frame.
cap_
len"
:
field
.
AssertShowDecimal
(
packet
.
Length
);
break
;
}
...
...
PcapDotNet/src/PcapDotNet.Core/PcapDataLink.cpp
View file @
6fb13730
...
...
@@ -55,7 +55,10 @@ DataLinkKind PcapDataLink::Kind::get()
case
DLT_PPP_WITH_DIR
:
return
DataLinkKind
::
PppWithDirection
;
default
:
case
DLT_LINUX_SLL
:
return
DataLinkKind
::
LinuxSll
;
default
:
throw
gcnew
NotSupportedException
(
PcapDataLink
::
typeid
->
Name
+
" "
+
Value
.
ToString
(
CultureInfo
::
InvariantCulture
)
+
" - "
+
ToString
()
+
" is unsupported"
);
}
}
...
...
@@ -152,7 +155,10 @@ int PcapDataLink::KindToValue(DataLinkKind kind)
case
DataLinkKind
:
:
PppWithDirection
:
return
DLT_PPP_WITH_DIR
;
default
:
case
DataLinkKind
:
:
LinuxSll
:
return
DLT_LINUX_SLL
;
default
:
throw
gcnew
NotSupportedException
(
PcapDataLink
::
typeid
->
Name
+
" kind "
+
kind
.
ToString
()
+
" is unsupported"
);
}
}
PcapDotNet/src/PcapDotNet.Packets/DataLinkKind.cs
View file @
6fb13730
...
...
@@ -27,5 +27,10 @@ namespace PcapDotNet.Packets
/// and a non-zero value meaning "sent by this host".
/// </summary>
PppWithDirection
,
/// <summary>
/// Linux cooked-mode capture.
/// </summary>
LinuxSll
,
}
}
\ No newline at end of file
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