From abe65f0329ebc62160d396bf9a7545e36f050954 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Wed, 1 Jun 2011 12:04:58 +0300 Subject: [PATCH] Request dispatching added --- .../stargazer/plugins/other/snmp/snmp.cpp | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) 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; } -- 2.44.2