From 5fcfdaeafeede77e8ffd320493d5ad7e4a9aaf73 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Mon, 28 Sep 2020 19:43:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=BE=93=E5=87=BAinternal/ex?= =?UTF-8?q?ternal=E7=8A=B6=E6=80=81:=20https://jira.geedge.net/browse/TSG-?= =?UTF-8?q?3454?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tsg_send_log.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/tsg_send_log.cpp b/src/tsg_send_log.cpp index 0a21060..0c43608 100644 --- a/src/tsg_send_log.cpp +++ b/src/tsg_send_log.cpp @@ -233,6 +233,7 @@ int set_common_field_from_label(struct tsg_log_instance_t *_instance, struct TLD int TLD_append_streaminfo(struct tsg_log_instance_t *instance, struct TLD_handle_t *handle, struct streaminfo *a_stream) { + int i_or_e=0,direction=0; int ret=0,addr_type=0; unsigned short tunnel_type=0; char nest_addr_buf[1024]; @@ -360,6 +361,35 @@ int TLD_append_streaminfo(struct tsg_log_instance_t *instance, struct TLD_handle TLD_append(_handle, _instance->id2field[LOG_COMMON_ADDRESS_LIST].name, (void *)nest_addr_buf, TLD_TYPE_STRING); set_common_field_from_label(_instance, _handle, a_stream); + + i_or_e=MESA_dir_link_to_human(a_stream->routedir); + switch(a_stream->curdir) + { + case DIR_C2S: + if(i_or_e=='E' || i_or_e=='e') + { + direction='E'; + } + else + { + direction='I'; + } + break; + case DIR_S2C: + if(i_or_e=='E' || i_or_e=='e') + { + direction='I'; + } + else + { + direction='E'; + } + break; + default: + break; + } + + TLD_append(_handle, _instance->id2field[LOG_COMMON_DIRECTION].name, (void *)(long)direction, TLD_TYPE_LONG); return 0; }