Harald Welte | e72cf55 | 2016-04-28 07:18:49 +0200 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <osmocom/core/linuxlist.h> |
| 4 | #include <osmocom/core/msgb.h> |
| 5 | #include <osmocom/abis/ipa.h> |
| 6 | #include <osmocom/abis/ipaccess.h> |
| 7 | |
| 8 | struct osmo_gsup_conn; |
| 9 | |
| 10 | /* Expects message in msg->l2h */ |
| 11 | typedef int (*osmo_gsup_read_cb_t)(struct osmo_gsup_conn *conn, struct msgb *msg); |
| 12 | |
| 13 | struct osmo_gsup_server { |
| 14 | /* list of osmo_gsup_conn */ |
| 15 | struct llist_head clients; |
| 16 | |
| 17 | struct ipa_server_link *link; |
| 18 | osmo_gsup_read_cb_t read_cb; |
Harald Welte | e687be5 | 2016-05-03 18:49:27 +0200 | [diff] [blame] | 19 | struct llist_head routes; |
Harald Welte | e72cf55 | 2016-04-28 07:18:49 +0200 | [diff] [blame] | 20 | }; |
| 21 | |
| 22 | |
| 23 | /* a single connection to a given client (SGSN, MSC) */ |
| 24 | struct osmo_gsup_conn { |
| 25 | struct llist_head list; |
| 26 | |
| 27 | struct osmo_gsup_server *server; |
| 28 | struct ipa_server_conn *conn; |
| 29 | //struct oap_state oap_state; |
Harald Welte | e687be5 | 2016-05-03 18:49:27 +0200 | [diff] [blame] | 30 | struct tlv_parsed ccm; |
Harald Welte | e72cf55 | 2016-04-28 07:18:49 +0200 | [diff] [blame] | 31 | }; |
| 32 | |
| 33 | |
| 34 | int osmo_gsup_conn_send(struct osmo_gsup_conn *conn, struct msgb *msg); |
| 35 | |
| 36 | struct osmo_gsup_server *osmo_gsup_server_create(void *ctx, |
| 37 | const char *ip_addr, |
| 38 | uint16_t tcp_port, |
| 39 | osmo_gsup_read_cb_t read_cb); |
| 40 | |
| 41 | void osmo_gsup_server_destroy(struct osmo_gsup_server *gsups); |
| 42 | |