1 #ifndef __SNMP_AGENT_H__
2 #define __SNMP_AGENT_H__
9 #include "stg/os_int.h"
10 #include "stg/plugin.h"
11 #include "stg/module_settings.h"
12 #include "stg/users.h"
14 extern "C" PLUGIN * GetPlugin();
18 //-----------------------------------------------------------------------------
19 class SNMP_AGENT_SETTINGS {
21 SNMP_AGENT_SETTINGS();
22 virtual ~SNMP_AGENT_SETTINGS() {}
23 const std::string & GetStrError() const { return errorStr; }
24 int ParseSettings(const MODULE_SETTINGS & s);
27 mutable std::string errorStr;
29 //-----------------------------------------------------------------------------
30 class SNMP_AGENT : public PLUGIN {
33 virtual ~SNMP_AGENT();
35 void SetUsers(USERS *) {}
36 void SetTariffs(TARIFFS *) {}
37 void SetAdmins(ADMINS *) {}
38 void SetTraffcounter(TRAFFCOUNTER *) {}
39 void SetStore(STORE *) {}
40 void SetStgSettings(const SETTINGS *) {}
41 void SetSettings(const MODULE_SETTINGS &) {}
46 int Reload() { return 0; }
47 bool IsRunning() { return running && !stopped; }
49 const std::string & GetStrError() const { return errorStr; }
50 const std::string GetVersion() const { return "Stg SNMP Agent 1.0"; }
51 uint16_t GetStartPosition() const { return 100; }
52 uint16_t GetStopPosition() const { return 100; }
55 static void * Runner(void * d);
58 mutable std::string errorStr;
59 SNMP_AGENT_SETTINGS snmpAgentSettings;
60 MODULE_SETTINGS settings;
63 pthread_mutex_t mutex;
67 //-----------------------------------------------------------------------------