diff options
| author | lijia <[email protected]> | 2021-03-25 17:48:25 +0800 |
|---|---|---|
| committer | lijia <[email protected]> | 2021-03-25 17:48:25 +0800 |
| commit | 04dbaa7372fe18b3c2333c204ff9faf18d9d71c7 (patch) | |
| tree | 5757cbe9158086a056b3351de193e3c9e002631c /src/config/config_parse.cpp | |
| parent | b3aaf1bf758ef5d39cf14f1d82220dd922e454cc (diff) | |
增加重复流量识别功能, 基于bloom filter.
Diffstat (limited to 'src/config/config_parse.cpp')
| -rw-r--r-- | src/config/config_parse.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/config/config_parse.cpp b/src/config/config_parse.cpp index 85d9796..002bceb 100644 --- a/src/config/config_parse.cpp +++ b/src/config/config_parse.cpp @@ -1417,6 +1417,15 @@ int sapp_parse_config(void) tomlc99_wrap_load_int_def(default_config_file, (char *)"packet_io.polling", (char *)"enabled", &pconfig->packet_io.polling_enabled, 1); tomlc99_wrap_load_int_def(default_config_file, (char *)"packet_io.polling", (char *)"polling_priority", &pconfig->packet_io.polling_priority, 100); + /** duplicate packet config **/ + tomlc99_wrap_load_int_def(default_config_file, (char *)"DUPLICATE_PKT", (char *)"duplicate_pkt_distinguish", &pconfig->packet_io.dup_pkt_para.dup_pkt_distinguish_enable, 0); + if(pconfig->packet_io.dup_pkt_para.dup_pkt_distinguish_enable != 0){ + tomlc99_wrap_load_int_def(default_config_file, (char *)"DUPLICATE_PKT", (char *)"bloom_capacity", &pconfig->packet_io.dup_pkt_para.bloom_capacity, 1000000); + tomlc99_wrap_load_int_def(default_config_file, (char *)"DUPLICATE_PKT", (char *)"bloom_timeout", &pconfig->packet_io.dup_pkt_para.bloom_timeout, 10); + tomlc99_wrap_load_string_def(default_config_file, (char *)"DUPLICATE_PKT", (char *)"bloom_error_rate", str_tmp, sizeof(str_tmp), "0.00001"); + pconfig->packet_io.dup_pkt_para.bloom_error_rate = strtod(str_tmp, NULL); + } + /******************************* STREAM ******************************/ tomlc99_wrap_load_string_def(default_config_file, (char *)"STREAM", (char *)"stream_id_base_time", pconfig->stream.stream_id_base_time_str, 32, ""); |
