ここからのコードスニペット:
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
(定義)の目的、いつ必要なのか、どのように入力されるのか (パケット自体に以下のような情報がないため)。
(出典: lewis at www.dcs.gla.ac.uk )