Files
DenyIP/common.h
aixiao 5e441c068f 优化:
添加主要处理函数Processing_IP_addresses(src_ip);
数据处理放到cache.c
暂时未发现Bug
2025-02-17 12:59:02 +08:00

49 lines
1.2 KiB
C

#ifndef COMMON_H
#define COMMON_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <stdarg.h>
#include <errno.h>
#include <unistd.h>
#include <pthread.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/utsname.h>
#include <limits.h>
#include <sys/resource.h>
#include <signal.h>
#include <sys/prctl.h>
#define PRINT_LOG_FILE "denyip.log"
#define BUFFER 1024
#define WHITELIST_IP_NUM 1024
extern char *_time();
extern int _strlen(const char *str);
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 int isregion(char *str, char (*region_list)[WHITELIST_IP_NUM]);
extern int8_t _copy_new_mem(char *src, int src_len, char **dest);
extern int is_valid_ip(const char *ip);
extern int _command_exists(const char *command);
extern char *_execute_command(const char *command);
extern void remove_char(char *str, char c);
#endif