From 06eb1089ea0cd0a5343965c860ed2d96e3fb90bd Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 25 Sep 2018 16:33:59 +0200 Subject: WIP: gsm_412 Cell Broadcast Related: OS#3537 Change-Id: I1a17c2ae8bf62150327956c10cb5bb896939e3fd --- include/osmocom/gsm/protocol/gsm_04_12.h | 68 ++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'include') diff --git a/include/osmocom/gsm/protocol/gsm_04_12.h b/include/osmocom/gsm/protocol/gsm_04_12.h index 3f34ee7f..97611c08 100644 --- a/include/osmocom/gsm/protocol/gsm_04_12.h +++ b/include/osmocom/gsm/protocol/gsm_04_12.h @@ -44,3 +44,71 @@ struct gsm412_sched_msg { uint8_t data[0]; #endif } __attribute__((packed)); + +/* Section 9.3: ?? */ + +/* 9.3.24: Warning Tyoe */ +#define GSM412_WARN_TYPE_EARTHQUAKE 0x00 +#define GSM412_WARN_TYPE_TSUNAMI 0x01 +#define GSM412_WARN_TYPE_QUAKE_ANDTSUNAMI 0x02 +#define GSM412_WARN_TYPE_TEST 0x03 +#define GSM412_WARN_TYPE_OTHER 0x04 +struct gsm412_warning_type { + uint16_t warning_type:7, + emerg_user_alert:1, + popup:1, + padding:7; +} __attribute__((packed)); + + +/* 9.3.25 */ +struct gsm412_warning_sec_info { + uint8_t year; + uint8_t month; + uint8_t day; + uint8_t hour; + uint8_t minute; + uint8_t second; + uint8_t timezone; + uint8_t signature[43]; +} __attribute__((packed)); + +/* Section 9.4: Message Format on the Radio Network - MS/UE Interface */ + +/* 9.4.1.2.1 Serial Number */ +#define GSM412_SERNR_GS_CELL_IMM 0 +#define GSM412_SERNR_GS_PLMN_NORM 1 +#define GSM412_SERNR_GS_LA_SA_TA_NORM 2 +#define GSM412_SERNR_GS_CELL_NORM 3 + +struct gsm412_9_serial_nr { + uint16_t gs:2, + msg_code:10, + update_nr: 4; +} __attribute__((packed)); + +/* 9.4.1.2.4 Page Parameter */ +struct gsm412_9_page_param { + uint8_t total_pages:4, + page_nr:4; +} __attribute__((packed)); + +/* 9.4.1.2 Message Parameter */ +struct gsm412_9_message { + struct gsm412_9_serial_nr ser_nr; /* 9.4.1.2.1 */ + uint16_t msg_id; /* 9.4.1.2.2 */ + uint8_t dcs; /* TS 23.038 */ + struct gsm412_9_page_param page_param; /* 9.4.1.2.4 */ + uint8_t content[0]; /* byte 7..88, i.e. 0-82 octets */ +} __attribute__((packed)); + +/* 9.4.1.3 ETWS Primary Notification Message */ +struct gsm412_9_etws_prim_notif_msg { + struct gsm412_9_serial_nr ser_nr; /* 9.4.1.2.1 */ + uint16_t msg_id; /* 9.4.1.2.2 */ + struct gsm412_warning_type warning_type; /* 9.3.24 */ + uint8_t warning_sec_info[50]; /* 9.3.25 */ +} __attribute__((packed)); + + +//struct gsm412_ -- cgit v1.2.3