This project is read-only.

I need the data of a ehternet-telegram

Sep 30, 2014 at 11:51 AM
Hi,

i study electrical engineer in Germany (sorry for my english).
I am at the end of my study and i want to use the Pcap.Net library for my project.

I already use the "User guide", but i do not unterstand how to see the data in the telegram.
Could anyone help me please?
Coordinator
Oct 3, 2014 at 7:10 AM
Hi Krutoj,

I'm not sure what do you menan by "telegram".
If you want to see the Ethernet payload you can do:
Datagram payload = packet.Ethernet.Payload;
I hope this helps,

Boaz.
Oct 4, 2014 at 2:17 PM
Hi,

thanks for your answer.

I’m sorry in German it is “Ethernet-Telegramm” in English “Ethernet-datagram”.
Your example “Datagram payload = packet.Ethernet.Payload;”, I already use.
In the debug-mode I see in “payload.base.Buffer” the whole datagram. How can I get this Buffer in a byte-array or in a String?

Emil
Coordinator
Oct 4, 2014 at 4:43 PM
Quoting the Pcap.Net User Guide FAQ:
Question 3: How can I convert a DataSegment (or a Datagram) to byte[]?
Answer: Just use ToMemoryStream() or Write() methods.