X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Fsilcd%2Fserver_internal.h;h=41df9ab805195c78fd85d781c76f7235afd29b42;hb=2407b5a8d55101dcc4cccb098888e0e21f6f299c;hp=5cd0241ecf5ec5074ace09655c2dd0532a6e0bf2;hpb=33b943ac6034b92fcc5c09802f9fe9add12a51c9;p=silc.git diff --git a/apps/silcd/server_internal.h b/apps/silcd/server_internal.h index 5cd0241e..41df9ab8 100644 --- a/apps/silcd/server_internal.h +++ b/apps/silcd/server_internal.h @@ -77,7 +77,11 @@ struct SilcServerStruct { SilcServerEntry router; /* Pointer to the primary router */ unsigned long router_connect; /* Time when router was connected */ SilcServerBackup backup; /* Backup routers */ - bool backup_router; + bool backup_router; /* TRUE if this is backup router */ + bool backup_primary; /* TRUE if we've switched our primary + router to a backup router. */ + SilcServerConnection router_conn; /* non-NULL when connecting to the + primary router, and NULL otherwise. */ /* Current command identifier, 0 not used */ uint16 cmd_ident; @@ -92,11 +96,6 @@ struct SilcServerStruct { /* Table of connected sockets */ SilcSocketConnection *sockets; - /* Server keys */ - SilcCipher send_key; - SilcCipher receive_key; - SilcCipher none_cipher; - /* Server public key */ SilcPKCS pkcs; SilcPublicKey public_key; @@ -169,6 +168,16 @@ do { \ silc_schedule_set_listen_fd((s), (fd), (SILC_TASK_READ | SILC_TASK_WRITE)); \ } while(0) +#define SILC_OPER_STATS_UPDATE(c, type, mod) \ +do { \ + if ((c)->mode & (mod)) { \ + if ((c)->connection) \ + server->stat.my_ ## type ## _ops--; \ + if (server->server_type == SILC_ROUTER) \ + server->stat. type ## _ops--; \ + } \ +} while(0) + /* Prototypes */ SILC_TASK_CALLBACK_GLOBAL(silc_server_rekey_final);