6 #include "base_plugin.h"
7 #include "base_store.h"
8 #include "configproto.h"
12 extern "C" BASE_PLUGIN * GetPlugin();
16 //-----------------------------------------------------------------------------
17 class STG_CONFIG_SETTINGS
20 STG_CONFIG_SETTINGS();
21 virtual ~STG_CONFIG_SETTINGS(){};
22 const string & GetStrError() const;
23 int ParseSettings(const MODULE_SETTINGS & s);
26 int ParseIntInRange(const string & str, int min, int max, int * val);
30 //-----------------------------------------------------------------------------
31 class STG_CONFIG: public BASE_PLUGIN
35 virtual ~STG_CONFIG(){};
37 void SetUsers(USERS * u) { users = u; };
38 void SetTariffs(TARIFFS * t) { tariffs = t; };
39 void SetAdmins(ADMINS * a) { admins = a; };
40 void SetStore(BASE_STORE * s) { store = s; };
41 void SetTraffcounter(TRAFFCOUNTER *) {};
42 void SetStgSettings(const SETTINGS * s) { stgConfigSettings = s; };
43 void SetSettings(const MODULE_SETTINGS & s) { settings = s; };
48 int Reload() { return 0; };
49 bool IsRunning() { return running; };
51 const string & GetStrError() const { return errorStr; };
52 string GetVersion() const;
53 uint16_t GetStartPosition() const;
54 uint16_t GetStopPosition() const;
57 static void * Run(void *);
59 bool PrepareNetwork();
60 bool FinalizeNetwork();
61 void AcceptConnection();
63 mutable string errorStr;
64 STG_CONFIG_SETTINGS stgConfigSettings;
73 MODULE_SETTINGS settings;
74 const SETTINGS * stgSettings;
76 std::list<ConnectionThread *> connections;
80 //-----------------------------------------------------------------------------