blob: cdaa026528879dafede6eccd437945531b2d5376 [file] [log] [blame]
Neels Hofmeyra8945ce2018-11-30 00:44:32 +01001#pragma once
2/* MSC RAN connection implementation */
3
4#include <stdint.h>
5
Neels Hofmeyrc4628a32018-12-07 14:47:34 +01006#include <osmocom/core/linuxlist.h>
Neels Hofmeyra8945ce2018-11-30 00:44:32 +01007
Neels Hofmeyrc4628a32018-12-07 14:47:34 +01008struct ran_peer;
9struct osmo_fsm_inst;
10struct msgb;
Neels Hofmeyra8945ce2018-11-30 00:44:32 +010011
12/* active radio connection of a mobile subscriber */
13struct ran_conn {
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010014 /* Entry in sccp_ran_inst->ran_conns */
Neels Hofmeyra8945ce2018-11-30 00:44:32 +010015 struct llist_head entry;
16
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010017 struct ran_peer *ran_peer;
18 uint32_t sccp_conn_id;
Neels Hofmeyra8945ce2018-11-30 00:44:32 +010019
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010020 /* MSC role that this RAN connection belongs to. This will be either an msc_i (currently active
Andreas Eversberge24636c2023-04-23 12:20:55 +020021 * connection) or an msc_t (transitory new connection during Handover).
22 * Used for usual L3 ran_conn to a subscriber. */
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010023 struct osmo_fsm_inst *msc_role;
Neels Hofmeyra8945ce2018-11-30 00:44:32 +010024
Andreas Eversberge24636c2023-04-23 12:20:55 +020025 /* For VGCS/VBS, we have additional N connections to BSS. When receiving messages for a group call peer,
26 * dispatch to the VGCS management. */
27 struct {
28 void *bss;
29 void *cell;
30 } vgcs;
31
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010032 bool closing;
Neels Hofmeyra8945ce2018-11-30 00:44:32 +010033};
34
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010035struct ran_conn *ran_conn_create_incoming(struct ran_peer *ran_peer, uint32_t sccp_conn_id);
36struct ran_conn *ran_conn_create_outgoing(struct ran_peer *ran_peer);
37const char *ran_conn_name(struct ran_conn *conn);
38int ran_conn_down_l2_co(struct ran_conn *conn, struct msgb *l3, bool initial);
39void ran_conn_msc_role_gone(struct ran_conn *conn, struct osmo_fsm_inst *msc_role);
40void ran_conn_close(struct ran_conn *conn);
41void ran_conn_discard(struct ran_conn *conn);