Is length of ethernet header necessarily 14?What's pcap_pkthdr there for?
Posted
by httpinterpret
on Stack Overflow
See other posts from Stack Overflow
or by httpinterpret
Published on 2010-05-09T07:29:53Z
Indexed on
2010/05/09
8:38 UTC
Read the original article
Hit count: 167
Code snippet from here:
void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data)
{
....
/* retireve the position of the ip header */
ih = (ip_header *) (pkt_data +
14); //length of ethernet header
....
But this image doesn't say it's necessarily 14:
How should I do it properly?
UPDATE
What's const struct pcap_pkthdr *header
for, when do we need it?
© Stack Overflow or respective owner