aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2022-04-25 10:53:41 +0200
committerlaforge <laforge@osmocom.org>2022-04-28 13:48:20 +0000
commit484f535c5091e3ca62547f8bbb6e06844c2ce8ae (patch)
tree7bc114a77812207bd181b113dbb0d42e491b58f3 /include
parent5e7458cbd8d38b3a2d8f3444c79aa03e82104ade (diff)
smscb: Store ETWS input state from CBSP
Only if we store data like the CBSP message_id and serial_number we are able to later (in a subsequent patch) match a CBSP KILL for ETWS/PWS and stop emergency broadcast. Change-Id: Ide74638880d7e3c6a7c774bf6320d3dce4b11c74 Related: OS#5540
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/bsc/bts.h2
-rw-r--r--include/osmocom/bsc/gsm_data.h21
-rw-r--r--include/osmocom/bsc/smscb.h2
3 files changed, 24 insertions, 1 deletions
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index 151fd785c..7d51707be 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -589,7 +589,7 @@ struct gsm_bts {
struct osmo_timer_list cbch_timer;
struct bts_smscb_chan_state cbch_basic;
struct bts_smscb_chan_state cbch_extended;
- struct osmo_timer_list etws_timer; /* when to stop ETWS PN */
+ struct bts_etws_state etws;
struct llist_head oml_fail_rep;
struct llist_head chan_rqd_queue;
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index b478ba0ed..cb20b9ed3 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1086,6 +1086,27 @@ struct bts_smscb_chan_state {
uint8_t overflow;
};
+#define ETWS_PRIM_NOTIF_SIZE 56
+#define ETWS_SEC_INFO_SIZE (ETWS_PRIM_NOTIF_SIZE - sizeof(struct gsm341_etws_message))
+
+/* per-BTS ETWS/PWS (Emergency) state */
+struct bts_etws_state {
+ /* are we actively broadcasting emergency in this cell? */
+ bool active;
+ /* input parameters received from CBC */
+ struct {
+ uint16_t msg_id;
+ uint16_t serial_nr;
+ uint16_t warn_type;
+ uint8_t *sec_info;
+ } input;
+ /* encoded ETWS primary notification */
+ uint8_t primary[ETWS_PRIM_NOTIF_SIZE];
+
+ /* timer running for the duration of the ETWS Primary Notification (PN) */
+ struct osmo_timer_list timer;
+};
+
struct bts_oml_fail_rep {
struct llist_head list;
time_t time;
diff --git a/include/osmocom/bsc/smscb.h b/include/osmocom/bsc/smscb.h
index f48c1a170..5b0905bcf 100644
--- a/include/osmocom/bsc/smscb.h
+++ b/include/osmocom/bsc/smscb.h
@@ -64,3 +64,5 @@ struct bsc_cbc_link {
void cbc_vty_init(void);
int bsc_cbc_link_restart(void);
int cbsp_tx_decoded(struct bsc_cbc_link *cbc, struct osmo_cbsp_decoded *decoded);
+
+void bts_etws_init(struct gsm_bts *bts);