#include #include #include #include #include #include #include #include #include #include #include "MESA_prof_load.h" #include "MESA_handle_logger.h" #include #include #include #include #include #include "MESA_htable.h" #include #define IPRESET_CONFIG_FILE "./resetconf/ip_reset_plug.conf" #define SIZE 128 #define BUFSIZE 1024 #define STRSIZE 1024 #define MAX_PATH_LENGTH 256 #define MAX_LENGTH 4096 //#define MAX_MACIP_NUM 4096 #define HASH_THREAD_NUM 32 //#define HASH_THREAD_NUM 10 typedef struct hash_set_t{ int hash_num; MESA_htable_handle htable; }hash_set_t; typedef struct common_module_t { void *log_handle; char config_path[MAX_PATH_LENGTH]; char log_path[MAX_PATH_LENGTH]; char kafka_servers[MAX_LENGTH]; char kafka_topic[MAX_LENGTH]; int batch_send_number; rd_kafka_t *kafka_producer; /*Producer instance handle*/ rd_kafka_topic_t *rd_kafka_topic; /*topic对象*/ char errstr[512]; char buf[512]; char clj_ip[16]; char send_type[32]; int send_types; /*rst:1,syn+ack:2,53port:3,all:0*/ // char macip[MAX_MACIP_NUM][17]; // char cljip[MAX_MACIP_NUM][32]; // MESA_htable_handle htable; //add by 20190722,htable hash_set_t *hashset; }common_module_t; int ipreset_init(); void ipreset_destroy(); char ipreset_ip_entry(struct streaminfo *f_stream,unsigned char routedir,int thread_seq,struct ip * a_packet);