blob: 2516bab13f7dc0a1c87d689245beea345a2ebad4 [file] [log] [blame]
Neels Hofmeyrc4628a32018-12-07 14:47:34 +01001/* E-interface messaging over a GSUP connection */
2#pragma once
3
4#include <osmocom/gsm/gsup.h>
5#include <osmocom/msc/msc_roles.h>
6
7struct osmo_fsm_inst;
8struct gsm_network;
9struct vlr_instance;
10
11/* E-interface: connection to a remote MSC via GSUP */
12struct e_link {
13 struct osmo_fsm_inst *msc_role;
14 struct gsup_client_mux *gcm;
15 uint8_t *remote_name;
16 size_t remote_name_len;
17};
18
19struct e_link *e_link_alloc(struct gsup_client_mux *gcm, struct osmo_fsm_inst *msc_role,
20 const uint8_t *remote_name, size_t remote_name_len);
21void e_link_assign(struct e_link *e, struct osmo_fsm_inst *msc_role);
22void e_link_free(struct e_link *e);
23
24int e_prep_gsup_msg(struct e_link *e, struct osmo_gsup_message *gsup_msg);
25int e_tx(struct e_link *e, const struct osmo_gsup_message *gsup_msg);
26
27const char *e_link_name(struct e_link *e);
28
29void msc_a_i_t_gsup_init(struct gsm_network *net);
30
31enum osmo_gsup_entity msc_role_to_gsup_entity(enum msc_role role);
32enum msc_role gsup_entity_to_msc_role(enum osmo_gsup_entity entity);
33int gsup_msg_assign_an_apdu(struct osmo_gsup_message *gsup_msg, struct an_apdu *an_apdu);
34
35struct msgb *gsup_msg_to_msgb(const struct osmo_gsup_message *gsup_msg);
36void gsup_msg_to_an_apdu(struct an_apdu *an_apdu, const struct osmo_gsup_message *gsup_msg);