libpcap结构详解

来源:互联网 发布:剑网三丐姐捏脸数据 编辑:程序博客网 时间:2024/04/30 18:47
 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) */
  };
原创粉丝点击