aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmo-bts/abis.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-03-04 14:05:20 +0100
committerHarald Welte <laforge@gnumonks.org>2011-03-04 14:05:20 +0100
commit4b45ae1636990a15934f77f37033cf8ed5804b57 (patch)
tree892d687a5c689fdb7813a3f94dd9a0926d80b892 /include/osmo-bts/abis.h
Import all C and Header files from jolly/bts branch of osmocom-bb.git
The BTS code shall reside in a separate git repository, thus I'm importing the C and H files here.
Diffstat (limited to 'include/osmo-bts/abis.h')
-rw-r--r--include/osmo-bts/abis.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/include/osmo-bts/abis.h b/include/osmo-bts/abis.h
new file mode 100644
index 00000000..517c6e72
--- /dev/null
+++ b/include/osmo-bts/abis.h
@@ -0,0 +1,68 @@
+#ifndef _ABIS_H
+#define _ABIS_H
+
+#define IPA_TCP_PORT_OML 3002
+#define IPA_TCP_PORT_RSL 3003
+
+#define OML_RETRY_TIMER 5
+#define OML_PING_TIMER 20
+
+struct ipabis_head {
+ u_int16_t len; /* network byte order */
+ u_int8_t proto;
+ u_int8_t data[0];
+} __attribute__ ((packed));
+
+enum ipabis_proto {
+ IPA_PROTO_RSL = 0x00,
+ IPA_PROTO_IPACCESS = 0xfe,
+ IPA_PROTO_SCCP = 0xfd,
+ IPA_PROTO_OML = 0xff,
+};
+
+enum ipabis_msgtype {
+ IPA_MSGT_PING = 0x00,
+ IPA_MSGT_PONG = 0x01,
+ IPA_MSGT_ID_GET = 0x04,
+ IPA_MSGT_ID_RESP = 0x05,
+ IPA_MSGT_ID_ACK = 0x06,
+};
+
+enum ipabis_id_tags {
+ IPA_IDTAG_SERNR = 0x00,
+ IPA_IDTAG_UNITNAME = 0x01,
+ IPA_IDTAG_LOCATION1 = 0x02,
+ IPA_IDTAG_LOCATION2 = 0x03,
+ IPA_IDTAG_EQUIPVERS = 0x04,
+ IPA_IDTAG_SWVERSION = 0x05,
+ IPA_IDTAG_IPADDR = 0x06,
+ IPA_IDTAG_MACADDR = 0x07,
+ IPA_IDTAG_UNIT = 0x08,
+};
+
+struct ipabis_link {
+ int state;
+ struct osmocom_bts *bts; /* set, if OML link */
+ struct osmobts_trx *trx; /* set, if RSL link */
+ struct bsc_fd bfd;
+ struct timer_list timer;
+ struct msgb *rx_msg;
+ struct llist_head tx_queue;
+ int ping, pong, id_resp;
+ uint32_t ip;
+};
+
+enum {
+ LINK_STATE_IDLE = 0,
+ LINK_STATE_RETRYING,
+ LINK_STATE_CONNECTING,
+ LINK_STATE_CONNECT,
+};
+
+int abis_tx(struct ipabis_link *link, struct msgb *msg);
+struct msgb *abis_msgb_alloc(int headroom);
+void abis_push_ipa(struct msgb *msg, uint8_t proto);
+int abis_open(struct ipabis_link *link, uint32_t ip);
+void abis_close(struct ipabis_link *link);
+
+#endif /* _ABIS_H */