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
....
What's const struct pcap_pkthdr *header
for(definition), when do we need it, how is it populated (since there is no such info in the packet itself as below)?
(source: lewis at www.dcs.gla.ac.uk)