summaryrefslogtreecommitdiff
path: root/common/include/utils.h
diff options
context:
space:
mode:
authorroot <[email protected]>2023-09-28 02:22:51 +0000
committerroot <[email protected]>2023-09-28 02:22:51 +0000
commit38e67120f364de179945cc677d8d3333cb397c21 (patch)
tree51b5e1841f027a64c7a5b01377b32ecd26b7e2a4 /common/include/utils.h
parente510917ce787526063bd72dee7ffe661db914142 (diff)
add timer for each session, to refresh stat when no packet coming
Diffstat (limited to 'common/include/utils.h')
-rw-r--r--common/include/utils.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/include/utils.h b/common/include/utils.h
index 0f257a5..c03b291 100644
--- a/common/include/utils.h
+++ b/common/include/utils.h
@@ -8,6 +8,12 @@ extern "C"
#define MIN(a, b) ((a) > (b) ? (b) : (a))
+#ifndef container_of
+#define container_of(ptr, type, member) ({ \
+ const typeof( ((type *)0)->member ) *__mptr = (ptr); \
+ (type *)( (char *)__mptr - offsetof(type,member) );})
+#endif
+
#define LOG_TAG_SHAPING "SHAPING"
#define LOG_TAG_SWARMKV "SWARMKV"
#define LOG_TAG_STAT "STAT"