#ifndef __MRL_MAIN_H_ #define __MRL_MAIN_H_ #include #include #include "stream_inc/stream_rawpkt.h" #include "MESA_prof_load.h" #include "MESA_handle_logger.h" #include "MESA_htable.h" #include "MESA_list_queue.h" #include "Maat_rule.h" #include "Maat_command.h" #include "mrl_utils.h" struct mrl_global_cfg { //log info char mrl_log_path[MRL_MAX_PATH]; int mrl_log_level; //detect info //TODO 下个版本需要部署两台探测服务器,一台域内一台域外 char dest_ip[MRL_STR_IP_LEN]; uint16_t dest_port; uint16_t local_port; //socket info char mgw_ip[MRL_STR_IP_LEN]; char mrl_ip[MRL_STR_IP_LEN]; uint16_t mgw_port;//mgw listen udp port uint16_t mrl_port;//mrl listen udp port //maat info char Maat_table_path[MRL_MAX_PATH]; char Maat_stat_path[MRL_MAX_PATH]; unsigned int Maat_max_threads; char static_redis_ip[MRL_STR_IP_LEN]; uint16_t static_redis_port; int static_redis_index; char dynamic_redis_ip[MRL_STR_IP_LEN]; uint16_t dynamic_redis_port; int dynamic_redis_index; //htable info unsigned int ht_slot_size; unsigned int ht_max_element_num; unsigned int ht_mutex_num; //candidate info char ip_location[MRL_LOCATION_LEN]; //vxlan_info char link_identity_path[MRL_MAX_PATH]; }; struct mrl_global_instance { void *mrl_log_handle; struct mrl_global_cfg mrl_cfg; Maat_feather_t static_feather; Maat_feather_t dynamic_feather; MESA_htable_handle ht_link_identity;//存放当前json表中存在的link_identity MESA_htable_handle ht_nominee;//存储dnat和snat需要探测的IP的哈希表 MESA_htable_handle ht_snat_candidate;//用来存储snat可以复用的IP表 MESA_htable_handle ht_dnat_policy;//用来判断dant复用流量的哈希表 MESA_htable_handle ht_dnat_candidate;//用来判断dnat探测成功的IP的哈希表 MESA_htable_handle ht_vxlan_info; MESA_htable_handle ht_mrl_ip_info; //MESA_lqueue_head mrl_queue; MMDB_s mrl_mmdb; int stop_flag; int *mrl_snd_fd; int mrl_rcv_fd; struct sockaddr_in mgw_addr; }; #endif