Replace static monitor handler tables with dynamic handler registry
authorJennifer Richards <jennifer@painless-security.com>
Wed, 18 Apr 2018 03:38:27 +0000 (23:38 -0400)
committerJennifer Richards <jennifer@painless-security.com>
Wed, 18 Apr 2018 03:38:27 +0000 (23:38 -0400)
commit733b18697117cbc63ab3d9e44510c9850916ec90
treee635325dc11574b46407b29f56eb1e0a3400ef85
parent3d175240ef0a8e0b465994e881ef98548a39091a
Replace static monitor handler tables with dynamic handler registry

  * Keep a list of handlers as part of MONS_INSTANCE
    - each handles a command/opt_type pair
    - registered via mons_register_handler()
  * Scan the list of handlers when servicing a monitoring request
  * Add handlers for version and uptime, registered through tr_main.c
    (probably need to move these, but this works as a demo)
12 files changed:
CMakeLists.txt
Makefile.am
include/mon.h
include/mon_internal.h
include/mons_handlers.h [moved from mon/mons_handlers.h with 85% similarity]
include/tr_mon.h
mon/mon_common.c
mon/mon_req.c
mon/mons.c
mon/mons_handlers.c
mon/mons_handlers_show.c [deleted file]
tr/tr_main.c