- 17
- 0
- 约 12页
- 2017-06-03 发布于湖北
- 举报
PCAP 文件格式协议分析一、基本格式:文件头 数据包头 数据报 数据包头 数据报......
pcap文件格式 结构
?
文件头 格式如结构体pcap_file_header 数据包头1 格式如pcap_pkthdr 数据包 数据包 数据包头n-1 格式如pcap_pkthdr 数据包 数据包 数据包头n 格式如pcap_pkthdr 数据包 数据包 二、文件头结构体:sturct pcap_file_header{DWORD????????????? magic;WORD???????????????? version_major;WORD???????????????? version_minor;DWORD????????????? thiszone;DWORD????????????? sigfigs;DWORD????????????? snaplen;DWORD????????????? linktype;}说明:1、标识位:32位的,这个标识位的值是16进制的 0xa1b2c3d4。a 32-bit??????? magic number ,The magic number has the value hex a1b2c3d4.2、主版本号:16位, 默认值为0x2。a 16-bit????????? major version number,The major version number should have the value 2.3、副版本号:16位,默认值为0x04。a 16-bit????????? minor version number,The minor version number should have the value 4.4、区域时间:32位,实际上该值并未使用,因此可以将该位设置为0。a 32-bit????????? time zone offset field that actually not used, so you can (and probably should) just make it 0;5、精确时间戳:32位,实际上该值并未使用,因此可以将该值设置为0。a 32-bit????????? time stamp accuracy field tha not actually used,so you can (and probably should) just make it 0;6、数据包最大长度:32位,该值设置所抓获的数据包的最大长度,如果所有数据包都要抓获,将该值设置为65535; 例如:想获取数据包的前64字节,可将该值设置为64。a 32-bit????????? snapshot lengthquot; field;The snapshot length field should be the maximum number of bytes perpacket that will be captured. If the entire packet is captured, make it 65535; if you only capture, for example, the first 64 bytes of the packet, make it 64.7、链路层类型:32位, 数据包的链路层包头决定了链路层的类型。a 32-bit link layer type field.The link-layer type depends on the type of link-layer header that thepackets in the capture file have:以下是数据值与链路层类型的对应表0??????????? BSD?????? loopback devices, except for later OpenBSD1??????????? Ethernet, and Linux loopback devices?? 以太网类型,大多数的数据包为这种类型。6??????????? 802.5 Token Ring7??????????? ARCnet8??????????? SLIP9??????????? PPP10????????? FDDI100??????? LLC/SNAP-encapsulated ATM101??????? raw IP, with no link102??????? BSD/OS SLIP103??????? BSD/OS PPP104??????? Cisco HDLC105???????
您可能关注的文档
- 第五篇5-5物理结构设计.ppt
- 第五篇box-vellum纸盒设计CAD1.ppt
- 第五篇Linux编程新修改.ppt
- 第五篇mathlab_文件输入输出(IO).ppt
- 第五篇电极过程扩散动力学.ppt
- 第五篇货币的时间价值.ppt
- 1-1复数和其运算.ppt
- 第五篇入侵检测.ppt
- 1-1复数及复平面.ppt
- 1-1节 复数的概念及定义29.ppt
- 2025年全国演出经纪人员资格认定考试试卷带答案(研优卷).docx
- 2025年全国演出经纪人员资格认定考试试卷完整版.docx
- 2025年全国演出经纪人员资格认定考试试题库及完整答案.docx
- 2025年全国演出经纪人员资格认定考试试卷完美版.docx
- 2025年全国演出经纪人员资格认定考试试卷含答案(实用).docx
- 2025年全国演出经纪人员资格认定考试试卷及答案(各地真题).docx
- 2025年下半年内江市部分事业单位公开考试招聘工作人员(240人)备考题库附答案.docx
- 2025年全国演出经纪人员资格认定考试试卷及答案1套.docx
- 2025年下半年四川成都市郫都区面向社会引进公共类事业单位人员2人备考题库最新.docx
- 2025年下半年内江市部分事业单位公开考试招聘工作人员(240人)备考题库附答案.docx
最近下载
- 深度解析(2026)《GBT 6398-2017金属材料 疲劳试验 疲劳裂纹扩展方法》(2026年)深度解析.pptx VIP
- 2025浙江绍兴越城区初升高自主招生数学试卷试题(含答案详解).docx VIP
- 大数据在桥梁结构健康监测中的应用研究.docx VIP
- catti二级笔译日语真题及答案2025.doc VIP
- 电工类本科国网考试注意事项及复习方法 .pdf VIP
- EHS100系列电液伺服使用说明书V1.5.pdf VIP
- 2024年国网北京公司考试真题.docx VIP
- 2025年甘肃省嘉峪关市中考英语试卷.docx
- 补填入党志愿书的参考格式【最新精选】.doc VIP
- JJF(蒙) 119-2025 烷基汞分析仪校准规范.docx VIP
原创力文档

文档评论(0)