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> |
Stefan Sperling | 93c5b10 | 2018-04-10 19:26:14 +0200 | [diff] [blame] | 7 | #include <osmocom/gsm/gsup.h> |
Harald Welte | e72cf55 | 2016-04-28 07:18:49 +0200 | [diff] [blame] | 8 | |
| 9 | struct osmo_gsup_conn; |
| 10 | |
| 11 | /* Expects message in msg->l2h */ |
| 12 | typedef int (*osmo_gsup_read_cb_t)(struct osmo_gsup_conn *conn, struct msgb *msg); |
| 13 | |
| 14 | struct osmo_gsup_server { |
| 15 | /* list of osmo_gsup_conn */ |
| 16 | struct llist_head clients; |
| 17 | |
Max | 9cacb6f | 2017-02-20 17:22:56 +0100 | [diff] [blame] | 18 | /* lu_operations list */ |
| 19 | struct llist_head *luop; |
| 20 | |
Harald Welte | e72cf55 | 2016-04-28 07:18:49 +0200 | [diff] [blame] | 21 | struct ipa_server_link *link; |
| 22 | osmo_gsup_read_cb_t read_cb; |
Harald Welte | e687be5 | 2016-05-03 18:49:27 +0200 | [diff] [blame] | 23 | struct llist_head routes; |
Harald Welte | e72cf55 | 2016-04-28 07:18:49 +0200 | [diff] [blame] | 24 | }; |
| 25 | |
| 26 | |
| 27 | /* a single connection to a given client (SGSN, MSC) */ |
| 28 | struct osmo_gsup_conn { |
| 29 | struct llist_head list; |
| 30 | |
| 31 | struct osmo_gsup_server *server; |
| 32 | struct ipa_server_conn *conn; |
| 33 | //struct oap_state oap_state; |
Harald Welte | e687be5 | 2016-05-03 18:49:27 +0200 | [diff] [blame] | 34 | struct tlv_parsed ccm; |
Neels Hofmeyr | cab2fcd | 2017-03-15 00:07:43 +0100 | [diff] [blame] | 35 | |
| 36 | unsigned int auc_3g_ind; /*!< IND index used for UMTS AKA SQN */ |
Stefan Sperling | 93c5b10 | 2018-04-10 19:26:14 +0200 | [diff] [blame] | 37 | |
| 38 | /* Set when Location Update is received: */ |
| 39 | bool supports_cs; /* client supports OSMO_GSUP_CN_DOMAIN_CS */ |
| 40 | bool supports_ps; /* client supports OSMO_GSUP_CN_DOMAIN_PS */ |
Harald Welte | e72cf55 | 2016-04-28 07:18:49 +0200 | [diff] [blame] | 41 | }; |
| 42 | |
| 43 | |
| 44 | 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] | 45 | int osmo_gsup_conn_ccm_get(const struct osmo_gsup_conn *clnt, uint8_t **addr, |
| 46 | uint8_t tag); |
Harald Welte | e72cf55 | 2016-04-28 07:18:49 +0200 | [diff] [blame] | 47 | |
| 48 | struct osmo_gsup_server *osmo_gsup_server_create(void *ctx, |
Max | 9cacb6f | 2017-02-20 17:22:56 +0100 | [diff] [blame] | 49 | const char *ip_addr, |
| 50 | uint16_t tcp_port, |
| 51 | osmo_gsup_read_cb_t read_cb, |
| 52 | struct llist_head *lu_op_lst); |
Harald Welte | e72cf55 | 2016-04-28 07:18:49 +0200 | [diff] [blame] | 53 | |
| 54 | void osmo_gsup_server_destroy(struct osmo_gsup_server *gsups); |
| 55 | |
Stefan Sperling | 93c5b10 | 2018-04-10 19:26:14 +0200 | [diff] [blame] | 56 | void osmo_gsup_configure_wildcard_apn(struct osmo_gsup_message *gsup); |