updates.
[silc.git] / apps / silcd / serverconfig.h
index 0a2c714770a018a72b5614274c72b60aba7836d3..0c424a43b21ad1bfc9e328cbcda091b4ab909466 100644 (file)
@@ -32,6 +32,12 @@ typedef struct SilcServerConfigSectionAlgStruct {
 #define SILC_CONFIG_SERVER_MODNAME "builtin"
 } SilcServerConfigSectionAlg;
 
+/* Holds server keys from config file */
+typedef struct {
+  SilcPublicKey public_key;
+  SilcPrivateKey private_key;
+} SilcServerConfigSectionServerKeys;
+
 /* Holds server information from config file */
 typedef struct {
   char *server_name;
@@ -50,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;
@@ -60,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. */
@@ -76,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 */
@@ -125,17 +131,20 @@ typedef struct SilcServerConfigSectionServerConnectionStruct {
   uint16 port;
   char *version;
   uint32 class;
-  int initiator;
+  bool initiator;
+  bool backup_router;
+  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 */
@@ -162,6 +171,7 @@ typedef struct {
   SilcServerConfigSectionAlg *pkcs;
   SilcServerConfigSectionAlg *hash_func;
   SilcServerConfigSectionAlg *hmac;
+  SilcServerConfigSectionServerKeys *server_keys;
   SilcServerConfigSectionServerInfo *server_info;
   SilcServerConfigSectionAdminInfo *admin_info;
   SilcServerConfigSectionListenPort *listen_port;
@@ -185,6 +195,7 @@ typedef enum {
   SILC_CONFIG_SERVER_SECTION_TYPE_PKCS,
   SILC_CONFIG_SERVER_SECTION_TYPE_HASH_FUNCTION,
   SILC_CONFIG_SERVER_SECTION_TYPE_HMAC,
+  SILC_CONFIG_SERVER_SECTION_TYPE_SERVER_KEYS,
   SILC_CONFIG_SERVER_SECTION_TYPE_SERVER_INFO,
   SILC_CONFIG_SERVER_SECTION_TYPE_ADMIN_INFO,
   SILC_CONFIG_SERVER_SECTION_TYPE_LISTEN_PORT,
@@ -248,10 +259,10 @@ 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);
+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);
@@ -261,9 +272,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