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