add basic unixsocket support
Allow to connect to a unix socket for communicating with LAPD.
Change-Id: Ia5723b09a5c68a0505829dc732def981e60a907a
diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h
index 4c7f8a0..8501d5c 100644
--- a/include/osmocom/abis/e1_input.h
+++ b/include/osmocom/abis/e1_input.h
@@ -183,6 +183,7 @@
unsigned int num;
const char *name;
unsigned int port_nr;
+ char *sock_path;
struct rate_ctr_group *rate_ctr;
/* keepalive configuration */
@@ -303,6 +304,9 @@
struct gsm_network;
int ipaccess_setup(struct gsm_network *gsmnet);
+/* activate superchannel or deactive to use timeslots. only valid for unixsocket driver */
+void e1inp_ericsson_set_altc(struct e1inp_line *unixlinue, int superchannel);
+
extern struct llist_head e1inp_driver_list;
extern struct llist_head e1inp_line_list;
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 */