Neels Hofmeyr | a8945ce | 2018-11-30 00:44:32 +0100 | [diff] [blame] | 1 | #pragma once |
| 2 | /* MSC RAN connection implementation */ |
| 3 | |
| 4 | #include <stdint.h> |
| 5 | |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 6 | #include <osmocom/core/linuxlist.h> |
Neels Hofmeyr | a8945ce | 2018-11-30 00:44:32 +0100 | [diff] [blame] | 7 | |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 8 | struct ran_peer; |
| 9 | struct osmo_fsm_inst; |
| 10 | struct msgb; |
Neels Hofmeyr | a8945ce | 2018-11-30 00:44:32 +0100 | [diff] [blame] | 11 | |
| 12 | /* active radio connection of a mobile subscriber */ |
| 13 | struct ran_conn { |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 14 | /* Entry in sccp_ran_inst->ran_conns */ |
Neels Hofmeyr | a8945ce | 2018-11-30 00:44:32 +0100 | [diff] [blame] | 15 | struct llist_head entry; |
| 16 | |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 17 | struct ran_peer *ran_peer; |
| 18 | uint32_t sccp_conn_id; |
Neels Hofmeyr | a8945ce | 2018-11-30 00:44:32 +0100 | [diff] [blame] | 19 | |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 20 | /* 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 Hofmeyr | a8945ce | 2018-11-30 00:44:32 +0100 | [diff] [blame] | 23 | |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 24 | bool closing; |
Neels Hofmeyr | a8945ce | 2018-11-30 00:44:32 +0100 | [diff] [blame] | 25 | }; |
| 26 | |
Neels Hofmeyr | c4628a3 | 2018-12-07 14:47:34 +0100 | [diff] [blame] | 27 | struct ran_conn *ran_conn_create_incoming(struct ran_peer *ran_peer, uint32_t sccp_conn_id); |
| 28 | struct ran_conn *ran_conn_create_outgoing(struct ran_peer *ran_peer); |
| 29 | const char *ran_conn_name(struct ran_conn *conn); |
| 30 | int ran_conn_down_l2_co(struct ran_conn *conn, struct msgb *l3, bool initial); |
| 31 | void ran_conn_msc_role_gone(struct ran_conn *conn, struct osmo_fsm_inst *msc_role); |
| 32 | void ran_conn_close(struct ran_conn *conn); |
| 33 | void ran_conn_discard(struct ran_conn *conn); |