capture.h

来自「一个阻断tcp连接的程序。可以实时的抓包并且经过分析后阻断已建立的tcp联接。」· C头文件 代码 · 共 60 行

H
60
字号
#ifndef _CAPTURE_H#define _CAPTURE_H#ifdef __cplusplusextern "C" {#endif#include <pcap.h>#define DEFAULT_SNAPLEN 800#include <sys/types.h>#include <fcntl.h>#include <string.h>#include <unistd.h>#include <errno.h>#include <netinet/in_systm.h>#include <netinet/in.h>#include <netinet/ip.h>#include <netinet/udp.h>#include <netinet/tcp.h>#include <netinet/ether.h>#include <net/ethernet.h>     /* the L2 protocols */#include <linux/if_ether.h>#include <netdb.h>struct NatInfo    //nat information{        u_char src_mac[7];        u_char dst_mac[7];        u_long s_source_ip;        u_long s_dst_ip;        u_short n_source_port;        u_short n_dst_port;        u_int n_seq;	u_int n_ack;        u_short ip_id;	u_char  n_ttl;        u_char n_flags;        u_short sess_id;	u_short rtp_seq;	u_long rtp_stamp;	u_long rtp_ssrc;}NATINFO;void displayNat();void AnalysePacket(u_char *_deviceId,                         const struct pcap_pkthdr *h,                         const u_char *p);#ifdef __cplusplus}#endif#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?