aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmocom/gsm/protocol/gsm_04_12.h68
1 files changed, 68 insertions, 0 deletions
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_