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 | |
Max | 9cacb6f | 2017-02-20 17:22:56 +0100 | [diff] [blame] | 17 | /* lu_operations list */ |
| 18 | struct llist_head *luop; |
| 19 | |
Harald Welte | e72cf55 | 2016-04-28 07:18:49 +0200 | [diff] [blame] | 20 | struct ipa_server_link *link; |
| 21 | osmo_gsup_read_cb_t read_cb; |
Harald Welte | e687be5 | 2016-05-03 18:49:27 +0200 | [diff] [blame] | 22 | struct llist_head routes; |
Harald Welte | e72cf55 | 2016-04-28 07:18:49 +0200 | [diff] [blame] | 23 | }; |
| 24 | |
| 25 | |
| 26 | /* a single connection to a given client (SGSN, MSC) */ |
| 27 | struct osmo_gsup_conn { |
| 28 | struct llist_head list; |
| 29 | |
| 30 | struct osmo_gsup_server *server; |
| 31 | struct ipa_server_conn *conn; |
| 32 | //struct oap_state oap_state; |
Harald Welte | e687be5 | 2016-05-03 18:49:27 +0200 | [diff] [blame] | 33 | struct tlv_parsed ccm; |
Harald Welte | e72cf55 | 2016-04-28 07:18:49 +0200 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | |
| 37 | int osmo_gsup_conn_send(struct osmo_gsup_conn *conn, struct msgb *msg); |
Neels Hofmeyr | 6eed322 | 2016-12-11 01:21:49 +0100 | [diff] [blame] | 38 | int osmo_gsup_conn_ccm_get(const struct osmo_gsup_conn *clnt, uint8_t **addr, |
| 39 | uint8_t tag); |
Harald Welte | e72cf55 | 2016-04-28 07:18:49 +0200 | [diff] [blame] | 40 | |
| 41 | struct osmo_gsup_server *osmo_gsup_server_create(void *ctx, |
Max | 9cacb6f | 2017-02-20 17:22:56 +0100 | [diff] [blame] | 42 | const char *ip_addr, |
| 43 | uint16_t tcp_port, |
| 44 | osmo_gsup_read_cb_t read_cb, |
| 45 | struct llist_head *lu_op_lst); |
Harald Welte | e72cf55 | 2016-04-28 07:18:49 +0200 | [diff] [blame] | 46 | |
| 47 | void osmo_gsup_server_destroy(struct osmo_gsup_server *gsups); |
| 48 | |