0
我按照這個教程PcapDotNet/Pcap.Net。但我會盡力建立一個像這樣的圖片Ethernet frame。如何構建一個沒有任何protocole Pcap.net c#的以太網數據包?
private static Packet BuildEthernetPacket()
{
EthernetLayer ethernetLayer =
new EthernetLayer
{
Destination = new MacAddress("00:00:00:00:00:00"),
Source = new MacAddress("11:11:11:11:11:11"),
EtherType = EthernetType.None, // I select NONE for no IPV4 or ARP and so one protocole ...
};
PayloadLayer payloadLayer =
new PayloadLayer
{
Data = new Datagram(Encoding.ASCII.GetBytes("Hello stackoverflow")),
};
// The probleme it's here but the code build :
PacketBuilder builder = new PacketBuilder(ethernetLayer, payloadLayer);
return builder.Build(DateTime.Now);
}
Visual Studio中社區檢測錯誤在PcapDotNet.Packets.dll
但是,如果我改變&「System.ArgumentException」「無法從下一層(PcapDotNet.Packets.PayloadLayer)自動確定醚型」 EthernetType.None由EthernetType.IpV4或IpV6或ARP等等..沒有問題,但我不想添加其他協議。
在此先感謝。