summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordump2file <[email protected]>2019-01-08 17:09:34 +0600
committerdump2file <[email protected]>2019-01-08 17:09:34 +0600
commita44c4064ffd4c07a2a01312d051d02acf41d6e8b (patch)
treef8025f15c9bfa172dcbc9c259758a5e93c651e01
parent3baaedefc36136148687547ec6f1a8f4989f73d4 (diff)
同步上线代码
1、链接cjson 2、使用非格式化json输出 3、同步dpkt_label结构体
-rw-r--r--src/Makefile2
-rw-r--r--src/ntc_ssl_collect.c5
-rw-r--r--src/ntc_ssl_collect.h18
3 files changed, 20 insertions, 5 deletions
diff --git a/src/Makefile b/src/Makefile
index 9159f50..a7b8dfd 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -16,7 +16,7 @@ CPPFLAGS=$(CFLAGS)
LIB+=-lMESA_handle_logger
LIB+=-lMESA_prof_load
LIB+=-lrdkafka
-LIB+=-lcJSON
+LIB+=-lcjson
LIB+=-ldl
SOURCES=$(wildcard *.c)
diff --git a/src/ntc_ssl_collect.c b/src/ntc_ssl_collect.c
index d0d3e80..d1e994e 100644
--- a/src/ntc_ssl_collect.c
+++ b/src/ntc_ssl_collect.c
@@ -25,7 +25,7 @@
#include <cJSON.h>
#define PLUGIN_NAME "NTC_SSL_COLLECT"
-#define PROFILE_PATH "./t1conf/ssl_collect.conf"
+#define PROFILE_PATH "./t1conf/main.conf"
#define NTC_SSL_COLLECT_TOPIC "ntc_ssl_collect_log"
extern long long g_CurrentTime;
@@ -185,7 +185,8 @@ void ntc_ssl_collect_send_kafka_log(rd_kafka_topic_t *topic, struct streaminfo *
cJSON_AddNumberToObject(log_obj, "lastmtime", a_stream->ptcpdetail->lastmtime);
- char *payload = cJSON_Print(log_obj);
+ //char *payload = cJSON_Print(log_obj);
+ char *payload = cJSON_PrintUnformatted(log_obj);
int paylen = strlen(payload);
rd_kafka_produce(g_ntc_kafka_topic, RD_KAFKA_PARTITION_UA, RD_KAFKA_MSG_F_COPY, payload, paylen, NULL, 0, NULL);
diff --git a/src/ntc_ssl_collect.h b/src/ntc_ssl_collect.h
index 8b02d28..9b3c9b7 100644
--- a/src/ntc_ssl_collect.h
+++ b/src/ntc_ssl_collect.h
@@ -8,7 +8,7 @@ extern "C"
#endif
#include "stream.h"
-#include "soq/identify_v2.h"
+//#include "soq/identify_v2.h"
typedef struct ntc_ssl_collect_global_item
{
@@ -51,7 +51,21 @@ typedef struct _dpkt_lable_t
}dpkt_lable_t;
*/
-typedef stDntyProInfoV2 dpkt_lable_t;
+//typedef stDntyProInfoV2 dpkt_lable_t;
+typedef struct _dpkt_lable_t
+{
+ unsigned char trans_proto;
+ unsigned char v6;
+ unsigned short _pad0;
+ // uint16_t dpkt_app_ser_type;
+ // uint16_t dpkt_proto_ser_type;
+ unsigned int dpkt_proto_type;
+ unsigned int dpkt_app_type;
+ unsigned int dpkt_op_type;
+ unsigned int dpkt_browser_type;
+ unsigned int dpkt_web_type;
+ unsigned int dpkt_behavior_type;
+}dpkt_lable_t;
typedef struct _comm_context_t