X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/6207d1bdab32119da7d30a3d38d3dcf6a5f09671..911b6d1f5643bf4d353774f82a8b742bec4e5677:/projects/stargazer/plugins/other/snmp/snmp.h diff --git a/projects/stargazer/plugins/other/snmp/snmp.h b/projects/stargazer/plugins/other/snmp/snmp.h index fe5fa05e..90dba45e 100644 --- a/projects/stargazer/plugins/other/snmp/snmp.h +++ b/projects/stargazer/plugins/other/snmp/snmp.h @@ -4,6 +4,9 @@ #include #include +#include + +#include "asn1/SMUX-PDUs.h" #include "stg/os_int.h" #include "stg/plugin.h" @@ -14,6 +17,9 @@ extern "C" PLUGIN * GetPlugin(); class USER; class SETTINGS; +class SNMP_AGENT; + +typedef bool (SNMP_AGENT::*SNMPPacketHandler)(const SMUX_PDUs_t * pdus); //----------------------------------------------------------------------------- class SNMP_AGENT_SETTINGS { public: @@ -63,6 +69,13 @@ private: void Run(); bool PrepareNet(); + bool DispatchPDUs(const SMUX_PDUs_t * pdus); + + bool CloseHandler(const SMUX_PDUs_t * pdus); + bool RegisterResponseHandler(const SMUX_PDUs_t * pdus); + bool PDUsHandler(const SMUX_PDUs_t * pdus); + bool CommitOrRollbackHandler(const SMUX_PDUs_t * pdus); + mutable std::string errorStr; SNMP_AGENT_SETTINGS snmpAgentSettings; MODULE_SETTINGS settings; @@ -73,6 +86,8 @@ private: bool stopped; int sock; + + std::map handlers; }; //-----------------------------------------------------------------------------