diff options
| author | liuxueli <[email protected]> | 2020-05-15 17:33:29 +0800 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2020-05-15 17:33:29 +0800 |
| commit | eadf2aa34853b6b037bc388a87eac6982aab802a (patch) | |
| tree | 8a1fc6d590fa3697a602afe81d454f6f84e6c12d /src/tsg_statistic.cpp | |
| parent | 539a9d2833c3497351c4e4e7d31fa2f96e63d23b (diff) | |
为了保证pinnigl链接计数时间与intecept的链接计数时间保持一致,提供tsg_set_intercept_flow函数
Diffstat (limited to 'src/tsg_statistic.cpp')
| -rw-r--r-- | src/tsg_statistic.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tsg_statistic.cpp b/src/tsg_statistic.cpp index 92e54ec..67a787a 100644 --- a/src/tsg_statistic.cpp +++ b/src/tsg_statistic.cpp @@ -12,6 +12,24 @@ tsg_statis_para_t g_tsg_statis_para; +int tsg_set_intercept_flow(Maat_rule_t *p_result, struct _traffic_info *traffic_info, int thread_seq) +{ + struct _traffic_info *_info=NULL; + + if(p_result!=NULL && traffic_info!=NULL && thread_seq>=0) + { + _info=&(g_tsg_statis_para.traffic_info[(unsigned char)p_result->action][thread_seq]); + + _info->con_num+=traffic_info->con_num; + _info->in_bytes+=traffic_info->in_bytes; + _info->in_packets+=traffic_info->in_packets; + _info->out_bytes+=traffic_info->out_bytes; + _info->out_packets+=traffic_info->out_packets; + } + + return 0; +} + int tsg_set_policy_flow(struct streaminfo *a_stream, Maat_rule_t *p_result, int thread_seq) { unsigned long long value=0; |
