Merge pull request #1522 in SNORT/snort3 from ~SMINUT/snort3:appid_service_cache to master
Squashed commit of the following:
commit
85be96aa1e48c63b2782c61f6d28bb15b11542c6
Author: Silviu Minut <sminut@cisco.com>
Date: Fri Feb 15 17:15:41 2019 -0500
appid: implement service discovery state queue to honor memcap.
appid: the service queue should be of type AppIdServiceStateKey.
appid: change the service queue to store map iterators rather than the actual keys, as (a) map iterators are stable and (b) sizeof(map::iterator)=8 while sizeof(key)=28.
appid: compute the size of the memory used for a service cache entry only once, as it is constant, and make it global.
appid: implement service cache touch(). Must figure out where to call it from.
appid: fix double free in service_state_queue and address reviewers comments.
appid: introduce min memcap of 1024 with a default of 1Mb and refactor AppIdServiceState::remove() to accept a ServiceCache_t::iterator rather than ip, proto, port and decrypted.
appid: put the service_state_cache and the service_state_queue into a class in its own right and refactor the code.
appid: unit test for service cache and call the touch function.
appid: untabify service_state.h and test/service_state_test.cc.
appid: remove forgotten WhereMacro.
appid: introduce the do_touch flag to the add/get functions and call those functions with the appropriate flag.
appid: update unit test file.