add basic unixsocket support
Allow to connect to a unix socket for communicating with LAPD.
Change-Id: Ia5723b09a5c68a0505829dc732def981e60a907a
diff --git a/include/osmocom/abis/unixsocket_proto.h b/include/osmocom/abis/unixsocket_proto.h
new file mode 100644
index 0000000..25718ff
--- /dev/null
+++ b/include/osmocom/abis/unixsocket_proto.h
@@ -0,0 +1,31 @@
+
+#ifndef UNIXSOCKET_PROTO_H
+#define UNIXSOCKET_PROTO_H
+
+/* The unix socket protocol is using a 2 byte header
+ * containg the version and type.
+ *
+ * header: | 1b version | 1b type |
+ *
+ * for data packets it would be
+ *
+ * data: | 0x1 | 0x0 | lapd ..|
+ * control: | 0x1 | 0x1 | control payload |
+ *
+ * Atm there is only one control packet:
+ * - set_altc (superchannel or timeslot)
+ *
+ * set_altc payload:
+ * | 4b magic | 1b new_state|
+ * | 0x23004200 | 0x0 | to timeslot
+ * | 0x23004200 | 0x1 | to superchannel
+ */
+
+#define UNIXSOCKET_PROTO_VERSION 0x1
+
+enum {
+ UNIXSOCKET_PROTO_DATA = 0x0,
+ UNIXSOCKET_PROTO_CONTROL = 0x1,
+};
+
+#endif /* UNIXSOCKET_PROTO_H */