]> git.stg.codes - stg.git/blob - projects/stargazer/plugins/configuration/sgconfig2/net_configurator.h
Log all SIGHUP-related activity.
[stg.git] / projects / stargazer / plugins / configuration / sgconfig2 / net_configurator.h
1  /*
2  $Revision: 1.2 $
3  $Date: 2005/10/30 21:34:28 $
4  */
5
6 #ifndef NET_CONFIGURATOR_H
7 #define NET_CONFIGURATOR_H
8
9 #include <time.h>
10 #include <string>
11
12 #include "../../base_ext_configurator.h"
13 #include "../../base_int_configurator.h"
14 #include "../../base_settings.h"
15 #include "hostallow.h"
16 #include "conffiles.h"
17 #include "configproto.h"
18
19 using namespace std;
20 //-----------------------------------------------------------------------------
21 class NET_CONFIGURATOR_SETTINGS: public BASE_SETTINGS
22 {
23 public:
24     virtual ~NET_CONFIGURATOR_SETTINGS(){};
25 virtual const string & GetStrError();
26     virtual int ReadSettings(const CONFIGFILE & cf);
27     uint16_t    GetPort();
28     HOSTALLOW * GetHostAllow();
29
30 private:
31     string strError;
32     uint16_t port;
33     HOSTALLOW hostAllow;
34 };
35 //-----------------------------------------------------------------------------
36 class NET_CONFIGURATOR: public BASE_EXT_CONFIGURATOR
37 {
38 public:
39     NET_CONFIGURATOR();
40     virtual ~NET_CONFIGURATOR();
41     virtual void SetStgConfigurator(BASE_INT_CONFIGURATOR *);
42     virtual int UserGetAll(string * login, 
43                            USER_CONF_RES * conf,
44                            USER_STAT_RES * stat,
45                            time_t lastUpdate);
46     virtual int TatiffGetAll(TARIFF_CONF * conf);
47     virtual int AdminGetAll(ADMIN_CONF  * conf);
48     virtual const string & GetStrError();
49     virtual void Start();
50     virtual void Stop();
51     virtual void Restart();
52     virtual CONF_STATUS Status();
53     virtual BASE_SETTINGS * GetConfiguratorSettings();
54     virtual void SetAdmins(const ADMINS * a);
55
56 private:
57     HOSTALLOW * hostAllow;
58     BASE_INT_CONFIGURATOR * stgConfigurator;
59     NET_CONFIGURATOR_SETTINGS settings;
60     string strError;
61     CONFIGPROTO cp;
62 };
63 //-----------------------------------------------------------------------------
64 #endif //NET_CONFIGURATOR_H
65