diff options
| author | Qiuwen Lu <[email protected]> | 2017-06-01 10:54:17 +0800 |
|---|---|---|
| committer | Qiuwen Lu <[email protected]> | 2017-06-01 10:54:17 +0800 |
| commit | 672ab1f22e5b593fa53d1bbf65315cf019a5a79c (patch) | |
| tree | 847e60e2f9a97918e74059480ed42168e6989949 /tunnat/include | |
| parent | b83cf84f01ec09ec778146011575837fbc980d20 (diff) | |
将TunArray对象在线程上下文中保存,避免调用构造函数的开销。增加burst用户参数,避免每次收报文都使用最大的Burst参数。增加Session表的测试程序。
Diffstat (limited to 'tunnat/include')
| -rw-r--r-- | tunnat/include/session.h | 2 | ||||
| -rw-r--r-- | tunnat/include/tunnat.h | 4 | ||||
| -rw-r--r-- | tunnat/include/tunnel.h | 2 |
3 files changed, 8 insertions, 0 deletions
diff --git a/tunnat/include/session.h b/tunnat/include/session.h index 979d8c7..06b9bd2 100644 --- a/tunnat/include/session.h +++ b/tunnat/include/session.h @@ -40,4 +40,6 @@ public: protected: MESA_htable_handle ht_table_; + static int htable_comp_fun_cb(const uchar * key1, uint size1, const uchar * key2, uint size2); + static int htable_free_fun_cb(void *data); };
\ No newline at end of file diff --git a/tunnat/include/tunnat.h b/tunnat/include/tunnat.h index 7eb82d1..49f56d3 100644 --- a/tunnat/include/tunnat.h +++ b/tunnat/include/tunnat.h @@ -3,6 +3,7 @@ #include <string> #include <vector> #include <cassert> +#include <tunnel.h> extern "C" { @@ -35,6 +36,8 @@ struct TunnatInstance std::string mntfile; /* 运行数据面线程数量 */ unsigned int nr_thread; + /* Burst数量 */ + unsigned int nr_burst; /* 运行数据面线程核心掩码 */ cpu_mask_t coremask; /* 会话表最大会话数 */ @@ -173,4 +176,5 @@ struct TunnatThreadInstance TunnatInstance * instance; SessionTable * ss_table; TunnatThreadStat * th_stat; + TunnelContainerArray * tun_container_array; };
\ No newline at end of file diff --git a/tunnat/include/tunnel.h b/tunnat/include/tunnel.h index 0b060f6..5909838 100644 --- a/tunnat/include/tunnel.h +++ b/tunnat/include/tunnel.h @@ -221,4 +221,6 @@ struct TunnelContainerArray } TunnelContainerArray() : sz_array(0), sz_total_len(0) {} + + void Reset() { sz_array = 0, sz_total_len = 0; } };
\ No newline at end of file |
