新版本采用libipset库操作ipset集合,采用libpcap、libcap抓包获取源IP
This commit is contained in:
15
common.h
15
common.h
@@ -22,21 +22,24 @@
|
||||
#include <signal.h>
|
||||
#include <sys/prctl.h>
|
||||
|
||||
#define PRINT_LOG_FILE "Gateway.log"
|
||||
#define PRINT_LOG_FILE "denyip.log"
|
||||
#define BUFFER 1024
|
||||
#define WHITELIST_IP_NUM 1024
|
||||
|
||||
|
||||
extern char *_time();
|
||||
extern int _strlen(char *str);
|
||||
extern void my_printf(const char *format, ...);
|
||||
extern void _printf(const char *format, ...);
|
||||
extern int _nice(int increment);
|
||||
|
||||
extern void split_string(char string[], char delims[], char (*whitelist_ip)[WHITELIST_IP_NUM]);
|
||||
extern int whitelist(char *client_ip, char (*whitelist_ip)[WHITELIST_IP_NUM]);
|
||||
extern char *_time();
|
||||
extern int isregion(char *str, char (*region_list)[WHITELIST_IP_NUM]);
|
||||
|
||||
extern int8_t copy_new_mem(char *src, int src_len, char **dest);
|
||||
extern int8_t _copy_new_mem(char *src, int src_len, char **dest);
|
||||
|
||||
extern int is_valid_ip(const char *ip);
|
||||
extern int nice_(int increment);
|
||||
extern int command_exists(const char *command);
|
||||
extern int _command_exists(const char *command);
|
||||
extern char *_execute_command(const char *command);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user