From: Maxim Mamontov Date: Wed, 1 Jun 2011 09:04:58 +0000 (+0300) Subject: Request dispatching added X-Git-Tag: 2.408-alpha~109 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/abe65f0329ebc62160d396bf9a7545e36f050954 Request dispatching added --- diff --git a/projects/stargazer/plugins/other/snmp/snmp.cpp b/projects/stargazer/plugins/other/snmp/snmp.cpp index 444b812b..ff0cb614 100644 --- a/projects/stargazer/plugins/other/snmp/snmp.cpp +++ b/projects/stargazer/plugins/other/snmp/snmp.cpp @@ -453,6 +453,29 @@ bool SNMP_AGENT::PDUsHandler(const SMUX_PDUs_t * pdus) { printfd(__FILE__, "SNMP_AGENT::PDUsHandler()\n"); asn_fprint(stderr, &asn_DEF_SMUX_PDUs, pdus); +PDUsHandlers::iterator it; +it = pdusHandlers.find(pdus->choice.pdus.present); +if (it != pdusHandlers.end()) + { + return (this->*(it->second))(&pdus->choice.pdus); + } +else + { + switch (pdus->present) + { + case PDUs_PR_NOTHING: + printfd(__FILE__, "SNMP_AGENT::PDUsHandler() - nothing\n"); + break; + case PDUs_PR_get_response: + printfd(__FILE__, "SNMP_AGENT::PDUsHandler() - get response\n"); + break; + case PDUs_PR_trap: + printfd(__FILE__, "SNMP_AGENT::PDUsHandler() - trap\n"); + break; + default: + printfd(__FILE__, "SNMP_AGENT::PDUsHandler() - undefined\n"); + } + } return false; }