]> git.ipfire.org Git - thirdparty/snort3.git/commit
Merge pull request #1522 in SNORT/snort3 from ~SMINUT/snort3:appid_service_cache...
authorMike Stepanek (mstepane) <mstepane@cisco.com>
Tue, 26 Feb 2019 18:12:52 +0000 (13:12 -0500)
committerMike Stepanek (mstepane) <mstepane@cisco.com>
Tue, 26 Feb 2019 18:12:52 +0000 (13:12 -0500)
commit7ddf6ddee5428456596bc2b073ccca273a480230
tree31e45e172a26d0b8e09094a6e734c036df2db1f6
parent301d62f365a6e0c451b00336228229d207149526
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.
src/network_inspectors/appid/appid_inspector.cc
src/network_inspectors/appid/appid_module.cc
src/network_inspectors/appid/service_plugins/service_discovery.cc
src/network_inspectors/appid/service_state.cc
src/network_inspectors/appid/service_state.h
src/network_inspectors/appid/test/appid_mock_definitions.h
src/network_inspectors/appid/test/service_state_test.cc