diff rvinterf/l1filter/init.c @ 855:ea458ee48691

rvinterf/l1filter: new program written, compiles
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 09 Nov 2021 23:14:22 +0000
parents rvinterf/libasync/init.c@c1aadfcd185f
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rvinterf/l1filter/init.c	Tue Nov 09 23:14:22 2021 +0000
@@ -0,0 +1,31 @@
+/*
+ * This module implements some init for l1trace-filter.
+ */
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "pktmux.h"
+#include "localsock.h"
+
+extern int sock;
+
+send_init_command(cmdpkt, cmdlen)
+	u_char *cmdpkt;
+{
+	u_char lenbuf[2];
+
+	lenbuf[0] = 0;
+	lenbuf[1] = cmdlen;
+	write(sock, lenbuf, 2);
+	write(sock, cmdpkt, cmdlen);
+}
+
+init()
+{
+	static u_char want_l1_mux[2] = {CLI2RVI_WANT_MUXPROTO, RVT_L1_HEADER};
+
+	localsock_prep_for_length_rx();
+	send_init_command(want_l1_mux, 2);
+}