blob: 9e56f6b47f8b74beed4706f50f2ee0950822f8e5 [file] [log] [blame]
Harald Welte3561bd42018-01-28 03:04:16 +01001#pragma once
2#include <osmocom/core/fsm.h>
3
4enum gscon_fsm_event {
5 /* local SCCP stack tells us incoming conn from MSC */
6 GSCON_EV_A_CONN_IND,
7 /* RSL side requests CONNECT to MSC */
8 GSCON_EV_A_CONN_REQ,
9 /* MSC confirms the SCCP connection */
10 GSCON_EV_A_CONN_CFM,
11 /* MSC requests assignment */
12 GSCON_EV_A_ASSIGNMENT_CMD,
13 /* MSC has sent BSSMAP CLEAR CMD */
14 GSCON_EV_A_CLEAR_CMD,
15 /* MSC SCCP disconnect indication */
16 GSCON_EV_A_DISC_IND,
17 /* MSC sends Handover Request (in CR) */
18 GSCON_EV_A_HO_REQ,
19
20 /* RR ASSIGNMENT COMPLETE received */
21 GSCON_EV_RR_ASS_COMPL,
22 /* RR ASSIGNMENT FAIL received */
23 GSCON_EV_RR_ASS_FAIL,
Harald Welte3561bd42018-01-28 03:04:16 +010024
Harald Welte3561bd42018-01-28 03:04:16 +010025 /* RSL RLL Release Indication */
26 GSCON_EV_RLL_REL_IND,
27 /* RSL CONNection FAILure Indication */
28 GSCON_EV_RSL_CONN_FAIL,
29
30 /* RSL/lchan tells us clearing is complete */
31 GSCON_EV_RSL_CLEAR_COMPL,
32
33 /* Mobile-originated DTAP (from MS) */
34 GSCON_EV_MO_DTAP,
35 /* Mobile-terminated DTAP (from MSC) */
36 GSCON_EV_MT_DTAP,
37
38 /* Transmit custom SCCP message */
39 GSCON_EV_TX_SCCP,
40
41 /* MGW is indicating failure (BTS) */
42 GSCON_EV_MGW_FAIL_BTS,
43 /* MGW is indicating failure (MSC) */
44 GSCON_EV_MGW_FAIL_MSC,
45 /* CRCX response received (BTS) */
46 GSCON_EV_MGW_CRCX_RESP_BTS,
47 /* MDCX response received (BTS) */
48 GSCON_EV_MGW_MDCX_RESP_BTS,
49 /* CRCX response received (MSC) */
50 GSCON_EV_MGW_CRCX_RESP_MSC,
Harald Weltec997ceb2018-05-30 01:39:43 +020051 /* MDCX response received (MSC) - triggered by LCLS */
52 GSCON_EV_MGW_MDCX_RESP_MSC,
Harald Welte3561bd42018-01-28 03:04:16 +010053
54 /* Internal handover request (intra-BSC handover) */
55 GSCON_EV_HO_START,
56 /* Handover timed out (T3103 in handover_logic.c) */
57 GSCON_EV_HO_TIMEOUT,
58 /* Handover failed (handover_logic.c) */
59 GSCON_EV_HO_FAIL,
60 /* Handover completed successfully (handover_logic.c) */
61 GSCON_EV_HO_COMPL,
Harald Weltec997ceb2018-05-30 01:39:43 +020062
63 /* LCLS child FSM has terminated due to hard failure */
64 GSCON_EV_LCLS_FAIL,
Harald Welte3561bd42018-01-28 03:04:16 +010065};
66
67struct gsm_subscriber_connection;
68struct gsm_network;
Philipp Maier116e05e2018-06-26 18:21:30 +020069struct mgcp_conn_peer;
Harald Welte3561bd42018-01-28 03:04:16 +010070
71/* Allocate a subscriber connection and its associated FSM */
72struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_network *net);
Philipp Maier116e05e2018-06-26 18:21:30 +020073
74void bsc_subscr_pick_codec(struct mgcp_conn_peer *conn_peer, struct gsm_subscriber_connection *conn);