summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorlijie <[email protected]>2018-11-30 15:52:59 +0800
committerlijie <[email protected]>2018-11-30 15:52:59 +0800
commitb670b740f87b1845a1fce72f2abed9f796fdad69 (patch)
treede88cc69fb9532c193f73598520c8258d13c9197 /include
parent8abbfe5a10fdcca9e6b33beb1d3fad0bfc53c24c (diff)
candidate和nominee两张表公用一个maat_feather,添加部分DEBUG级别的日志
Diffstat (limited to 'include')
-rw-r--r--include/mrl_main.h10
-rw-r--r--include/mrl_redis.h10
-rw-r--r--include/mrl_stat.h68
3 files changed, 77 insertions, 11 deletions
diff --git a/include/mrl_main.h b/include/mrl_main.h
index a9bd8d5..e74a59e 100644
--- a/include/mrl_main.h
+++ b/include/mrl_main.h
@@ -63,19 +63,11 @@ struct mrl_global_instance
{
void *mrl_log_handle;
struct mrl_global_cfg mrl_cfg;
-
- Maat_feather_t nominee_feather;
- Maat_feather_t candidate_feather;
-
+ Maat_feather_t mrl_feather;
MESA_htable_handle ht_nominee;
-
- //MESA_htable_handle ht_candidate;
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;
diff --git a/include/mrl_redis.h b/include/mrl_redis.h
index b840a8e..655173d 100644
--- a/include/mrl_redis.h
+++ b/include/mrl_redis.h
@@ -6,6 +6,12 @@
#define IR_NOMINEE_IP_TABLE_NAME "IR_NOMINEE_IP"
#define IR_CANDIDATE_IP_TABLE_NAME "IR_CANDIDATE_IP"
//#define REDIS_CANDIATE_KEY_NAME "IR_CANDIDATE_ID"
+struct mrl_ht_nominee_key{
+uint32_t sip;
+uint32_t dip;
+uint16_t sport;
+uint16_t dport;
+};
struct mrl_nominee_item{
int config_id;
@@ -49,9 +55,9 @@ void ht_nominee_free_cb(void * data);
void Maat_set_cmd_line(Maat_feather_t feather, struct mrl_candidate_item *candidate_item);
void Maat_set_nominee_cmd_line(Maat_feather_t feather, struct mrl_nominee_item *nominee_item);
-Maat_feather_t mrl_Maat_feather_init(const char * instance_name,const char *table_name, Maat_start_callback_t *start,Maat_update_callback_t *update,Maat_finish_callback_t *finish,void *u_para);
+Maat_feather_t mrl_Maat_feather_init();
void nominee_update_cb(int table_id,const char* table_line,void* u_para);
-void mrl_identify_nominee(struct streaminfo *mystream);
+bool mrl_identify_nominee(struct streaminfo *mystream);
#endif
diff --git a/include/mrl_stat.h b/include/mrl_stat.h
new file mode 100644
index 0000000..1bd9b7a
--- /dev/null
+++ b/include/mrl_stat.h
@@ -0,0 +1,68 @@
+#ifndef MRL_STAT_H
+#define MRL_STAT_H
+
+#include <stdint.h>
+
+#include "MESA/field_stat2.h"
+
+enum FS_FIELD
+{
+ FIELD_RECV_MGW_PKTS = 0,
+ FIELD_SEND_MGW_PKTS,
+ FIELD_RECV_GDEV_PKTS,
+ FIELD_SEND_GDEV_PKTS,
+
+ FIELD_RECV_GDEV_TCP_PKTS,
+ FIELD_RECV_GDEV_UDP_PKTS,
+
+ FIELD_RECV_IR_PKTS,
+
+ FIELD_RECV_DETECT_PKTS,
+ FIELD_SEND_DETECT_PKTS,
+
+ FIELD_MAX
+};
+
+enum FS_STATUS
+{
+ STATUS_MALLOC_MEMORY,
+ STATUS_FREE_MEMORY,
+ STATUS_MAX
+};
+
+
+struct global_stat_t
+{
+ uint64_t recv_from_mgw_pkts;
+ uint64_t send_to_mgw_pkts;
+
+
+ uint64_t recv_gdev_total_pkts;
+ uint64_t send_gdev_total_pkts;
+
+ uint64_t recv_gdev_tcp_pkts;
+ uint64_t recv_gdev_udp_pkts;
+
+ uint64_t recv_ir_pkts;
+
+ uint64_t recv_detect_pkts;
+ uint64_t send_detect_pkts;
+
+ uint64_t malloc_memory;
+ uint64_t free_memory;
+};
+
+struct fs_stat_t
+{
+ screen_stat_handle_t handle;
+ int fs_field_id[FIELD_MAX];
+ int fs_status_id[STATUS_MAX];
+};
+
+void mrl_stat_init();
+
+void *mrl_stat_action(void *arg);
+
+
+#endif // STAT_H_INCLUDED
+