What's pcap_pkthdr there for?

Posted by httpinterpret on Stack Overflow See other posts from Stack Overflow or by httpinterpret
Published on 2010-05-09T08:41:36Z Indexed on 2010/05/09 8:48 UTC
Read the original article Hit count: 255

Filed under:
|
|

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, when do we need it, how is it populated (since there is no such info in the packet itself as below)?

alt text

© Stack Overflow or respective owner

Related posts about c

    Related posts about winpcap