updates.
[silc.git] / apps / silcd / server_internal.h
index d35c5d8a09f3e60530ec30121c5d39d9c9eb3aae..d0062e11ca3b174eb69c520283d22d509e3903bc 100644 (file)
@@ -175,11 +175,30 @@ do {                                              \
   }                                            \
 } while(0)
 
+#define SILC_UMODE_STATS_UPDATE(oper, mod)     \
+do {                                           \
+    if (client->mode & (mod)) {                        \
+      if (!(mode & (mod))) {                   \
+       if (client->connection)                 \
+         server->stat.my_ ## oper ## _ops--;   \
+        if (server->server_type == SILC_ROUTER)        \
+         server->stat. oper ## _ops--;         \
+      }                                                \
+    } else {                                   \
+      if (mode & (mod)) {                      \
+       if (client->connection)                 \
+         server->stat.my_ ## oper ## _ops++;   \
+        if (server->server_type == SILC_ROUTER)        \
+         server->stat. oper ## _ops++;         \
+      }                                                \
+    }                                          \
+} while(0)
+
 #define SILC_GET_SKE_FLAGS(x, p)                       \
   if ((x)) {                                           \
     if ((x)->param && (x)->param->key_exchange_pfs)    \
       (p)->flags |= SILC_SKE_SP_FLAG_PFS;              \
-    if (!(x)->publickey                              \
+    if (!(x)->publickeys)                              \
       (p)->flags |= SILC_SKE_SP_FLAG_MUTUAL;           \
   }