X-Git-Url: http://www.project-moonshot.org/gitweb/?p=trust_router.git;a=blobdiff_plain;f=mon%2Fmons_handlers.c;h=68abd4858c5910626e2d0636842ffd382bbdc24a;hp=5bee3e5be7ac26ee2d72f19c8d555b13e78f1c3f;hb=3d175240ef0a8e0b465994e881ef98548a39091a;hpb=cbe31f4852e07f590a1728b408596d12aa7d662f diff --git a/mon/mons_handlers.c b/mon/mons_handlers.c index 5bee3e5..68abd48 100644 --- a/mon/mons_handlers.c +++ b/mon/mons_handlers.c @@ -34,14 +34,13 @@ /* Handlers for monitoring requests */ +#include #include - #include "mons_handlers.h" typedef MON_RESP *(MONS_HANDLER_FUNC)(TALLOC_CTX *, MONS_INSTANCE *, MON_REQ *); /* Prototypes for the dispatch table */ -static MON_RESP *mons_handle_show(TALLOC_CTX *mem_ctx, MONS_INSTANCE *mons, MON_REQ *req); static MON_RESP *mons_handle_reconfigure(TALLOC_CTX *mem_ctx, MONS_INSTANCE *mons, MON_REQ *req); @@ -65,25 +64,24 @@ MON_RESP *mons_handle_request(TALLOC_CTX *mem_ctx, MONS_INSTANCE *mons, MON_REQ { struct dispatch_table_entry *entry = dispatch_table; + tr_debug("mons_handle_request: Handling a request"); + /* Find the handler */ while ((entry->command != req->command) && (entry->command != MON_CMD_UNKNOWN)) { entry++; } /* See if we found a handler */ - if (entry->command == MON_CMD_UNKNOWN) + if (entry->command == MON_CMD_UNKNOWN) { + tr_info("mons_handle_request: Unknown or unsupported monitoring request received"); return NULL; + } /* Call the handler */ + tr_debug("mons_handle_request: Calling handler for %s command", mon_cmd_to_string(entry->command)); return entry->handler(mem_ctx, mons, req); } -static MON_RESP *mons_handle_show(TALLOC_CTX *mem_ctx, MONS_INSTANCE *mons, MON_REQ *req) -{ - MON_RESP *resp = mon_resp_new(mem_ctx, MON_RESP_SUCCESS, "success", NULL); - return resp; -} - static MON_RESP *mons_handle_reconfigure(TALLOC_CTX *mem_ctx, MONS_INSTANCE *mons, MON_REQ *req) { return NULL;