X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/911b6d1f5643bf4d353774f82a8b742bec4e5677..0a8aa4fffee15d7e175d857b7248d690081f41fd:/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 90dba45e..540bd3d7 100644 --- a/projects/stargazer/plugins/other/snmp/snmp.h +++ b/projects/stargazer/plugins/other/snmp/snmp.h @@ -7,11 +7,15 @@ #include #include "asn1/SMUX-PDUs.h" +#include "asn1/ObjectSyntax.h" #include "stg/os_int.h" #include "stg/plugin.h" #include "stg/module_settings.h" #include "stg/users.h" +#include "stg/tariffs.h" + +#include "sensors.h" extern "C" PLUGIN * GetPlugin(); @@ -19,7 +23,10 @@ class USER; class SETTINGS; class SNMP_AGENT; -typedef bool (SNMP_AGENT::*SNMPPacketHandler)(const SMUX_PDUs_t * pdus); +typedef bool (SNMP_AGENT::*SMUXPacketHandler)(const SMUX_PDUs_t * pdus); +typedef bool (SNMP_AGENT::*PDUsHandler)(const PDUs_t * pdus); +typedef std::map SMUXHandlers; +typedef std::map PDUsHandlers; //----------------------------------------------------------------------------- class SNMP_AGENT_SETTINGS { public: @@ -45,8 +52,8 @@ public: SNMP_AGENT(); virtual ~SNMP_AGENT(); - void SetUsers(USERS *) {} - void SetTariffs(TARIFFS *) {} + void SetUsers(USERS * u) { users = u; } + void SetTariffs(TARIFFS * t) { tariffs = t; } void SetAdmins(ADMINS *) {} void SetTraffcounter(TRAFFCOUNTER *) {} void SetStore(STORE *) {} @@ -76,6 +83,13 @@ private: bool PDUsHandler(const SMUX_PDUs_t * pdus); bool CommitOrRollbackHandler(const SMUX_PDUs_t * pdus); + bool GetRequestHandler(const PDUs_t * pdus); + bool GetNextRequestHandler(const PDUs_t * pdus); + bool SetRequestHandler(const PDUs_t * pdus); + + USERS * users; + TARIFFS * tariffs; + mutable std::string errorStr; SNMP_AGENT_SETTINGS snmpAgentSettings; MODULE_SETTINGS settings; @@ -87,7 +101,9 @@ private: int sock; - std::map handlers; + SMUXHandlers smuxHandlers; + PDUsHandlers pdusHandlers; + Sensors sensors; }; //-----------------------------------------------------------------------------