2
代码从here片段:那里有什么pcap_pkthdr?
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
....
什么const struct pcap_pkthdr *header
为(definition),我们什么时候需要它,它是如何填充(因为在数据包本身如下没有这样的信息)?
alt text http://www.dcs.gla.ac.uk/~lewis/networkpages/m04s03EthernetFrame_files/image002.gif