updates.
[silc.git] / apps / silcd / serverconfig.h
index 095b3d7b221ffb1e5a567d3ce1c5db6b03d73947..a11fc782fd8af62c5bf2e4a10f4504aa7d60f579 100644 (file)
@@ -56,8 +56,8 @@ typedef struct {
 
 /* Holds all the ports the server is listenning on */
 typedef struct SilcServerConfigSectionListenPortStruct {
-  char *host;
-  char *remote_ip;
+  char *local_ip;
+  char *listener_ip;
   uint16 port;
   struct SilcServerConfigSectionListenPortStruct *next;
   struct SilcServerConfigSectionListenPortStruct *prev;
@@ -66,8 +66,8 @@ typedef struct SilcServerConfigSectionListenPortStruct {
 /* Holds server's execution identity, or the user and group which
    to change from root when server starts */
 typedef struct {
- char *user;
- char *group;
 char *user;
 char *group;
 } SilcServerConfigSectionIdentity;
 
 /* Holds all the configured log files. */
@@ -82,7 +82,7 @@ typedef struct SilcServerConfigSectionLoggingStruct {
 #define SILC_CONFIG_SERVER_LF_INFO "infologfile"
 #define SILC_CONFIG_SERVER_LF_WARNING "warninglogfile"
 #define SILC_CONFIG_SERVER_LF_ERROR "errorlogfile"
-#define SILC_CONFIG_SERVER_LF_FATAL "fatalogfile"
+#define SILC_CONFIG_SERVER_LF_FATAL "fatallogfile"
 } SilcServerConfigSectionLogging;
 
 /* Holds all configured connection classes */
@@ -131,17 +131,22 @@ typedef struct SilcServerConfigSectionServerConnectionStruct {
   uint16 port;
   char *version;
   uint32 class;
-  int initiator;
+  bool initiator;
+  bool backup_router;
+  char *backup_replace_ip;
+  uint16 backup_replace_port;
+  bool backup_local;
   struct SilcServerConfigSectionServerConnectionStruct *next;
   struct SilcServerConfigSectionServerConnectionStruct *prev;
 } SilcServerConfigSectionServerConnection;
 
 /* Holds all configured denied connections from config file */
-typedef struct {
+typedef struct SilcServerConfigSectionDenyConnectionStruct {
   char *host;
-  char *time;
   char *comment;
   uint16 port;
+  struct SilcServerConfigSectionDenyConnectionStruct *next;
+  struct SilcServerConfigSectionDenyConnectionStruct *prev;
 } SilcServerConfigSectionDenyConnection;
 
 /* Holds motd file */
@@ -149,6 +154,11 @@ typedef struct {
   char *motd_file;
 } SilcServerConfigSectionMotd;
 
+/* holds pid file */
+typedef struct {
+   char *pid_file;
+} SilcServerConfigSectionPid;
+
 /* 
    SILC Server Config object. 
 
@@ -181,6 +191,7 @@ typedef struct {
   SilcServerConfigSectionAdminConnection *admins;
   SilcServerConfigSectionDenyConnection *denied;
   SilcServerConfigSectionMotd *motd;
+  SilcServerConfigSectionPid *pidfile;
 } SilcServerConfigObject;
 
 typedef SilcServerConfigObject *SilcServerConfig;
@@ -205,6 +216,7 @@ typedef enum {
   SILC_CONFIG_SERVER_SECTION_TYPE_ADMIN_CONNECTION,
   SILC_CONFIG_SERVER_SECTION_TYPE_DENY_CONNECTION,
   SILC_CONFIG_SERVER_SECTION_TYPE_MOTD,
+  SILC_CONFIG_SERVER_SECTION_TYPE_PID,
 } SilcServerConfigSectionType;
 
 /* SILC Configuration Section structure. */
@@ -255,11 +267,11 @@ int silc_server_config_parse(SilcServerConfig config, SilcBuffer buffer,
 int silc_server_config_parse_lines(SilcServerConfig config, 
                                   SilcServerConfigParse parse_config);
 int silc_server_config_check_sections(uint32 checkmask);
-void silc_server_config_setlogfiles(SilcServerConfig config);
-void silc_server_config_register_ciphers(SilcServerConfig config);
-void silc_server_config_register_pkcs(SilcServerConfig config);
-void silc_server_config_register_hashfuncs(SilcServerConfig config);
-void silc_server_config_register_hmacs(SilcServerConfig config);
+void silc_server_config_setlogfiles(SilcServerConfig config, SilcSchedule sked);
+bool silc_server_config_register_ciphers(SilcServerConfig config);
+bool silc_server_config_register_pkcs(SilcServerConfig config);
+bool silc_server_config_register_hashfuncs(SilcServerConfig config);
+bool silc_server_config_register_hmacs(SilcServerConfig config);
 SilcServerConfigSectionClientConnection *
 silc_server_config_find_client_conn(SilcServerConfig config, 
                                    char *host, int port);
@@ -269,9 +281,14 @@ silc_server_config_find_server_conn(SilcServerConfig config,
 SilcServerConfigSectionServerConnection *
 silc_server_config_find_router_conn(SilcServerConfig config, 
                                    char *host, int port);
+bool silc_server_config_is_primary_route(SilcServerConfig config);
+SilcServerConfigSectionServerConnection *
+silc_server_config_get_primary_router(SilcServerConfig config);
 SilcServerConfigSectionAdminConnection *
 silc_server_config_find_admin(SilcServerConfig config,
                              char *host, char *username, char *nickname);
-void silc_server_config_print();
+SilcServerConfigSectionDenyConnection *
+silc_server_config_denied_conn(SilcServerConfig config, char *host,
+                              int port);
 
 #endif