This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

need help: the code location of Ethernet trailer

0

Hi guys,

I am a novice on the wireshark developing. As for some reason, I need to get the trailer of Ethernet trailer and displayed with a more readable format, who can tell me where is the code of Ethernet trailer in Wireshark code.

Thanks in advance!

Best Regards!

Sam

asked 26 Aug '11, 23:10

Sam's gravatar image

Sam
517914
accept rate: 0%

edited 30 Aug '11, 12:24

helloworld's gravatar image

helloworld
3.1k42041

"More readable" in what sense? The trailer is just padding added to the packet to make sure it's at least the minimum packet size; there's no meaningful data in the trailer, so there's nothing more readable than a blob of hex digits.

(28 Aug '11, 13:29) Guy Harris ♦♦

Harris,

There is a special requirement, we have every packets tagged with eight bytes in the trailer by a device. The eight bytes need to be picked up from the packets and do some analysis.

I will check the packets-eth.c file and find out how to fick up the eight bytes, will let you konw if any further info. Do you have any ideas on this? thanks.

Sam

(29 Aug '11, 06:20) Sam

There's an Ethernet trailer heuristic sub dissector list "eth.trailer" where you can register to.

(29 Aug '11, 06:58) Jaap ♦

thanks, Jaap. I will try it.

Sam

(29 Aug '11, 19:03) Sam

i am trying get trailer data from remote computer with PHP codes. I dont know if there is get_ethernet_trailer() function or not. Do you know like this function in PHP?

(25 Dec '11, 02:05) lansas

Maybe somebody's implemented it in phpcap or atop phpcap. I've never worked with PHP, so I have no idea whether anybody's done so.

(25 Dec '11, 02:15) Guy Harris ♦♦
showing 5 of 6 show 1 more comments

2 Answers:

1

Note that Wireshark thinks the Ethernet trailer is the padding added to bring the packet length up to the minimum. If the packet did not need to have a trailer added, or if we cannot determine whether it needed to have a trailer added (e.g., with a protocol that doesn't run atop 802.2 and that doesn't include its own length field), we do not guarantee that all the "extra" data at the end of the packet will be recognized as or treated as a trailer.

If your capturing is done in a special fashion, i.e. it's not just done by doing regular libpcap/WinPcap capture on a regular Ethernet adapter, but it's written out as a pcap or pcap-ng file, you might want to request your own pcap link-layer type and have your own dissector for that (perhaps sharing code with the Ethernet dissector). If not, you might want to consider having a preference for the Ethernet dissector to tell it to treat the last 8 bytes of the raw frame data specially.

answered 29 Aug '11, 11:33

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196
accept rate: 19%

Harris,

thanks for your advice, I will try to tell the Ethernet dissector to treat the last 8 bytes of the raw frame data specially, will tell you once I finish it. Maybe one week later, haha. thanks again.

Sam

(29 Aug '11, 18:29) Sam

(converted your "answer" to a "comment", please see the FAQ)

(30 Aug '11, 00:43) SYN-bit ♦♦

0

answered 27 Aug '11, 03:03

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%

Thanks a lot, will check it and get back to you later.

Sam

(27 Aug '11, 04:01) Sam