aboutsummaryrefslogtreecommitdiff
path: root/fmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'fmt.c')
-rw-r--r--fmt.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/fmt.c b/fmt.c
new file mode 100644
index 0000000..7d33e57
--- /dev/null
+++ b/fmt.c
@@ -0,0 +1,25 @@
+#include <u.h>
+#include <libc.h>
+#include <ip.h>
+#include <mp.h>
+#include <libsec.h>
+#include <thread.h>
+#include <draw.h>
+#include <geometry.h>
+#include "dat.h"
+#include "fns.h"
+
+int
+Φfmt(Fmt *f)
+{
+ int n, i;
+ Frame *frame;
+
+ frame = va_arg(f->args, Frame*);
+
+ n = fmtprint(f, "id %x type %ud seq %ud ack %ud len %ud sig ",
+ frame->id, frame->type, frame->seq, frame->ack, frame->len);
+ for(i = 0; i < MD5dlen; i++)
+ n += fmtprint(f, "%2.2x", frame->sig[i]);
+ return n;
+}