提供统一发送日志接口系列函数

This commit is contained in:
liuxueli
2019-11-15 14:37:18 +08:00
parent bd65acc17d
commit 91c511c3ed
2 changed files with 18 additions and 11 deletions

View File

@@ -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);

View File

@@ -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