Harald Welte | 8fbf82b | 2018-06-24 11:27:40 +0200 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <stdint.h> |
Neels Hofmeyr | 2f75803 | 2019-11-20 00:37:07 +0100 | [diff] [blame] | 4 | #include <osmocom/hlr/gsup_server.h> |
Harald Welte | 8fbf82b | 2018-06-24 11:27:40 +0200 | [diff] [blame] | 5 | |
Neels Hofmeyr | f13a8bc | 2019-11-20 02:36:45 +0100 | [diff] [blame] | 6 | struct osmo_ipa_name; |
| 7 | |
Oliver Smith | 95abc2b | 2019-04-04 12:00:24 +0200 | [diff] [blame] | 8 | struct gsup_route { |
| 9 | struct llist_head list; |
| 10 | |
| 11 | uint8_t *addr; |
| 12 | struct osmo_gsup_conn *conn; |
| 13 | }; |
| 14 | |
Harald Welte | e687be5 | 2016-05-03 18:49:27 +0200 | [diff] [blame] | 15 | struct osmo_gsup_conn *gsup_route_find(struct osmo_gsup_server *gs, |
| 16 | const uint8_t *addr, size_t addrlen); |
Neels Hofmeyr | f13a8bc | 2019-11-20 02:36:45 +0100 | [diff] [blame] | 17 | struct osmo_gsup_conn *gsup_route_find_by_ipa_name(struct osmo_gsup_server *gs, const struct osmo_ipa_name *ipa_name); |
Harald Welte | e687be5 | 2016-05-03 18:49:27 +0200 | [diff] [blame] | 18 | |
Oliver Smith | 95abc2b | 2019-04-04 12:00:24 +0200 | [diff] [blame] | 19 | struct gsup_route *gsup_route_find_by_conn(const struct osmo_gsup_conn *conn); |
| 20 | |
Harald Welte | e687be5 | 2016-05-03 18:49:27 +0200 | [diff] [blame] | 21 | /* add a new route for the given address to the given conn */ |
Neels Hofmeyr | f13a8bc | 2019-11-20 02:36:45 +0100 | [diff] [blame] | 22 | int gsup_route_add_ipa_name(struct osmo_gsup_conn *conn, const struct osmo_ipa_name *ipa_name); |
Harald Welte | e687be5 | 2016-05-03 18:49:27 +0200 | [diff] [blame] | 23 | int gsup_route_add(struct osmo_gsup_conn *conn, const uint8_t *addr, size_t addrlen); |
| 24 | |
| 25 | /* delete all routes for the given connection */ |
| 26 | int gsup_route_del_conn(struct osmo_gsup_conn *conn); |
Harald Welte | bd72f13 | 2018-06-24 11:26:43 +0200 | [diff] [blame] | 27 | |
| 28 | int osmo_gsup_addr_send(struct osmo_gsup_server *gs, |
| 29 | const uint8_t *addr, size_t addrlen, |
| 30 | struct msgb *msg); |
Neels Hofmeyr | f13a8bc | 2019-11-20 02:36:45 +0100 | [diff] [blame] | 31 | int osmo_gsup_send_to_ipa_name(struct osmo_gsup_server *gs, const struct osmo_ipa_name *ipa_name, struct msgb *msg); |
| 32 | int osmo_gsup_enc_send_to_ipa_name(struct osmo_gsup_server *gs, const struct osmo_ipa_name *ipa_name, |
| 33 | const struct osmo_gsup_message *gsup); |