blob: ee12a2b71e9e54ce5f8a6d531900acaa4671da58 [file] [log] [blame]
Harald Welte8fbf82b2018-06-24 11:27:40 +02001#pragma once
2
3#include <stdint.h>
Neels Hofmeyr2f758032019-11-20 00:37:07 +01004#include <osmocom/hlr/gsup_server.h>
Harald Welte8fbf82b2018-06-24 11:27:40 +02005
Neels Hofmeyrb2553eb2019-11-20 02:36:45 +01006struct osmo_ipa_name;
7
Oliver Smith95abc2b2019-04-04 12:00:24 +02008struct gsup_route {
9 struct llist_head list;
10
11 uint8_t *addr;
12 struct osmo_gsup_conn *conn;
13};
14
Harald Weltee687be52016-05-03 18:49:27 +020015struct osmo_gsup_conn *gsup_route_find(struct osmo_gsup_server *gs,
16 const uint8_t *addr, size_t addrlen);
Neels Hofmeyrb2553eb2019-11-20 02:36:45 +010017struct osmo_gsup_conn *gsup_route_find_by_ipa_name(struct osmo_gsup_server *gs, const struct osmo_ipa_name *ipa_name);
Harald Weltee687be52016-05-03 18:49:27 +020018
Oliver Smith95abc2b2019-04-04 12:00:24 +020019struct gsup_route *gsup_route_find_by_conn(const struct osmo_gsup_conn *conn);
20
Harald Weltee687be52016-05-03 18:49:27 +020021/* add a new route for the given address to the given conn */
Neels Hofmeyrb2553eb2019-11-20 02:36:45 +010022int gsup_route_add_ipa_name(struct osmo_gsup_conn *conn, const struct osmo_ipa_name *ipa_name);
Harald Weltee687be52016-05-03 18:49:27 +020023int gsup_route_add(struct osmo_gsup_conn *conn, const uint8_t *addr, size_t addrlen);
24
25/* delete all routes for the given connection */
26int gsup_route_del_conn(struct osmo_gsup_conn *conn);
Harald Weltebd72f132018-06-24 11:26:43 +020027
28int osmo_gsup_addr_send(struct osmo_gsup_server *gs,
29 const uint8_t *addr, size_t addrlen,
30 struct msgb *msg);
Neels Hofmeyrb2553eb2019-11-20 02:36:45 +010031int osmo_gsup_send_to_ipa_name(struct osmo_gsup_server *gs, const struct osmo_ipa_name *ipa_name, struct msgb *msg);
32int 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);