blob: 7aa50df077dbdf6bfbf2552f90f80e6aa056424e [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
21 * connection) or an msc_t (transitory new connection during Handover). */
22 struct osmo_fsm_inst *msc_role;
Neels Hofmeyra8945ce2018-11-30 00:44:32 +010023
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010024 bool closing;
Neels Hofmeyra8945ce2018-11-30 00:44:32 +010025};
26
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010027struct ran_conn *ran_conn_create_incoming(struct ran_peer *ran_peer, uint32_t sccp_conn_id);
28struct ran_conn *ran_conn_create_outgoing(struct ran_peer *ran_peer);
29const char *ran_conn_name(struct ran_conn *conn);
30int ran_conn_down_l2_co(struct ran_conn *conn, struct msgb *l3, bool initial);
31void ran_conn_msc_role_gone(struct ran_conn *conn, struct osmo_fsm_inst *msc_role);
32void ran_conn_close(struct ran_conn *conn);
33void ran_conn_discard(struct ran_conn *conn);