blob: 8bbd55241141584c9195281fd587c118d92f27ea [file] [log] [blame]
Harald Weltec997ceb2018-05-30 01:39:43 +02001#pragma once
Pau Espin Pedrol2cfd0002019-03-12 18:53:26 +01002
3#include "gsm_data.h"
4
Harald Weltec997ceb2018-05-30 01:39:43 +02005#include <osmocom/core/fsm.h>
6
7enum lcls_fsm_state {
8 ST_NO_LCLS,
9 ST_NOT_YET_LS,
10 ST_NOT_POSSIBLE_LS,
11 ST_NO_LONGER_LS,
12 ST_REQ_LCLS_NOT_SUPP,
13 ST_LOCALLY_SWITCHED,
14 /* locally switched; received remote break; wait for "local" break */
15 ST_LOCALLY_SWITCHED_WAIT_BREAK,
16 /* locally switched; received break; wait for "other" break */
17 ST_LOCALLY_SWITCHED_WAIT_OTHER_BREAK,
18};
19
20enum lcls_event {
21 /* update LCLS config/control based on some BSSMAP signaling */
22 LCLS_EV_UPDATE_CFG_CSC,
23 /* apply LCLS config/control */
24 LCLS_EV_APPLY_CFG_CSC,
25 /* we have been identified as the correlation peer of another conn */
26 LCLS_EV_CORRELATED,
27 /* "other" LCLS connection has enabled local switching */
28 LCLS_EV_OTHER_ENABLED,
29 /* "other" LCLS connection is breaking local switch */
30 LCLS_EV_OTHER_BREAK,
31 /* "other" LCLS connection is dying */
32 LCLS_EV_OTHER_DEAD,
33};
34
Pau Espin Pedrol2cfd0002019-03-12 18:53:26 +010035enum bsc_lcls_mode {
36 BSC_LCLS_MODE_DISABLED,
37 BSC_LCLS_MODE_MGW_LOOP,
38 BSC_LCLS_MODE_BTS_LOOP,
39};
40
41extern const struct value_string bsc_lcls_mode_names[];
42
43static inline const char *bsc_lcls_mode_name(enum bsc_lcls_mode m)
44{
45 return get_value_string(bsc_lcls_mode_names, m);
46}
47
Max09273b72019-01-08 15:08:59 +010048enum gsm0808_lcls_status lcls_get_status(const struct gsm_subscriber_connection *conn);
Harald Weltec997ceb2018-05-30 01:39:43 +020049
50void lcls_update_config(struct gsm_subscriber_connection *conn,
51 const uint8_t *config, const uint8_t *control);
52
53void lcls_apply_config(struct gsm_subscriber_connection *conn);
54
55extern struct osmo_fsm lcls_fsm;