chiark / gitweb /
server/keyexch.c: Prefix crypto-details trace messages correctly.
[tripe] / server / admin.c
index 8eb5ec3ca5a16d3565739ffdea48ff553c75e13f..e892054773a14a6acce73f951a762ec7428bc604 100644 (file)
@@ -313,6 +313,26 @@ void a_vformat(dstr *d, const char *fmt, va_list ap)
   dstr_destroy(&dd);
 }
 
+/* --- @a_format@ --- *
+ *
+ * Arguments:  @dstr *d@ = where to leave the formatted message
+ *             @const char *fmt@ = pointer to format string
+ *
+ * Returns:    ---
+ *
+ * Use:                Writes a tokenized message into a string, for later
+ *             presentation.
+ */
+
+void a_format(dstr *d, const char *fmt, ...)
+{
+  va_list ap;
+
+  va_start(ap, fmt);
+  a_vformat(d, fmt, ap);
+  va_end(ap);
+}
+
 /* --- @a_write@, @a_vwrite@ --- *
  *
  * Arguments:  @admin *a@ = admin connection to write to
@@ -1232,7 +1252,7 @@ static void acmd_add(admin *a, unsigned ac, char *av[])
   add->peer.tag = 0;
   add->peer.t_ka = 0;
   add->peer.tops = tun_default;
-  add->peer.kxf = 0;
+  add->peer.f = 0;
 
   /* --- Parse options --- */
 
@@ -1252,12 +1272,13 @@ static void acmd_add(admin *a, unsigned ac, char *av[])
       }
     })
     OPTTIME("-keepalive", t, { add->peer.t_ka = t; })
-    OPT("-cork", { add->peer.kxf |= KXF_CORK; })
+    OPT("-cork", { add->peer.f |= KXF_CORK; })
     OPTARG("-key", arg, {
       if (add->peer.tag)
        xfree(add->peer.tag);
       add->peer.tag = xstrdup(arg);
     })
+    OPT("-mobile", { add->peer.f |= PSF_MOBILE; })
   });
 
   /* --- Make sure someone's not got there already --- */