新版本采用libipset库操作ipset集合,采用libpcap、libcap抓包获取源IP

This commit is contained in:
2024-10-28 11:15:54 +08:00
parent 866043b976
commit b97b4b212e
27 changed files with 915 additions and 78 deletions

31
cap.h Normal file
View File

@@ -0,0 +1,31 @@
#ifndef CAP_H
#define CAP_H
#include <stdio.h>
#include <stdlib.h>
#include <pcap.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netinet/ip.h> // IP header
#include <netinet/tcp.h> // TCP header
#include <sys/types.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <unistd.h>
#include <string.h>
#include "ip2region/ip2region.h"
#include "qqwry/qqwry.h"
#define RED "\033[31m"
#define REDEND "\033[0m"
#define MAXIPSET 65535
#define MAXIPSET_RULT_NAME_NUM 26
#define _VERSION "0.2"
#endif