#include <pthread.h>
#include <string>
+#include <map>
+
+#include "asn1/SMUX-PDUs.h"
#include "stg/os_int.h"
#include "stg/plugin.h"
class USER;
class SETTINGS;
+class SNMP_AGENT;
+
+typedef bool (SNMP_AGENT::*SMUXPacketHandler)(const SMUX_PDUs_t * pdus);
+typedef bool (SNMP_AGENT::*PDUsHandler)(const PDUs_t * pdus);
+typedef std::map<SMUX_PDUs_PR, SMUXPacketHandler> SMUXHandlers;
+typedef std::map<PDUs_PR, PDUsHandler> PDUsHandlers;
//-----------------------------------------------------------------------------
class SNMP_AGENT_SETTINGS {
public:
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);
+
+ bool GetRequestHandler(const PDUs_t * pdus);
+ bool GetNextRequestHandler(const PDUs_t * pdus);
+ bool SetRequestHandler(const PDUs_t * pdus);
+
mutable std::string errorStr;
SNMP_AGENT_SETTINGS snmpAgentSettings;
MODULE_SETTINGS settings;
bool stopped;
int sock;
+
+ SMUXHandlers smuxHandlers;
+ PDUsHandlers pdusHandlers;
};
//-----------------------------------------------------------------------------