diff options
| author | liuxueli <[email protected]> | 2020-09-28 19:43:37 +0800 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2020-09-28 19:43:37 +0800 |
| commit | 5fcfdaeafeede77e8ffd320493d5ad7e4a9aaf73 (patch) | |
| tree | 64ef1c8de42d2421bf872a9d27be329eaec52916 | |
| parent | 38cae269e8a78a95ec5fb7f1e7f0bc4b2d468095 (diff) | |
支持输出internal/external状态: https://jira.geedge.net/browse/TSG-3454v3.3.0.20.10
| -rw-r--r-- | src/tsg_send_log.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
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; } |
