Merge remote-tracking branch 'origin/topic/jsiwek/flowbuffer-policy'

* origin/topic/jsiwek/flowbuffer-policy:
  Use a default binpac flowbuffer policy

Added options to tune binpac flowbuffer policy
This commit is contained in:
Jon Siwek 2019-04-10 09:54:27 -07:00
commit 78dcbcc71a
6 changed files with 38 additions and 7 deletions

View file

@ -891,10 +891,6 @@ int main(int argc, char** argv)
if ( events_file )
event_player = new EventPlayer(events_file);
// Must come after plugin activation (and also after hash
// initialization).
binpac::init();
init_event_handlers();
md5_type = new OpaqueType("md5");
@ -945,6 +941,17 @@ int main(int argc, char** argv)
init_net_var();
init_builtin_funcs_subdirs();
// Must come after plugin activation (and also after hash
// initialization).
binpac::FlowBuffer::Policy flowbuffer_policy;
flowbuffer_policy.max_capacity = global_scope()->Lookup(
"BinPAC::flowbuffer_capacity_max")->ID_Val()->AsCount();
flowbuffer_policy.min_capacity = global_scope()->Lookup(
"BinPAC::flowbuffer_capacity_min")->ID_Val()->AsCount();
flowbuffer_policy.contract_threshold = global_scope()->Lookup(
"BinPAC::flowbuffer_contract_threshold")->ID_Val()->AsCount();
binpac::init(&flowbuffer_policy);
plugin_mgr->InitBifs();
if ( reporter->Errors() > 0 )