summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author杨威 <[email protected]>2019-07-02 18:35:15 +0800
committer杨威 <[email protected]>2019-07-02 18:35:15 +0800
commit9d198a65f3105b5b6fce72ba00b00b0b58960bda (patch)
tree5eebc824baf6c93b91f53b88ce296b037b280d94
parentc6a5d4ed1b042980051567b4dff9fd930e7defa1 (diff)
增加after_kill_switch,需要配合TCP_ALL的入口ntc_ip_comm_tcpall_entry使用,打开后将每个流设置MSO_TCPALL_VALID_AFTER_KILL,即使进入补救流程,仍然给TCP_ALL插件送包,保证能够统计到流量
-rw-r--r--.gitignore1
-rw-r--r--Makefile116
-rw-r--r--conf/main.conf1
-rw-r--r--conf/ntc_ip_comm.inf5
-rw-r--r--inc/stream_internal.h70
-rw-r--r--src/Makefile65
-rw-r--r--src/ntc_ip_comm.cpp92
-rw-r--r--src/ntc_ip_comm.h2
8 files changed, 191 insertions, 161 deletions
diff --git a/.gitignore b/.gitignore
index 1dbe669..5692e42 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@ build/
.idea
core.*
version.txt
+cmake-build-debug
diff --git a/Makefile b/Makefile
index 4b51c47..ac23531 100644
--- a/Makefile
+++ b/Makefile
@@ -1,79 +1,41 @@
-#define
-
-PLUG_TYPE_BIZ=biz
-PLUG_TYPE_PROTO=proto
-PLUG_TYPE_PLATFORM=platform
-
-
-path=/home/mesasoft/sapp_run
-
-PLUG_TYPE=biz
-plug_name=ntc_ip_comm
-plug_conf_dir=$(path)/ntcconf/
-
-plug_dir_name=$(plug_name)
-plug_inf_name=$(plug_name).inf
-
-plug_so_path=./bin/$(plug_name).so
-#plug_conf_path=./conf/$(plug_name).conf
-plug_inf=./conf/$(plug_name).inf
-
-#-----auto filled----
-
-biz_plug_dir_name=./plug/business
-biz_plug_dir=$(path)/$(biz_plug_dir_name)
-
-protocol_plug_dir_name=./plug/protocol
-protocol_plug_dir=$(path)/$(protocol_plug_dir_name)
-
-
-platform_plug_dir_name=./plug/platform
-platform_plug_dir=$(path)/$(platform_plug_dir_name)
-
-business_conflist_path=$(biz_plug_dir)/conflist_business.inf
-protocol_conflist_path=$(protocol_plug_dir)/conflist_protocol.inf
-platform_conflist_path=$(platform_plug_dir)/conflist_platform.inf
-
-ifeq ($(PLUG_TYPE), $(PLUG_TYPE_BIZ))
-dest_plug_dir_name = $(biz_plug_dir_name)
-dest_plug_dir = $(biz_plug_dir)
-dest_conflist_path=$(business_conflist_path)
-endif
-
-ifeq ($(PLUG_TYPE), $(PLUG_TYPE_PROTO))
-dest_plug_dir_name = $(protocol_plug_dir_name)
-dest_plug_dir = $(protocol_plug_dir)
-dest_conflist_path=$(protocol_conflist_path)
-endif
-
-ifeq ($(PLUG_TYPE), $(PLUG_TYPE_PLATFORM))
-dest_plug_dir_name = $(platform_plug_dir_name)
-dest_plug_dir = $(platform_plug_dir)
-dest_conflist_path=$(platform_conflist_path)
+BUILD_DIR = $(CURDIR)/build
+LOCAL_DIR = $(CURDIR)
+DEBUG_FLAGS = -DCMAKE_BUILD_TYPE=Debug
+REL_FLAGS = -DCMAKE_BUILD_TYPE=RelWithDebInfo
+
+ifneq ($(INSTALL_PREFIX),)
+DEBUG_FLAGS += -DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX)
+REL_FLAGS += -DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX)
endif
-plug_inf_path=$(dest_plug_dir_name)/$(plug_dir_name)/$(plug_inf_name)
-plug_dir=$(dest_plug_dir)/$(plug_dir_name)
-
-
-.PHONY: all clean opt update
-
-all:
- cd src && $(MAKE)
- @echo -e "current path=\033[32;49;1m$(path)\033[32;49;0m , try \033[32;49;1m[make install path=PATH]\033[32;49;0m to install plugin"
-clean:
- cd src && $(MAKE) clean
-
-opt:
- $(MAKE) all
-
-update:
- @cp -f $(plug_so_path) $(plug_dir)
- @echo -e "copy \033[32;49;1m$(plug_so_path) \033[32;49;0m to \033[32;49;1m$(plug_dir)\033[32;49;0m \033[31;49;1m[success]\033[31;49;0m"
-
-install:
- mkdir -p $(plug_dir)
- mkdir -p $(plug_conf_dir)
- @cp -f $(plug_so_path) $(plug_inf) $(plug_dir)
- @echo -e "copy \033[32;49;1m$(plug_so_path) $(plug_inf)\033[32;49;0m to \033[32;49;1m$(plug_dir)\033[32;49;0m \033[31;49;1m[success]\033[31;49;0m"
- @ret=`cat $(dest_conflist_path)|grep $(plug_inf_path)|wc -l`;if [ $$ret -eq 0 ];then echo $(plug_inf_path) >>$(dest_conflist_path);fi
+all: _make_build_dir _compile_rel
+
+PHONY: all _make_build_dir _compile_debug _compile_rel _install \
+ build_release build_debug install
+
+_make_build_dir:
+ mkdir -p $(BUILD_DIR)
+
+_compile_debug:
+ cd $(BUILD_DIR) && cmake $(LOCAL_DIR) $(DEBUG_FLAGS) && make
+
+_compile_rel:
+ cd $(BUILD_DIR) && cmake $(LOCAL_DIR) $(REL_FLAGS) && make
+
+_install:
+ cd $(BUILD_DIR) && make install
+_package:
+ cd $(BUILD_DIR) && make package
+_clean:
+ rm -rf $(BUILD_DIR)
+
+# Release Version, No Debug Symbol and Optimized with -O2
+release: _make_build_dir _compile_rel
+# Debug Version, Optimized with -O0
+debug: _make_build_dir _compile_debug
+# Install
+install: _install
+# Package
+package: _package
+# Clean
+clean: _clean
diff --git a/conf/main.conf b/conf/main.conf
index 075d49a..4413f8f 100644
--- a/conf/main.conf
+++ b/conf/main.conf
@@ -9,6 +9,7 @@ kafka_topic=ntc_ip_comm_log
#kafka_brokelist=
#service=
#dpkt_label=
+after_kill_switch=0
min_bytes=5
min_pkts=5
diff --git a/conf/ntc_ip_comm.inf b/conf/ntc_ip_comm.inf
index e6d5303..b9900ff 100644
--- a/conf/ntc_ip_comm.inf
+++ b/conf/ntc_ip_comm.inf
@@ -12,3 +12,8 @@ FUNC_NAME=ntc_ip_comm_transfer_entry
[TCP]
FUNC_FLAG=ALL
FUNC_NAME=ntc_ip_comm_transfer_entry
+
+#[TCP_ALL]
+#FUNC_FLAG=ALL
+#FUNC_NAME=ntc_ip_comm_tcpall_entry
+
diff --git a/inc/stream_internal.h b/inc/stream_internal.h
new file mode 100644
index 0000000..fa1b352
--- /dev/null
+++ b/inc/stream_internal.h
@@ -0,0 +1,70 @@
+#ifndef _APP_STREAM_INTERNAL_H_
+#define _APP_STREAM_INTERNAL_H_
+
+#include "stream_inc/stream_base.h"
+#include "stream_inc/stream_project.h"
+#include "stream_inc/stream_proxy.h"
+#include "stream_inc/stream_tunnel.h"
+#include "stream_inc/stream_inject.h"
+#include "stream_inc/stream_rawpkt.h"
+#include "stream_inc/stream_control.h"
+
+/* ԭʼ���ṹ */
+typedef struct {
+ unsigned int magic_num;
+ int offset_to_raw_pkt_hdr; /* ����ص���Ӧ��������raw_pkt_data��ƫ���� */
+ enum addr_type_t low_layer_type; /* ԭʼ����ײ�Э�������, ������MAC(pcap����), Ҳ������IPv4(pag����) */
+ int __lib_raw_pkt_len; /* �ײ㲶�����ṩ�İ���ʵԭʼ���� */
+ int raw_pkt_len; /* ���ϲ�Ӧ�ÿ���ԭʼ���ܳ���, �п��ܲ�����ʵ��, ����������Ethernet�� */
+ unsigned int hd_hash; /* ����Ӳ���������Ԫ��HASH, ����ƽ̨CPU�������� */
+ const void *__lib_raw_pkt_data; /* �ײ㲶�����ṩ����ʵԭʼ��ָ�� */
+ const void *raw_pkt_data; /* ���ϲ�Ӧ�ÿ���ԭʼ��ͷָ��, �п���������Ethernet��, ����low_layer_type�ж�Э������ */
+ struct timeval raw_pkt_ts; /* ԭʼ������ʱ���, ���ȫΪ0��֧�ִ˹���(��pagģʽ) */
+ const void *io_lib_pkt_reference; /* ���õײ�I/O���ԭʼ�������ṹ, ����:����marsio��˵, ���ײ��mbuf�ṹ */
+}raw_pkt_t;
+
+struct streaminfo_private
+{
+ /* ����ṹ�����ڽṹ����ǰ, ָ���ַ���Ի���ǿת */
+ struct streaminfo stream_public;
+ /* ���±���Ϊƽ̨�ڲ�˽��, ���ⲻ�ɼ� */
+ void *pproject; //ÿ�����̿����Զ���ʹ�ã�
+
+ /* ---8 bytes-- */
+ UCHAR layer_dir:2; /* ������Ч, ��ǰ��ĵ�ַ�Ƿ��Ĭ�Ϲ���"��˿��ǿͻ���"��ͬ */
+ UCHAR stream_dir:2; /* ��������������Ч, ���Ĵ洢�ĵ�ַ�Ƿ��Ĭ�Ϲ���"��˿��ǿͻ���"��ͬ */
+ UCHAR addr_use_as_hash:1; /* �����addr�Ƿ���ΪHASH����ͱȽϵIJ���, ��:MAC��ַ��������� */
+ UCHAR addr_skip_for_layer_cmp:1;/*�����addr�Ƿ���Ϊ��ַ�ȽϵIJ㼶���磺MPLS��ַ����Ϊ�������㣬ֱ����������ֵĬ��Ϊ0������Ҫ�Ƚ�*/
+ UCHAR need_update_opposite_addr:1;/*�����addr�Ƿ��ڶԲ�����ʱ���£��磺MPLS��ǩ�ǶԳ�ʱ��Ҫ��S2C���һ������¼�����ǩ,��ֵĬ��Ϊ0��������Ҫ����*/
+ UCHAR stream_killed_flag:1; /* 2014-08-22 lijia add, ����ģʽ��, �Ѿ������Kill, ֮�������ֱ��Drop��Kill, �����ٸ��ϲ��� */
+ UCHAR dirreverse; /* ��������ʱ�Ƿ������ip��ַ��ת, ����"��˿��ǿͻ���"�����෴ */
+ UINT16 timeout;/* ÿ�����ӵĶ��г�ʱʱ��, ��ֵ��������;, 1:���ھ�����̭��ʱ���ް��������, �Խ�Լ�ڴ�; 2:���ڱ�����ʱ���ް�����, ����IM�೤ʱ���ް������Ӳ�δ����, �����ýϴ��timeout */
+ unsigned short offset_to_raw_pkt_hdr; /* ����ͷ�����ԭʼ������ʼ��ַ��ƫ���� */
+ unsigned short offset_to_ip_hdr; /* 2015-12-07 lijia add, UDP/TCP ��ͷ����ڳ��ص�IP��ͷƫ���� */
+ /* ===8 bytes=== */
+ const raw_pkt_t *raw_pkt; /* 2014-12-30 lijia add, ��Щ�ص�������֧��ԭʼ��, ����������Ҫ, �洢��private�ṹ�� */
+
+ /* ---8 bytes-- */
+ unsigned int hash_slave; /* 2015-12-14 lijia add, ʹ��linux_jhash����ʱ, ����ͬʱ�õ��������ϵ�HASHֵ, ��HASH����ȷ����HASH����SLOTλ��, slave_HASH���ڿ��ٱȽϵ�ַ�Ƿ���� */
+ unsigned char hash_not_head_times;/* 2015-12-15 lijia add, ��ǰindex����HASH SLOT�ĵ�һλ�Ĵ��� */
+ unsigned char cur_layer_raw_hdr_len; /* 2017-10-31 lijia add, ��ǰ���ԭʼ����ַ����, ��pppͷ��ѹ��, ԭ���汾�޷��������״̬, ����ʱҲ�޷���֪��ַ������ */
+ char __pad:4;
+ unsigned char stream_close_reason:4; /* 2019-02-14 lijia add, ����TCPʹ��tcpdetail_private��link_state����, ����UDP֮ǰû��, ���pad�����˱��� */
+ unsigned char gdev_block_timer;
+ /* ===8 bytes=== */
+
+ /* ---8 bytes-- */
+ unsigned short stream_low_layer_tunnel_type; /* 2016-07-25 lijia add, ��¼�����ײ���������, 0Ϊ������, �������:enum stream_carry_tunnel_t */
+ unsigned short stream_carry_up_layer_tunnel_type; /* ��ǰ���ϲ����������, ���統ǰ��ΪUDP, ���صĿ�����teredo������L2TP���� */
+ /* 2016-07-08 lijia add, for janus hijack, ��Ӧ�ô洢��half_stream, �����յ�SYNʱ, ��û�д���half_streamʵ��, �����ݴ���streaminfo_private */
+ unsigned short syn_opt_num;
+ unsigned short synack_opt_num;
+ /* ===8 bytes=== */
+
+ struct tcp_option *syn_opt_array;
+ struct tcp_option *synack_opt_array;
+};
+
+
+#endif
+
diff --git a/src/Makefile b/src/Makefile
deleted file mode 100644
index e1f68b5..0000000
--- a/src/Makefile
+++ /dev/null
@@ -1,65 +0,0 @@
-#path to find lib and header files
-#vpath %.a ../lib
-#vpath %.h ../inc
-
-CCC=g++
-CC=g++
-
-
-INCLUDEPATH+=-I../inc
-
-CFLAGS= -g3 -Wall -fPIC -O0
-CFLAGS+=$(INCLUDEPATH)
-
-ifdef ASAN
-CFLAGS+=-fsanitize=address -fno-omit-frame-pointer
-endif
-
-#GIT_BRANCH=$(shell git symbolic-ref --short -q HEAD)
-#GIT_SHA1=$(shell git rev-parse HEAD)
-#MAKE_TIME=$(shell date "+%Y-%m-%d_%H:%M:%S")
-#GIT_VERSION=VERSION_$(GIT_BRANCH)-$(GIT_SHA1)
-#VERSION_FLAGS += -D$(GIT_VERSION)=1
-#CFLAGS += ${VERSION_FLAGS}
-
-CPPFLAGS=$(CFLAGS)
-
-
-LIB+=-lMESA_handle_logger
-LIB+=-lMESA_prof_load
-LIB+=-lrdkafka
-#LIB+=-lcjson
-LIB+=-lcJSON
-LIB+=-ldl
-
-ifdef ASAN
-LIB+=-lasan
-endif
-
-SOURCES=$(wildcard *.c)
-OBJECTS=$(SOURCES:.c=.o)
-DEPS=$(SOURCES:.c=.d)
-
-#target name
-TARGET=ntc_ip_comm.so
-
-.PHONY:clean all
-
-all:$(TARGET)
-
-$(TARGET):$(OBJECTS) $(LIB_FILE)
- $(CC) -shared $(CFLAGS) $(OBJECTS) $(LIB) -Wl,--version-script=./version.map -o $@
-#copy target to dest dir
- @awk '/VERSION_20/{print $$2}' $(SOURCES) |xargs -i echo -e "make \033[32;49;1m$@({})\033[32;49;0m \033[31;49;1m[success]\033[31;49;0m"
- @cp -f $@ ../bin
- @echo -e "copy \033[32;49;1m$@\033[32;49;0m to ../bin\033[31;49;1m[success]\033[31;49;0m"
-
-.c.o:
-
-%.d:%.c
- $(CC) $< -MM $(INCLUDEPATH) > $@
-
--include $(DEPS)
-
-clean :
- rm -f $(OBJECTS) $(DEPS) $(TARGET)
diff --git a/src/ntc_ip_comm.cpp b/src/ntc_ip_comm.cpp
index b758995..77415f5 100644
--- a/src/ntc_ip_comm.cpp
+++ b/src/ntc_ip_comm.cpp
@@ -22,6 +22,7 @@
#include "MESA_prof_load.h"
#include "MESA_handle_logger.h"
#include "field_stat2.h"
+#include "stream_internal.h"
#include <rdkafka.h>
#include <cJSON.h>
@@ -165,7 +166,8 @@ static int soq_addStreamInfo_to_jsonObj(cJSON *json_obj, const struct streaminfo
}
-void ntc_ip_comm_send_kafka_log(rd_kafka_topic_t *topic, struct streaminfo *a_stream, comm_context_t *ctx, char *dpkt_buf, int dpkt_buflen)
+void ntc_ip_comm_send_kafka_log(rd_kafka_topic_t *topic, struct streaminfo *a_stream, comm_context_t *ctx, char
+ *dpkt_buf, int dpkt_buflen, char *user_buf, int user_buflen)
{
cJSON *log_obj = cJSON_CreateObject();
@@ -195,12 +197,12 @@ void ntc_ip_comm_send_kafka_log(rd_kafka_topic_t *topic, struct streaminfo *a_st
cJSON_AddNumberToObject(log_obj, "create_time", a_stream->ptcpdetail->createtime);
cJSON_AddNumberToObject(log_obj, "lastmtime", a_stream->ptcpdetail->lastmtime);
-
- char user_region_buf[4096] = " ";
- snprintf(user_region_buf,sizeof(user_region_buf), "thread=%d;index=%d;hash=%d;", a_stream->threadnum, a_stream->stream_index, a_stream->hash_index);
- //cJSON_AddNumberToObject(log_obj, "user_region", a_stream->threadnum);
- cJSON_AddStringToObject(log_obj, "user_region", user_region_buf);
-
+
+ if(user_buflen > 0)
+ {
+ cJSON_AddStringToObject(log_obj, "user_region", user_buf);
+ }
+
//char *payload = cJSON_Print(log_obj);
char *payload = cJSON_PrintUnformatted(log_obj);
int paylen = strlen(payload);
@@ -215,7 +217,7 @@ void ntc_ip_comm_send_kafka_log(rd_kafka_topic_t *topic, struct streaminfo *a_st
return ;
}
-void ntc_ip_comm_send_ntc_log(struct streaminfo *a_stream, comm_context_t *ctx, char *dpkt_buf, int dpkt_buflen)
+void ntc_ip_comm_send_ntc_log(struct streaminfo *a_stream, comm_context_t *ctx, char *dpkt_buf, int dpkt_buflen, char *user_buf, int user_buflen)
{
soq_log_t log_msg;
Maat_rule_t maat_rule;
@@ -232,8 +234,13 @@ void ntc_ip_comm_send_ntc_log(struct streaminfo *a_stream, comm_context_t *ctx,
maat_rule.config_id = 0;
maat_rule.service_id = g_ntc_ip_comm_item.service;
maat_rule.do_log = 1;
- snprintf(maat_rule.service_defined,sizeof(maat_rule.service_defined),"thread=%d;index=%d;hash=%d;", a_stream->threadnum, a_stream->stream_index, a_stream->hash_index);
- log_msg.stream = a_stream;
+
+ if(user_buflen > 0)
+ {
+ snprintf(maat_rule.service_defined,sizeof(maat_rule.service_defined),"%s", user_buf);
+ }
+
+ log_msg.stream = a_stream;
log_msg.result = &maat_rule;
log_msg.result_num =1;
@@ -268,6 +275,27 @@ void ntc_ip_comm_send_ntc_log(struct streaminfo *a_stream, comm_context_t *ctx,
return;
}
+int ntc_ip_comm_assemble_user_buf(struct streaminfo *a_stream, char *user_buf, int *user_buflen)
+{
+ if(a_stream == NULL)
+ {
+ *user_buflen = 0;
+ return -1;
+ }
+
+ int killed_flag = 0;
+ if(g_ntc_ip_comm_item.after_kill_switch == 1)
+ {
+ struct streaminfo_private *pstream_pr = (struct streaminfo_private *)a_stream;
+ if(pstream_pr->stream_killed_flag == 1)
+ {
+ killed_flag = 1;
+ }
+ }
+ snprintf(user_buf, *user_buflen, "thread=%d;index=%d;hash=%d;killed=%d", a_stream->threadnum,
+ a_stream->stream_index, a_stream->hash_index, killed_flag);
+ return 0;
+}
int ntc_ip_comm_get_dpkt_label(struct streaminfo *a_stream, const char* label_name, char *label_buf, int *label_buflen)
{
@@ -345,13 +373,18 @@ void ntc_ip_comm_judge_counter(comm_context_t *ctx, struct streaminfo *a_stream)
return;
}
-extern "C" UCHAR ntc_ip_comm_transfer_entry(struct streaminfo *a_stream, void **pme, int thread_seq,const void *raw_pkt)
+
+
+UCHAR ntc_ip_comm_transfer_process(struct streaminfo *a_stream, void **pme, int thread_seq,const void *raw_pkt,
+ UCHAR opstate)
{
unsigned char ret = APP_STATE_GIVEME;
char label_buf[128] = {0};
- int label_buflen = sizeof(label_buf);
+ char user_buf[128] = {0};
+ int label_buflen = sizeof(label_buf);
+ int user_buflen = sizeof(user_buf);
comm_context_t *ctx = NULL;
- switch (a_stream->opstate)
+ switch (opstate)
{
case OP_STATE_PENDING:
ctx = (comm_context_t *)calloc(sizeof(comm_context_t ), 1);
@@ -370,15 +403,16 @@ extern "C" UCHAR ntc_ip_comm_transfer_entry(struct streaminfo *a_stream, void *
ntc_ip_comm_judge_counter(ctx, a_stream);
if(ctx->c2s_bytes+ctx->s2c_bytes >= g_ntc_ip_comm_item.min_bytes &&ctx->c2s_pkts+ctx->s2c_pkts >= g_ntc_ip_comm_item.min_pkts)
{
- ntc_ip_comm_get_dpkt_label(a_stream, g_ntc_ip_comm_item.dpkt_label, label_buf, &label_buflen);
- if((g_ntc_ip_comm_item.comm_log_mode&SEND_LOG) == SEND_LOG)
+ ntc_ip_comm_get_dpkt_label(a_stream, g_ntc_ip_comm_item.dpkt_label, label_buf, &label_buflen);
+ ntc_ip_comm_assemble_user_buf(a_stream, user_buf, &user_buflen);
+ if((g_ntc_ip_comm_item.comm_log_mode&SEND_LOG) == SEND_LOG)
{
- ntc_ip_comm_send_ntc_log(a_stream, ctx, label_buf, label_buflen);
+ ntc_ip_comm_send_ntc_log(a_stream, ctx, label_buf, label_buflen, user_buf, user_buflen);
}
- //if((g_ntc_ip_comm_item.comm_log_mode&SEND_KAFKA) == SEND_KAFKA)
else
{
- ntc_ip_comm_send_kafka_log(g_ntc_ip_comm_kafka_topic, a_stream, ctx, label_buf, label_buflen);
+ ntc_ip_comm_send_kafka_log(g_ntc_ip_comm_kafka_topic, a_stream, ctx, label_buf,
+ label_buflen, user_buf, user_buflen);
}
}
free(ctx);
@@ -390,6 +424,24 @@ extern "C" UCHAR ntc_ip_comm_transfer_entry(struct streaminfo *a_stream, void *
return ret ;
}
+extern "C" UCHAR ntc_ip_comm_tcpall_entry(struct streaminfo *a_stream, void **pme, int thread_seq,const void *raw_pkt)
+{
+ if(g_ntc_ip_comm_item.after_kill_switch == 1)
+ {
+ if(a_stream->pktstate == OP_STATE_PENDING)
+ {
+ unsigned char mopt = 1;
+ MESA_set_stream_opt(a_stream, MSO_TCPALL_VALID_AFTER_KILL, &mopt, sizeof(mopt));
+ }
+ }
+ return ntc_ip_comm_transfer_process(a_stream, pme, thread_seq, raw_pkt, a_stream->pktstate);
+}
+
+extern "C" UCHAR ntc_ip_comm_transfer_entry(struct streaminfo *a_stream, void **pme, int thread_seq,const void *raw_pkt)
+{
+ return ntc_ip_comm_transfer_process(a_stream, pme, thread_seq, raw_pkt, a_stream->opstate);
+}
+
void ntc_ip_comm_load_profile()
{
MESA_load_profile_string_def(PROFILE_PATH, PLUGIN_NAME, "log_path", g_ntc_ip_comm_item.log_path, sizeof(g_ntc_ip_comm_item.log_path), "./t1log/ip_comm_log");
@@ -412,7 +464,9 @@ void ntc_ip_comm_load_profile()
MESA_load_profile_int_def(PROFILE_PATH,PLUGIN_NAME, "service", &g_ntc_ip_comm_item.service, 0);
- MESA_load_profile_uint_def(PROFILE_PATH,PLUGIN_NAME, "comm_log_mode", &g_ntc_ip_comm_item.comm_log_mode, 0);
+ MESA_load_profile_int_def(PROFILE_PATH,PLUGIN_NAME, "after_kill_switch", &g_ntc_ip_comm_item.after_kill_switch, 0);
+
+ MESA_load_profile_uint_def(PROFILE_PATH,PLUGIN_NAME, "comm_log_mode", &g_ntc_ip_comm_item.comm_log_mode, 0);
MESA_load_profile_string_def(PROFILE_PATH, PLUGIN_NAME, "dpkt_label", g_ntc_ip_comm_item.dpkt_label, sizeof(g_ntc_ip_comm_item.dpkt_label), "DPKT_PROJECT");
return ;
diff --git a/src/ntc_ip_comm.h b/src/ntc_ip_comm.h
index fc49d06..838d42f 100644
--- a/src/ntc_ip_comm.h
+++ b/src/ntc_ip_comm.h
@@ -21,6 +21,8 @@ extern "C"
char kafka_handle_name[1024];
char kafka_topic[1024];
+ int after_kill_switch;
+
unsigned int local_ip_nr;
char local_ip_str[128];
char dpkt_label[1024];