updates.
[silc.git] / apps / silcd / serverconfig.h
index 2af85bbd8618fffb7ed540cfd335dd213d5a7f96..4d79063d8954bbd5b38faa2cabd00cd047b13ed3 100644 (file)
@@ -82,6 +82,9 @@ typedef struct SilcServerConfigConnParams {
   bool reconnect_keep_trying;
   SilcUInt32 key_exchange_rekey;
   bool key_exchange_pfs;
+  char *version_protocol;
+  char *version_software;
+  char *version_software_vendor;
   struct SilcServerConfigConnParams *next;
 } SilcServerConfigConnParams;
 
@@ -119,7 +122,6 @@ typedef struct SilcServerConfigServerStruct {
   unsigned char *passphrase;
   SilcUInt32 passphrase_len;
   SilcHashTable publickeys;
-  char *version;
   SilcServerConfigConnParams *param;
   bool backup_router;
   struct SilcServerConfigServerStruct *next;
@@ -132,7 +134,6 @@ typedef struct SilcServerConfigRouterStruct {
   SilcUInt32 passphrase_len;
   SilcHashTable publickeys;
   SilcUInt16 port;
-  char *version;
   SilcServerConfigConnParams *param;
   bool initiator;
   bool backup_router;
@@ -146,6 +147,9 @@ typedef struct SilcServerConfigRouterStruct {
 typedef struct {
   void *tmp;
 
+  /* Reference count (when this reaches zero, config object is destroyed) */
+  SilcInt32 refcount;
+
   /* The General section */
   char *module_path;
   bool prefer_passphrase_auth;
@@ -154,6 +158,8 @@ typedef struct {
   SilcUInt32 key_exchange_timeout;
   SilcUInt32 conn_auth_timeout;
   SilcServerConfigConnParams param;
+  bool logging_quick;
+  long logging_flushdelay;
 
   /* Other configuration sections */
   SilcServerConfigCipher *cipher;
@@ -173,11 +179,19 @@ typedef struct {
   SilcServerConfigRouter *routers;
 } *SilcServerConfig;
 
+typedef struct {
+  SilcServerConfig config;
+  void *ref_ptr;
+} SilcServerConfigRef;
+
 /* Prototypes */
 
 /* Basic config operations */
-SilcServerConfig silc_server_config_alloc(char *filename);
+SilcServerConfig silc_server_config_alloc(const char *filename);
 void silc_server_config_destroy(SilcServerConfig config);
+void silc_server_config_ref(SilcServerConfigRef *ref, SilcServerConfig config,
+                           void *ref_ptr);
+void silc_server_config_unref(SilcServerConfigRef *ref);
 
 /* Algorithm registering and reset functions */
 bool silc_server_config_register_ciphers(SilcServer server);
@@ -190,7 +204,7 @@ void silc_server_config_setlogfiles(SilcServer server);
 SilcServerConfigClient *
 silc_server_config_find_client(SilcServer server, char *host);
 SilcServerConfigAdmin *
-silc_server_config_find_admin(SilcServer server, char *host, char *user, 
+silc_server_config_find_admin(SilcServer server, char *host, char *user,
                              char *nick);
 SilcServerConfigDeny *
 silc_server_config_find_denied(SilcServer server, char *host);
@@ -201,6 +215,5 @@ silc_server_config_find_router_conn(SilcServer server, char *host, int port);
 bool silc_server_config_is_primary_route(SilcServer server);
 SilcServerConfigRouter *
 silc_server_config_get_primary_router(SilcServer server);
-bool silc_server_config_set_defaults(SilcServer server);
 
 #endif /* !SERVERCONFIG_H */