blob: 3eaa5891afe7fd744eafd00a50c9d98e65ca7027 [file] [log] [blame]
Harald Weltec997ceb2018-05-30 01:39:43 +02001#pragma once
2#include <osmocom/core/fsm.h>
3
4enum lcls_fsm_state {
5 ST_NO_LCLS,
6 ST_NOT_YET_LS,
7 ST_NOT_POSSIBLE_LS,
8 ST_NO_LONGER_LS,
9 ST_REQ_LCLS_NOT_SUPP,
10 ST_LOCALLY_SWITCHED,
11 /* locally switched; received remote break; wait for "local" break */
12 ST_LOCALLY_SWITCHED_WAIT_BREAK,
13 /* locally switched; received break; wait for "other" break */
14 ST_LOCALLY_SWITCHED_WAIT_OTHER_BREAK,
15};
16
17enum lcls_event {
18 /* update LCLS config/control based on some BSSMAP signaling */
19 LCLS_EV_UPDATE_CFG_CSC,
20 /* apply LCLS config/control */
21 LCLS_EV_APPLY_CFG_CSC,
22 /* we have been identified as the correlation peer of another conn */
23 LCLS_EV_CORRELATED,
24 /* "other" LCLS connection has enabled local switching */
25 LCLS_EV_OTHER_ENABLED,
26 /* "other" LCLS connection is breaking local switch */
27 LCLS_EV_OTHER_BREAK,
28 /* "other" LCLS connection is dying */
29 LCLS_EV_OTHER_DEAD,
30};
31
32enum gsm0808_lcls_status lcls_get_status(struct gsm_subscriber_connection *conn);
33
34void lcls_update_config(struct gsm_subscriber_connection *conn,
35 const uint8_t *config, const uint8_t *control);
36
37void lcls_apply_config(struct gsm_subscriber_connection *conn);
38
39extern struct osmo_fsm lcls_fsm;
40
Neels Hofmeyr31f525e2018-05-14 18:14:15 +020041void bssmap_add_lcls_status_if_needed(struct gsm_subscriber_connection *conn, struct msgb *msg);