#ifndef __WYSF_PKT_ENTRY_H__ #define __WYSF_PKT_ENTRY_H__ #include #include #include #include #include #include #include "wy_singleflow_keepalive.h" #include "wy_singleflow_broadcast.h" #define WYSF_CONFIG_FILE "./conf/wy_single_flow.conf" #ifndef __FILENAME__ #define __FILENAME__ __FILE__ #endif #define MESA_RUNTIME_LOGV3(handle, lv, fmt, args...) \ MESA_handle_runtime_log((handle), (lv), "WYSF", "%s:%d, " fmt, __FILENAME__, __LINE__, ##args) #define WYSF_MAGIC_NUMBER 0x6E7A enum WYSF_FSSTAT_STATUS { WYSF_FSSTAT_STATUS_FLOW_TABLE=0, WYSF_FSSTAT_STATUS_ACTIVE_FUNC, WYSF_FSSTAT_STATUS_KEEPALIVE, WYSF_FSSTAT_STATUS_MAX, }; enum WYSF_FSSTAT_FIELD { WYSF_FSSTAT_FIELD_FLOWS_TOTAL=0, WYSF_FSSTAT_FIELD_FLOWS_INTERCEPT, WYSF_FSSTAT_FIELD_FLOWS_BACK, WYSF_FSSTAT_FIELD_INTER_BYTES, WYSF_FSSTAT_FIELD_SEND_BROADCAST, WYSF_FSSTAT_FIELD_RECV_BROADCAST, WYSF_FSSTAT_FIELD_MAX, }; struct wysf_stream_context { struct function_node *func_node; }; struct wysf_global_info { void *log_runtime; MESA_htable_handle stream_tuple_mapping; int32_t flowhtable_slots; int32_t flowhtable_expires; int32_t htable_locknum; int32_t bfd_dest_port; int32_t bfd_timeout_ms; int32_t bfd_timeout_times; struct event_base *alive_evbase; int32_t alive_func_nodes; int32_t func_group_num; struct judian_as_group *judian_group_list[1024]; int32_t broadcast_udp_servert_sockfd; int32_t broadcast_udp_server_port; std::map *group_judian; std::map *func_keepalive; std::map *forwardip2judian; screen_stat_handle_t fsstat_handle; struct event fs_timer_output; char fsstat_dst_ip[64]; char fsstat_appname[16]; char fsstat_filepath[256]; char fsstat_histlen[256]; u_int32_t fsstat_period; u_int32_t fsstat_print_mode; //0-close; 1-automaticlly; 2-passively int32_t fsstat_dst_port; int32_t fsstat_histlen_id; int32_t fsstat_field_ids[WYSF_FSSTAT_FIELD_MAX]; int32_t fsstat_status_ids[WYSF_FSSTAT_STATUS_MAX]; }; #endif