TSG-18285 TFE的Packet IO模块支持重复流量识别
This commit is contained in:
@@ -20,7 +20,8 @@
|
||||
#include "tfe_packet_io.h"
|
||||
#include "tfe_session_table.h"
|
||||
#include "tfe_fieldstat.h"
|
||||
|
||||
#include "dablooms.h"
|
||||
#include "timestamp.h"
|
||||
|
||||
void * g_packet_io_logger = NULL;
|
||||
|
||||
@@ -82,6 +83,12 @@ struct acceptor_kni_v4 *acceptor_ctx_create(const char *profile, void *logger)
|
||||
{
|
||||
struct acceptor_kni_v4 *ctx = ALLOC(struct acceptor_kni_v4, 1);
|
||||
|
||||
MESA_load_profile_int_def(profile, "PACKET_IO", "dup_packet_filter_enable", (int *)&(ctx->dup_packet_filter_enable), 1);
|
||||
MESA_load_profile_int_def(profile, "PACKET_IO", "dup_packet_filter_capacity", (int *)&(ctx->dup_packet_filter_capacity), 1000000);
|
||||
MESA_load_profile_int_def(profile, "PACKET_IO", "dup_packet_filter_timeout", (int *)&(ctx->dup_packet_filter_timeout), 10);
|
||||
// MESA_load_profile not support double
|
||||
ctx->dup_packet_filter_error_rate = 0.00001;
|
||||
|
||||
MESA_load_profile_int_def(profile, "PACKET_IO", "firewall_sids", (int *)&(ctx->firewall_sids), 1000);
|
||||
MESA_load_profile_int_def(profile, "PACKET_IO", "proxy_sids", (int *)&(ctx->proxy_sids), 1001);
|
||||
MESA_load_profile_int_def(profile, "PACKET_IO", "service_chaining_sids", (int *)&(ctx->sce_sids), 1002);
|
||||
@@ -240,6 +247,10 @@ struct acceptor_kni_v4 *acceptor_kni_v4_create(struct tfe_proxy *proxy, const ch
|
||||
acceptor_ctx->work_threads[i].ret_fs_state = acceptor_ctx->packet_io_fs;
|
||||
acceptor_ctx->work_threads[i].logger = packet_io_logger;
|
||||
acceptor_ctx->work_threads[i].session_table_need_reset = 0;
|
||||
if (acceptor_ctx->dup_packet_filter_enable)
|
||||
{
|
||||
acceptor_ctx->work_threads[i].dup_packet_filter = expiry_dablooms_init(acceptor_ctx->dup_packet_filter_capacity, acceptor_ctx->dup_packet_filter_error_rate, timestamp_get_sec(), acceptor_ctx->dup_packet_filter_timeout);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < acceptor_ctx->nr_worker_threads; i++) {
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#include <watchdog_tfe.h>
|
||||
#include <key_keeper.h>
|
||||
#include <watchdog_3rd_device.h>
|
||||
#include <timestamp.h>
|
||||
|
||||
/* Breakpad */
|
||||
#include <MESA/breakpad_mini.h>
|
||||
@@ -296,6 +297,7 @@ static void __gc_handler_cb(evutil_socket_t fd, short what, void * arg)
|
||||
packet_io_fs_dump(ctx->kni_v4_acceptor->packet_io_fs);
|
||||
|
||||
FS_passive_output(ctx->fs_handle);
|
||||
timestamp_update();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -691,6 +693,8 @@ int main(int argc, char * argv[])
|
||||
struct timeval gc_delay = {statsd_cycle, 0};
|
||||
evtimer_add(g_default_proxy->gcev, &gc_delay);
|
||||
|
||||
timestamp_update();
|
||||
|
||||
/* WORKER THREAD CTX Create */
|
||||
tfe_proxy_work_thread_create_ctx(g_default_proxy);
|
||||
tfe_proxy_acceptor_init(g_default_proxy, main_profile);
|
||||
|
||||
Reference in New Issue
Block a user