aboutsummaryrefslogtreecommitdiffstats
path: root/src/libabis/input/lapd.h
diff options
context:
space:
mode:
authorJonathan Santos <jrsantos@jonathanrsantos.com>2011-05-25 13:54:02 -0400
committerJonathan Santos <jrsantos@jonathanrsantos.com>2011-05-25 13:54:02 -0400
commit03fd8d014f9871896a86534432c8757d65a576fe (patch)
treebad087cacfb6b106f6ca542bf92ef2e2ecea5dd3 /src/libabis/input/lapd.h
parente7dae79f5839029279c9fd4543804882c019bf42 (diff)
Import upstream version 0.9.13upstream/0.9.13
Diffstat (limited to 'src/libabis/input/lapd.h')
-rw-r--r--src/libabis/input/lapd.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/libabis/input/lapd.h b/src/libabis/input/lapd.h
new file mode 100644
index 00000000..fd11edaa
--- /dev/null
+++ b/src/libabis/input/lapd.h
@@ -0,0 +1,46 @@
+#ifndef OPENBSC_LAPD_H
+#define OPENBSC_LAPD_H
+
+#include <stdint.h>
+
+#include <osmocore/linuxlist.h>
+
+typedef enum {
+ LAPD_MPH_NONE = 0,
+
+ LAPD_MPH_ACTIVATE_IND,
+ LAPD_MPH_DEACTIVATE_IND,
+
+ LAPD_DL_DATA_IND,
+ LAPD_DL_UNITDATA_IND,
+
+} lapd_mph_type;
+
+struct lapd_instance {
+ struct llist_head list; /* list of LAPD instances */
+ int network_side;
+
+ void (*transmit_cb)(uint8_t *data, int len, void *cbdata);
+ void *cbdata;
+
+ struct llist_head tei_list; /* list of TEI in this LAPD instance */
+};
+
+extern uint8_t *lapd_receive(struct lapd_instance *li, uint8_t *data, unsigned int len,
+ int *ilen, lapd_mph_type *prim);
+
+extern void lapd_transmit(struct lapd_instance *li, uint8_t tei, uint8_t sapi,
+ uint8_t *data, unsigned int len);
+
+struct lapd_instance *lapd_instance_alloc(int network_side,
+ void (*tx_cb)(uint8_t *data, int len,
+ void *cbdata), void *cbdata);
+
+
+/* Start a (user-side) SAP for the specified TEI/SAPI on the LAPD instance */
+int lapd_sap_start(struct lapd_instance *li, uint8_t tei, uint8_t sapi);
+
+/* Stop a (user-side) SAP for the specified TEI/SAPI on the LAPD instance */
+int lapd_sap_stop(struct lapd_instance *li, uint8_t tei, uint8_t sapi);
+
+#endif /* OPENBSC_LAPD_H */