Harald Welte | 3561bd4 | 2018-01-28 03:04:16 +0100 | [diff] [blame] | 1 | #pragma once |
| 2 | #include <osmocom/core/fsm.h> |
| 3 | |
| 4 | enum 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 Welte | 3561bd4 | 2018-01-28 03:04:16 +0100 | [diff] [blame] | 24 | |
Harald Welte | 3561bd4 | 2018-01-28 03:04:16 +0100 | [diff] [blame] | 25 | /* 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 Welte | c997ceb | 2018-05-30 01:39:43 +0200 | [diff] [blame] | 51 | /* MDCX response received (MSC) - triggered by LCLS */ |
| 52 | GSCON_EV_MGW_MDCX_RESP_MSC, |
Harald Welte | 3561bd4 | 2018-01-28 03:04:16 +0100 | [diff] [blame] | 53 | |
| 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 Welte | c997ceb | 2018-05-30 01:39:43 +0200 | [diff] [blame] | 62 | |
| 63 | /* LCLS child FSM has terminated due to hard failure */ |
| 64 | GSCON_EV_LCLS_FAIL, |
Harald Welte | 3561bd4 | 2018-01-28 03:04:16 +0100 | [diff] [blame] | 65 | }; |
| 66 | |
| 67 | struct gsm_subscriber_connection; |
| 68 | struct gsm_network; |
Philipp Maier | 116e05e | 2018-06-26 18:21:30 +0200 | [diff] [blame^] | 69 | struct mgcp_conn_peer; |
Harald Welte | 3561bd4 | 2018-01-28 03:04:16 +0100 | [diff] [blame] | 70 | |
| 71 | /* Allocate a subscriber connection and its associated FSM */ |
| 72 | struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_network *net); |
Philipp Maier | 116e05e | 2018-06-26 18:21:30 +0200 | [diff] [blame^] | 73 | |
| 74 | void bsc_subscr_pick_codec(struct mgcp_conn_peer *conn_peer, struct gsm_subscriber_connection *conn); |