diff options
| author | wangmenglan <[email protected]> | 2024-07-24 10:01:47 +0800 |
|---|---|---|
| committer | wangmenglan <[email protected]> | 2024-07-25 11:57:23 +0800 |
| commit | a59b9390336dafa0ee1f05e74e52411d175b9843 (patch) | |
| tree | 997be250693aad7ccf6900ad280f8a4b58b3b9ca /common/src/tfe_session_table.cpp | |
| parent | dc1ec1dbb3eeb9589ace653dcffba72b9fbfd284 (diff) | |
TSG-21855 使用fieldstat4序列化Intercept Policy的metric并输出到kafka
Diffstat (limited to 'common/src/tfe_session_table.cpp')
| -rw-r--r-- | common/src/tfe_session_table.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/common/src/tfe_session_table.cpp b/common/src/tfe_session_table.cpp index 46df666..237537b 100644 --- a/common/src/tfe_session_table.cpp +++ b/common/src/tfe_session_table.cpp @@ -211,3 +211,18 @@ struct session_node *session_table_search_by_addr(struct session_table *table, c return temp; } + +void session_foreach(struct session_table *table, void (*func)(struct session_node *, void *), void *ctx) +{ + struct session_node *temp = NULL; + struct session_node *node = NULL; + + if (!func) + return; + + HASH_ITER(hh1, table->root_by_id, node, temp) + { + func(node, ctx); + } + return; +}
\ No newline at end of file |
