Commit 6fb13730 authored by Brickner_cp's avatar Brickner_cp

Linux SLL datalink support.

parent fe133491
......@@ -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;
}
......
......@@ -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");
}
}
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment