来自这里的代码片段:
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
....
但是这张图片并没有说它一定是14:
(来源:www.dcs.gla.ac.uk 的 lewis)
我应该如何正确地做到这一点?