⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 capture.h

📁 一个阻断tcp连接的程序。可以实时的抓包并且经过分析后阻断已建立的tcp联接。
💻 H
字号:
#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -