updates.
[silc.git] / apps / silcd / serverconfig.h
index 8be6d7cb7ccec9fec883c62321ae4fd72e781a51..2a37bb941aa056a4e6b234c24d8d8a963c97245c 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Johnny Mnemonic <johnny@themnemonic.org>
 
-  Copyright (C) 1997 - 2002 Pekka Riikonen
+  Copyright (C) 1997 - 2002 Johnny Mnemonic
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -70,23 +70,30 @@ typedef struct SilcServerConfigSectionLoggingStruct {
   uint32 maxsize;
 } SilcServerConfigSectionLogging;
 
-/* Holds all configured connection classes */
-/* typedef struct SilcServerConfigSectionClassStruct {
-  uint32 class;
-  uint32 ping_freq;
+/* Connection parameters */
+typedef struct SilcServerConfigSectionConnectionParam {
+  char *name;
+  uint32 keepalive_secs;
+  uint32 reconnect_count;
+  uint32 reconnect_interval;
+  uint32 reconnect_interval_max;
+  bool reconnect_keep_trying;
+  /* 
   uint32 connect_freq;
   uint32 max_links;
-  struct SilcServerConfigSectionClassStruct *next;
-} SilcServerConfigSectionClass; */
+  */
+  struct SilcServerConfigSectionConnectionParam *next;
+} SilcServerConfigSectionConnectionParam;
 
 /* Holds all client authentication data from config file */
 typedef struct SilcServerConfigSectionClientStruct {
   char *host;
-  SilcAuthMethod auth_meth;
-  void *auth_data;
-  uint32 auth_data_len;
+  unsigned char *passphrase;
+  uint32 passphrase_len;
+  void *publickey;
   uint16 port;
-  uint32 class;
+  char *param_name;
+  SilcServerConfigSectionConnectionParam *param;
   struct SilcServerConfigSectionClientStruct *next;
 } SilcServerConfigSectionClient;
 
@@ -95,9 +102,9 @@ typedef struct SilcServerConfigSectionAdminStruct {
   char *host;
   char *user;
   char *nick;
-  SilcAuthMethod auth_meth;
-  void *auth_data;
-  uint32 auth_data_len;
+  unsigned char *passphrase;
+  uint32 passphrase_len;
+  void *publickey;
   struct SilcServerConfigSectionAdminStruct *next;
 } SilcServerConfigSectionAdmin;
 
@@ -112,12 +119,12 @@ typedef struct SilcServerConfigSectionDenyStruct {
 /* Holds all configured server connections from config file */
 typedef struct SilcServerConfigSectionServerStruct {
   char *host;
-  SilcAuthMethod auth_meth;
-  void *auth_data;
-  uint32 auth_data_len;
-  uint16 port;
+  unsigned char *passphrase;
+  uint32 passphrase_len;
+  void *publickey;
   char *version;
-  uint32 class;
+  char *param_name;
+  SilcServerConfigSectionConnectionParam *param;
   bool backup_router;
   struct SilcServerConfigSectionServerStruct *next;
 } SilcServerConfigSectionServer;
@@ -125,12 +132,13 @@ typedef struct SilcServerConfigSectionServerStruct {
 /* Holds all configured router connections from config file */
 typedef struct SilcServerConfigSectionRouterStruct {
   char *host;
-  SilcAuthMethod auth_meth;
-  void *auth_data;
-  uint32 auth_data_len;
+  unsigned char *passphrase;
+  uint32 passphrase_len;
+  void *publickey;
   uint16 port;
   char *version;
-  uint32 class;
+  char *param_name;
+  SilcServerConfigSectionConnectionParam *param;
   bool initiator;
   bool backup_router;
   char *backup_replace_ip;
@@ -142,8 +150,15 @@ typedef struct SilcServerConfigSectionRouterStruct {
 /* define the SilcServerConfig object */
 typedef struct {
   void *tmp;
+
+  /* The General section */
   char *module_path;
+  bool prefer_passphrase_auth;
+  bool require_reverse_lookup;
+  /* XXX Still think whether to actually have params in general... -Pekka */
+  SilcServerConfigSectionConnectionParam param;
 
+  /* Other configuration sections */
   SilcServerConfigSectionCipher *cipher;
   SilcServerConfigSectionHash *hash;
   SilcServerConfigSectionHmac *hmac;
@@ -153,7 +168,7 @@ typedef struct {
   SilcServerConfigSectionLogging *logging_errors;
   SilcServerConfigSectionLogging *logging_fatals;
   SilcServerConfigSectionServerInfo *server_info;
-/*SilcServerConfigSectionClass *conn_class; */
+  SilcServerConfigSectionConnectionParam *conn_params;
   SilcServerConfigSectionClient *clients;
   SilcServerConfigSectionAdmin *admins;
   SilcServerConfigSectionDeny *denied;
@@ -163,38 +178,32 @@ typedef struct {
 
 /* Prototypes */
 
-/* basic config operations */
+/* Basic config operations */
 SilcServerConfig silc_server_config_alloc(char *filename);
 void silc_server_config_destroy(SilcServerConfig config);
 
-/* algorithm registering and reset functions */
+/* Algorithm registering and reset functions */
 bool silc_server_config_register_ciphers(SilcServer server);
 bool silc_server_config_register_hashfuncs(SilcServer server);
 bool silc_server_config_register_hmacs(SilcServer server);
 bool silc_server_config_register_pkcs(SilcServer server);
-void silc_server_config_setlogfiles(SilcServerConfig config, SilcSchedule sked);
+void silc_server_config_setlogfiles(SilcServer server);
 
-/* run-time config access functions */
+/* Run-time config access functions */
 SilcServerConfigSectionClient *
-silc_server_config_find_client(SilcServerConfig config, char *host, int port);
-
+silc_server_config_find_client(SilcServer server, char *host, int port);
 SilcServerConfigSectionAdmin *
-silc_server_config_find_admin(SilcServerConfig config,
-                             char *host, char *user, char *nick);
-
+silc_server_config_find_admin(SilcServer server, char *host, char *user, 
+                             char *nick);
 SilcServerConfigSectionDeny *
-silc_server_config_find_denied(SilcServerConfig config,
-                              char *host, uint16 port);
-
-/* Prototypes - OLD */
+silc_server_config_find_denied(SilcServer server, char *host, uint16 port);
 SilcServerConfigSectionServer *
-silc_server_config_find_server_conn(SilcServerConfig config,
-                                   char *host, int port);
+silc_server_config_find_server_conn(SilcServer server, char *host);
 SilcServerConfigSectionRouter *
-silc_server_config_find_router_conn(SilcServerConfig config,
-                                   char *host, int port);
-bool silc_server_config_is_primary_route(SilcServerConfig config);
+silc_server_config_find_router_conn(SilcServer server, char *host, int port);
+bool silc_server_config_is_primary_route(SilcServer server);
 SilcServerConfigSectionRouter *
-silc_server_config_get_primary_router(SilcServerConfig config);
+silc_server_config_get_primary_router(SilcServer server);
+bool silc_server_config_set_defaults(SilcServer server);
 
 #endif /* !SERVERCONFIG_H */