#ifndef CACHE_H #define CACHE_H #include #include #include #include #include #define MAXIPSET_ 256 #define MAXIPLEN 32 extern char cn_ip[MAXIPSET_][MAXIPLEN]; extern int add_cn_ip(char cn_ip[MAXIPSET_][MAXIPLEN], char *ip); extern int is_ip_in_set(char cn_ip[MAXIPSET_][MAXIPLEN], const char *ip); extern int cn_ip_len(char cn_ip[MAXIPSET_][MAXIPLEN]); extern void clear_ip_set(char cn_ip[MAXIPSET_][MAXIPLEN]); extern int is_ip_in_cache(const char *ip); extern int append_string_to_file(const char *filepath, const char *str); extern int read_file_to_array(const char *filepath, char cn_ip[MAXIPSET_][MAXIPLEN], int *line_count); extern int file_exists_access(const char *filepath); #endif