libpcap结构详解

 pcap_pkthdr结构
  [路径]/usr/include/pcap.h
  /*
  * Each packet in the dump file is prepended with this generic header.
  * This gets around the problem of different headers for different
  * packet interfaces.
  */
  struct pcap_pkthdr
  {
   struct timeval ts; /* time stamp,ts是一个结构struct   timeval,它是有2部分的
                           第一部分是1900开始以来的秒数,第一部分是当前秒之后的毫秒数*/
   bpf_u_int32 caplen; /* 表示抓到的数据长度length of portion present */
   bpf_u_int32 len; /* 表示数据包的实际长度length this packet (off wire) */
  };

你可能感兴趣的:(libpcap结构详解)