<span style="font-size:medium;">数据包头的格式<br />
讯享网
struct pcap_pkthdr {
struct timeval ts; /* time stamp /
bpf_u_int32 caplen; / length of portion present /
bpf_u_int32 len; / length this packet (off wire) /
};
struct timeval {
long tv_sec; / seconds (XXX should be time_t) /
suseconds_t tv_usec; / and microseconds */
};
ts: 8字节 抓包时间 4字节表示秒数,4字节表示微秒数
caplen:4字节 保存下来的包长度(最多是snaplen,比如68字节)
len: 4字节 数据包的真实长度,如果文件中保存的不是完整数据包,可能比caplen大

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/177543.html