1 / 12
文档名称:

简洁的Pcap文件格式--Wireshark.doc

格式:doc   大小:180KB   页数:12页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

简洁的Pcap文件格式--Wireshark.doc

上传人:乘风破浪 2018/11/30 文件大小:180 KB

下载得到文件列表

简洁的Pcap文件格式--Wireshark.doc

相关文档

文档介绍

文档介绍: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 length" 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 link-layer type depends on the type of link-layer header that the
packets in the capture file have:
以下是数据值与链路层类型的对应表
0            BSD       loopback devices, except for later OpenBSD
1            , and Linux loopback devices   以太网类型,大多数的数据包为这种类型。
6            Token Ring
7           
8            SLIP
9         
   PPP
10          FDDI
100        LLC/SNAP-encapsulated ATM
101        raw IP, with no link
102        BSD/OS SLIP
103        BSD/OS PPP
1