From 91c511c3edcd93d06ceca093cff6ad85c62109d2 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Fri, 15 Nov 2019 14:37:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BE=9B=E7=BB=9F=E4=B8=80=E5=8F=91?= =?UTF-8?q?=E9=80=81=E6=97=A5=E5=BF=97=E6=8E=A5=E5=8F=A3=E7=B3=BB=E5=88=97?= =?UTF-8?q?=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/tsg_rule.h | 2 +- inc/tsg_send_log.h | 27 +++++++++++++++++---------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/inc/tsg_rule.h b/inc/tsg_rule.h index 28f6cbb..bbd3667 100644 --- a/inc/tsg_rule.h +++ b/inc/tsg_rule.h @@ -26,7 +26,7 @@ typedef enum _PULL_RESULT_TYPE extern Maat_feather_t g_tsg_maat_feather; -int tsg_rule_init(const char *conffile); +int tsg_rule_init(const char *conffile, void *logger); int tsg_scan_nesting_addr(Maat_feather_t maat_feather, const struct streaminfo *a_stream, tsg_protocol_t proto, scan_status_t *mid, Maat_rule_t*result, int result_num); diff --git a/inc/tsg_send_log.h b/inc/tsg_send_log.h index 559df98..6758046 100644 --- a/inc/tsg_send_log.h +++ b/inc/tsg_send_log.h @@ -8,14 +8,6 @@ extern "C" { #endif - -struct _opt_unit_t -{ - int opt_type; - int opt_len; - char *opt_value; -}; - typedef struct _tsg_log { int result_num; @@ -23,9 +15,24 @@ typedef struct _tsg_log struct streaminfo *a_stream; }tsg_log_t; +typedef enum _tld_type +{ + TLD_TYPE_LONG=1, + TLD_TYPE_STRING, + TLD_TYPE_FILE +}TLD_TYPE; -int tsg_sendlog_init(char *filename); -void tsg_send_log(const tsg_log_t* log_msg, struct _opt_unit_t* log_opt, int opt_num, int thread_id); + +typedef void* TLD_handle_t; +typedef void* tsg_log_instance_t; + +extern tsg_log_instance_t g_tsg_log_instance; + +TLD_handle_t TLD_create(int thread_id); +int TLD_append(TLD_handle_t handle, char *key, void *value, TLD_TYPE type); +int TLD_cancel(TLD_handle_t handle); + +int tsg_send_log(tsg_log_instance_t instance, TLD_handle_t handle, tsg_log_t *log_msg, int thread_id); #ifdef __cplusplus