Extrait de code de here:À quoi sert 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
....
Qu'est-ce que est const struct pcap_pkthdr *header
pour (definition), quand avons-nous besoin, comment est-elle peuplée (car il n'y a pas d'information dans le paquet lui-même comme ci-dessous)?
alt text http://www.dcs.gla.ac.uk/~lewis/networkpages/m04s03EthernetFrame_files/image002.gif