使用Wincap编制一个简单的网络数据包监听与捕获程序概要1.docVIP

  • 11
  • 0
  • 约5.4千字
  • 约 7页
  • 2017-07-03 发布于湖北
  • 举报

使用Wincap编制一个简单的网络数据包监听与捕获程序概要1.doc

使用Wincap编制一个简单的网络数据包监听与捕获程序概要1

实验目的 二、实验内容 要求使用Wincap编制一个简单的网络数据包监听与捕获程序,同时,将捕获的数据包进行分析并将分析结果显示在屏幕上。 实验步骤、记录和结果 代码如下: #include pcap.h typedef struct{ int number; char name[10]; }Protocol; Protocol protocol[10]; /* 4字节的IP地址 */ typedef struct ip_address{ u_char byte1; u_char byte2; u_char byte3; u_char byte4; }ip_address; /* IPv4 首部 */ typedef struct ip_header{ u_char ver_ihl; // 版本 (4 bits) + 首部长度 (4 bits) u_char tos; // 服务类型(Type of service) u_short tlen; // 总长(Total length) u_short identification; // 标识(Identification) u_short flags_fo; // 标志位(Flags) (3 bits) + 段偏移量(Fragment

文档评论(0)

1亿VIP精品文档

相关文档