This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
stellar-stellar/src/stellar/config.cpp

539 lines
17 KiB
C++
Raw Normal View History

2024-01-29 14:15:33 +08:00
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include "toml.h"
// return 0: success
// retuun -1: failed
2024-03-29 16:32:16 +08:00
static int parse_device_section(toml_table_t *root, struct device_options *opts)
2024-01-29 14:15:33 +08:00
{
const char *ptr;
2024-03-29 16:32:16 +08:00
toml_table_t *table;
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
table = toml_table_in(root, "device");
if (table == NULL)
2024-01-29 14:15:33 +08:00
{
CONFIG_LOG_ERROR("config file missing device section");
2024-01-29 14:15:33 +08:00
return -1;
}
2024-04-11 16:30:21 +08:00
ptr = toml_raw_in(table, "base");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-04-11 16:30:21 +08:00
CONFIG_LOG_ERROR("config file missing device->base");
2024-01-29 14:15:33 +08:00
return -1;
}
2024-04-11 16:30:21 +08:00
opts->base = atoi(ptr);
2024-01-29 14:15:33 +08:00
2024-04-11 16:30:21 +08:00
ptr = toml_raw_in(table, "offset");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-04-11 16:30:21 +08:00
CONFIG_LOG_ERROR("config file missing device->offset");
2024-01-29 14:15:33 +08:00
return -1;
}
2024-04-11 16:30:21 +08:00
opts->offset = atoi(ptr);
2024-01-29 14:15:33 +08:00
return 0;
}
// return 0: success
// retuun -1: failed
2024-03-29 16:32:16 +08:00
static int parse_packet_io_section(toml_table_t *root, struct packet_io_options *opts)
{
const char *ptr;
2024-03-29 16:32:16 +08:00
toml_table_t *table;
toml_array_t *mask_array;
2024-03-29 16:32:16 +08:00
table = toml_table_in(root, "packet_io");
if (table == NULL)
2024-01-31 14:45:50 +08:00
{
CONFIG_LOG_ERROR("config file missing packet_io section");
2024-01-31 14:45:50 +08:00
return -1;
}
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "mode");
2024-01-31 14:45:50 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing packet_io->mode");
2024-01-31 14:45:50 +08:00
return -1;
}
if (strcmp(ptr, "dumpfile") == 0)
{
opts->mode = PACKET_IO_DUMPFILE;
}
else if (strcmp(ptr, "marsio") == 0)
{
opts->mode = PACKET_IO_MARSIO;
}
else
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file invalid packet_io->mode %s, only support dumpfile and marsio", ptr);
return -1;
}
if (opts->mode == PACKET_IO_DUMPFILE)
{
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "dumpfile_dir");
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing packet_io->dumpfile_dir");
return -1;
}
// skip ""
strncpy(opts->dumpfile_dir, ptr + 1, strlen(ptr) - 2);
}
else
{
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "app_symbol");
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing packet_io->app_symbol");
return -1;
}
strncpy(opts->app_symbol, ptr, sizeof(opts->app_symbol) - 1);
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "dev_symbol");
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing packet_io->dev_symbol");
return -1;
}
strncpy(opts->dev_symbol, ptr, sizeof(opts->dev_symbol) - 1);
}
2024-01-31 14:45:50 +08:00
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "nr_threads");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing packet_io->nr_threads");
2024-01-29 14:15:33 +08:00
return -1;
}
2024-01-31 14:45:50 +08:00
if (atoi(ptr) <= 0 || atoi(ptr) > MAX_THREAD_NUM)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file invalid packet_io->nr_threads %d, range [1, %d]", atoi(ptr), MAX_THREAD_NUM);
2024-01-31 14:45:50 +08:00
return -1;
}
opts->nr_threads = atoi(ptr);
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
mask_array = toml_array_in(table, "cpu_mask");
2024-01-29 14:15:33 +08:00
if (mask_array == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing packet_io->cpu_mask");
2024-01-29 14:15:33 +08:00
return -1;
}
for (uint8_t i = 0; i < opts->nr_threads; i++)
2024-01-29 14:15:33 +08:00
{
ptr = toml_raw_at(mask_array, i);
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing packet_io->cpu_mask[%d]", i);
2024-01-29 14:15:33 +08:00
return -1;
}
opts->cpu_mask[i] = atoi(ptr);
}
return 0;
}
// return 0: success
// retuun -1: failed
2024-03-29 16:32:16 +08:00
static int parse_ip_reassembly_section(toml_table_t *root, struct ip_reassembly_options *opts)
{
const char *ptr;
2024-03-29 16:32:16 +08:00
toml_table_t *table;
2024-03-29 16:32:16 +08:00
table = toml_table_in(root, "ip_reassembly");
if (table == NULL)
{
2024-03-08 13:55:17 +08:00
CONFIG_LOG_ERROR("config file missing ip_reassembly section");
return -1;
}
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "enable");
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing ip_reassembly->enable");
return -1;
}
opts->enable = atoi(ptr);
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "timeout");
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing ip_reassembly->timeout");
return -1;
}
opts->timeout = atoi(ptr);
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "bucket_entries");
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing ip_reassembly->bucket_entries");
return -1;
}
opts->bucket_entries = atoi(ptr);
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "bucket_num");
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing ip_reassembly->bucket_num");
return -1;
2024-01-29 14:15:33 +08:00
}
opts->bucket_num = atoi(ptr);
2024-01-29 14:15:33 +08:00
return 0;
}
// return 0: success
// retuun -1: failed
2024-03-29 16:32:16 +08:00
static int parse_session_manager_section(toml_table_t *root, struct session_manager_options *opts)
2024-01-29 14:15:33 +08:00
{
const char *ptr;
2024-03-29 16:32:16 +08:00
toml_table_t *table;
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
table = toml_table_in(root, "session_manager");
if (table == NULL)
2024-01-29 14:15:33 +08:00
{
CONFIG_LOG_ERROR("config file missing session_manager section");
return -1;
}
// max session number
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "max_tcp_session_num");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->max_tcp_session_num");
2024-01-29 14:15:33 +08:00
return -1;
}
opts->max_tcp_session_num = atoll(ptr);
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "max_udp_session_num");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->max_udp_session_num");
2024-01-29 14:15:33 +08:00
return -1;
}
opts->max_udp_session_num = atoll(ptr);
2024-01-29 14:15:33 +08:00
// session overload (1: evict old session, 0: bypass new session)
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "tcp_overload_evict_old_sess");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->tcp_overload_evict_old_sess");
2024-01-29 14:15:33 +08:00
return -1;
}
opts->tcp_overload_evict_old_sess = atoi(ptr);
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "udp_overload_evict_old_sess");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->udp_overload_evict_old_sess");
2024-01-29 14:15:33 +08:00
return -1;
}
opts->udp_overload_evict_old_sess = atoi(ptr);
2024-01-29 14:15:33 +08:00
// TCP timeout
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "tcp_init_timeout");
if (ptr == NULL)
{
CONFIG_LOG_ERROR("config file missing session_manager->tcp_init_timeout");
return -1;
}
opts->tcp_init_timeout = atoll(ptr);
ptr = toml_raw_in(table, "tcp_handshake_timeout");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->tcp_handshake_timeout");
2024-01-29 14:15:33 +08:00
return -1;
}
2024-03-29 16:32:16 +08:00
opts->tcp_handshake_timeout = atoll(ptr);
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "tcp_data_timeout");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->tcp_data_timeout");
2024-01-29 14:15:33 +08:00
return -1;
}
2024-03-29 16:32:16 +08:00
opts->tcp_data_timeout = atoll(ptr);
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "tcp_half_closed_timeout");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->tcp_half_closed_timeout");
2024-01-29 14:15:33 +08:00
return -1;
}
2024-03-29 16:32:16 +08:00
opts->tcp_half_closed_timeout = atoll(ptr);
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "tcp_time_wait_timeout");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->tcp_time_wait_timeout");
2024-01-29 14:15:33 +08:00
return -1;
}
2024-03-29 16:32:16 +08:00
opts->tcp_time_wait_timeout = atoll(ptr);
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "tcp_discard_timeout");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->tcp_discard_timeout");
2024-01-29 14:15:33 +08:00
return -1;
}
2024-03-29 16:32:16 +08:00
opts->tcp_discard_timeout = atoll(ptr);
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "tcp_unverified_rst_timeout");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->tcp_unverified_rst_timeout");
2024-01-29 14:15:33 +08:00
return -1;
}
2024-03-29 16:32:16 +08:00
opts->tcp_unverified_rst_timeout = atoll(ptr);
2024-01-29 14:15:33 +08:00
// UDP timeout
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "udp_data_timeout");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->udp_data_timeout");
2024-01-29 14:15:33 +08:00
return -1;
}
2024-03-29 16:32:16 +08:00
opts->udp_data_timeout = atoll(ptr);
2024-01-29 14:15:33 +08:00
ptr = toml_raw_in(table, "udp_discard_timeout");
if (ptr == NULL)
{
CONFIG_LOG_ERROR("config file missing session_manager->udp_discard_timeout");
return -1;
}
opts->udp_discard_timeout = atoll(ptr);
// duplicate packet filter
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "duplicated_packet_filter_enable");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->duplicated_packet_filter_enable");
2024-01-29 14:15:33 +08:00
return -1;
}
opts->duplicated_packet_filter_enable = atoi(ptr);
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "duplicated_packet_filter_capacity");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->duplicated_packet_filter_capacity");
2024-01-29 14:15:33 +08:00
return -1;
}
opts->duplicated_packet_filter_capacity = atoi(ptr);
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "duplicated_packet_filter_timeout");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->duplicated_packet_filter_timeout");
2024-01-29 14:15:33 +08:00
return -1;
}
opts->duplicated_packet_filter_timeout = atoi(ptr);
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "duplicated_packet_filter_error_rate");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->duplicated_packet_filter_error_rate");
2024-01-29 14:15:33 +08:00
return -1;
}
opts->duplicated_packet_filter_error_rate = atof(ptr);
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
// eviction session filter
ptr = toml_raw_in(table, "evicted_session_filter_enable");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->evicted_session_filter_enable");
2024-01-29 14:15:33 +08:00
return -1;
}
opts->evicted_session_filter_enable = atoi(ptr);
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "evicted_session_filter_capacity");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->evicted_session_filter_capacity");
2024-01-29 14:15:33 +08:00
return -1;
}
opts->evicted_session_filter_capacity = atoi(ptr);
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "evicted_session_filter_timeout");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->evicted_session_filter_timeout");
2024-01-29 14:15:33 +08:00
return -1;
}
opts->evicted_session_filter_timeout = atoi(ptr);
2024-01-29 14:15:33 +08:00
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "evicted_session_filter_error_rate");
2024-01-29 14:15:33 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->evicted_session_filter_error_rate");
2024-01-29 14:15:33 +08:00
return -1;
}
opts->evicted_session_filter_error_rate = atof(ptr);
2024-01-29 14:15:33 +08:00
2024-03-26 15:09:03 +08:00
// TCP reassembly
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "tcp_reassembly_enable");
2024-03-26 15:09:03 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->tcp_reassembly_enable");
2024-03-26 15:09:03 +08:00
return -1;
}
opts->tcp_reassembly_enable = atoi(ptr);
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "tcp_reassembly_max_timeout");
2024-03-26 15:09:03 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->tcp_reassembly_max_timeout");
2024-03-26 15:09:03 +08:00
return -1;
}
opts->tcp_reassembly_max_timeout = atoi(ptr);
2024-03-29 16:32:16 +08:00
ptr = toml_raw_in(table, "tcp_reassembly_max_segments");
2024-03-26 15:09:03 +08:00
if (ptr == NULL)
{
2024-03-29 16:32:16 +08:00
CONFIG_LOG_ERROR("config file missing session_manager->tcp_reassembly_max_segments");
2024-03-26 15:09:03 +08:00
return -1;
}
opts->tcp_reassembly_max_segments = atoi(ptr);
2024-01-29 14:15:33 +08:00
return 0;
}
// return 0: success
// retuun -1: failed
int stellar_load_config(const char *file, struct stellar_config *config)
2024-01-29 14:15:33 +08:00
{
int ret = -1;
char errbuf[200];
FILE *fp = NULL;
toml_table_t *table = NULL;
memset(config, 0, sizeof(*config));
2024-01-29 14:15:33 +08:00
fp = fopen(file, "r");
2024-01-29 14:15:33 +08:00
if (fp == NULL)
{
CONFIG_LOG_ERROR("open config file %s failed, %s", file, strerror(errno));
2024-01-29 14:15:33 +08:00
goto error_out;
}
table = toml_parse_file(fp, errbuf, sizeof(errbuf));
if (table == NULL)
2024-01-29 14:15:33 +08:00
{
CONFIG_LOG_ERROR("parse config file %s failed, %s", file, errbuf);
2024-01-29 14:15:33 +08:00
goto error_out;
}
2024-04-11 16:30:21 +08:00
if (parse_device_section(table, &config->dev_opts) != 0)
2024-01-29 14:15:33 +08:00
{
goto error_out;
}
2024-04-11 16:30:21 +08:00
if (parse_packet_io_section(table, &config->io_opts) != 0)
{
goto error_out;
}
2024-04-11 16:30:21 +08:00
if (parse_ip_reassembly_section(table, &config->ip_opts) != 0)
{
goto error_out;
}
2024-04-11 16:30:21 +08:00
if (parse_session_manager_section(table, &config->sess_mgr_opts) != 0)
2024-01-29 14:15:33 +08:00
{
goto error_out;
}
ret = 0;
error_out:
if (table)
2024-01-29 14:15:33 +08:00
{
toml_free(table);
2024-01-29 14:15:33 +08:00
}
if (fp)
{
fclose(fp);
}
return ret;
}
void stellar_print_config(struct stellar_config *config)
2024-01-29 14:15:33 +08:00
{
if (config == NULL)
2024-01-29 14:15:33 +08:00
{
return;
}
2024-04-11 16:30:21 +08:00
struct device_options *dev_opts = &config->dev_opts;
struct packet_io_options *io_opts = &config->io_opts;
struct ip_reassembly_options *ip_opts = &config->ip_opts;
struct session_manager_options *sess_mgr_opts = &config->sess_mgr_opts;
2024-01-29 14:15:33 +08:00
// device config
2024-04-11 16:30:21 +08:00
CONFIG_LOG_DEBUG("device->base : %d", dev_opts->base);
CONFIG_LOG_DEBUG("device->offset : %d", dev_opts->offset);
2024-01-29 14:15:33 +08:00
// packet io config
2024-04-11 16:30:21 +08:00
CONFIG_LOG_DEBUG("packet_io->mode : %s", io_opts->mode == PACKET_IO_DUMPFILE ? "dumpfile" : "marsio");
if (io_opts->mode == PACKET_IO_DUMPFILE)
{
2024-04-11 16:30:21 +08:00
CONFIG_LOG_DEBUG("packet_io->dumpfile_dir : %s", io_opts->dumpfile_dir);
}
else
{
2024-04-11 16:30:21 +08:00
CONFIG_LOG_DEBUG("packet_io->app_symbol : %s", io_opts->app_symbol);
CONFIG_LOG_DEBUG("packet_io->dev_symbol : %s", io_opts->dev_symbol);
}
2024-04-11 16:30:21 +08:00
CONFIG_LOG_DEBUG("packet_io->nr_threads : %d", io_opts->nr_threads);
for (uint8_t i = 0; i < io_opts->nr_threads; i++)
{
2024-04-11 16:30:21 +08:00
CONFIG_LOG_DEBUG("packet_io->cpu_mask[%03d] : %d", i, io_opts->cpu_mask[i]);
}
2024-01-29 14:15:33 +08:00
// ip reassemble config
2024-04-11 16:30:21 +08:00
CONFIG_LOG_DEBUG("ip_reassembly->enable : %d", ip_opts->enable);
CONFIG_LOG_DEBUG("ip_reassembly->timeout : %d", ip_opts->timeout);
CONFIG_LOG_DEBUG("ip_reassembly->bucket_entries : %d", ip_opts->bucket_entries);
CONFIG_LOG_DEBUG("ip_reassembly->bucket_num : %d", ip_opts->bucket_num);
2024-03-29 16:32:16 +08:00
// session manager config -> max session number
2024-04-11 16:30:21 +08:00
CONFIG_LOG_DEBUG("session_manager->max_tcp_session_num : %ld", sess_mgr_opts->max_tcp_session_num);
CONFIG_LOG_DEBUG("session_manager->max_udp_session_num : %ld", sess_mgr_opts->max_udp_session_num);
2024-03-29 16:32:16 +08:00
// session manager config -> session overload evict
2024-04-11 16:30:21 +08:00
CONFIG_LOG_DEBUG("session_manager->tcp_overload_evict_old_sess : %d", sess_mgr_opts->tcp_overload_evict_old_sess);
CONFIG_LOG_DEBUG("session_manager->udp_overload_evict_old_sess : %d", sess_mgr_opts->udp_overload_evict_old_sess);
2024-03-29 16:32:16 +08:00
// session manager config -> session timeout
2024-04-11 16:30:21 +08:00
CONFIG_LOG_DEBUG("session_manager->tcp_init_timeout : %ld", sess_mgr_opts->tcp_init_timeout);
CONFIG_LOG_DEBUG("session_manager->tcp_handshake_timeout : %ld", sess_mgr_opts->tcp_handshake_timeout);
CONFIG_LOG_DEBUG("session_manager->tcp_data_timeout : %ld", sess_mgr_opts->tcp_data_timeout);
CONFIG_LOG_DEBUG("session_manager->tcp_half_closed_timeout : %ld", sess_mgr_opts->tcp_half_closed_timeout);
CONFIG_LOG_DEBUG("session_manager->tcp_time_wait_timeout : %ld", sess_mgr_opts->tcp_time_wait_timeout);
CONFIG_LOG_DEBUG("session_manager->tcp_discard_timeout : %ld", sess_mgr_opts->tcp_discard_timeout);
CONFIG_LOG_DEBUG("session_manager->tcp_unverified_rst_timeout : %ld", sess_mgr_opts->tcp_unverified_rst_timeout);
CONFIG_LOG_DEBUG("session_manager->udp_data_timeout : %ld", sess_mgr_opts->udp_data_timeout);
CONFIG_LOG_DEBUG("session_manager->udp_discard_timeout : %ld", sess_mgr_opts->udp_discard_timeout);
2024-03-29 16:32:16 +08:00
// session manager config -> duplicated packet filter
2024-04-11 16:30:21 +08:00
CONFIG_LOG_DEBUG("session_manager->duplicated_packet_filter_enable : %d", sess_mgr_opts->duplicated_packet_filter_enable);
CONFIG_LOG_DEBUG("session_manager->duplicated_packet_filter_capacity : %d", sess_mgr_opts->duplicated_packet_filter_capacity);
CONFIG_LOG_DEBUG("session_manager->duplicated_packet_filter_timeout : %d", sess_mgr_opts->duplicated_packet_filter_timeout);
CONFIG_LOG_DEBUG("session_manager->duplicated_packet_filter_error_rate : %f", sess_mgr_opts->duplicated_packet_filter_error_rate);
2024-03-29 16:32:16 +08:00
// session manager config -> evicted session filter
2024-04-11 16:30:21 +08:00
CONFIG_LOG_DEBUG("session_manager->evicted_session_filter_enable : %d", sess_mgr_opts->evicted_session_filter_enable);
CONFIG_LOG_DEBUG("session_manager->evicted_session_filter_capacity : %d", sess_mgr_opts->evicted_session_filter_capacity);
CONFIG_LOG_DEBUG("session_manager->evicted_session_filter_timeout : %d", sess_mgr_opts->evicted_session_filter_timeout);
CONFIG_LOG_DEBUG("session_manager->evicted_session_filter_error_rate : %f", sess_mgr_opts->evicted_session_filter_error_rate);
2024-03-29 16:32:16 +08:00
// session manager config -> TCP reassembly
2024-04-11 16:30:21 +08:00
CONFIG_LOG_DEBUG("session_manager->tcp_reassembly_enable : %d", sess_mgr_opts->tcp_reassembly_enable);
CONFIG_LOG_DEBUG("session_manager->tcp_reassembly_max_timeout : %d", sess_mgr_opts->tcp_reassembly_max_timeout);
CONFIG_LOG_DEBUG("session_manager->tcp_reassembly_max_segments : %d", sess_mgr_opts->tcp_reassembly_max_segments);
2024-01-29 14:15:33 +08:00
}