資源簡介
網絡課程設計流量統計,網絡流量統計課設
代碼片段和文件信息
#include?“pcap.h“??
#include
#ifndef?WIN32
#include?
#include?
#else
#include?
#endif
#include
#include
/*全局變量*/
/*=====================================================*/
int?num_packet?=?0; //統計的數據包個數
pcap_t?*adhandle;
//struct?pcap_stat?pkt_stat;
struct?bpf_program?fcode;
pcap_if_t?*alldevs?*d;
char?errbuf[PCAP_ERRBUF_SIZE];
u_int?netmask;
/*=====================================================*/
/*?4字節的IP地址?*/
typedef?struct?ip_address{
u_char?byte1;
u_char?byte2;
u_char?byte3;
u_char?byte4;
}ip_address;
/*ip鏈表*/
typedef?struct?ip_link{
int?number=1;
u_char?byte1;
u_char?byte2;
u_char?byte3;
u_char?byte4;
struct?ip_link?*next;
}ip_link;
ip_link?*head;
- 上一篇:C語言函數速查手冊chm
- 下一篇:利用 MFC 程序動態創建菜單欄
評論
共有 條評論