aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/system_information.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-01-06 06:38:14 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-01-06 06:38:14 +0100
commitb91a106932187125e00646ff9fd919050f533464 (patch)
tree85123eb1fba644e7605de58ba4989220334fbdd4 /openbsc/src/system_information.c
parent424c4f0e2927d5a7538b31c69113c6e4f861d2c9 (diff)
[si] Go through the system_information structs and add static_asserts
The structs are correct, the problem is coming from the rest octets
Diffstat (limited to 'openbsc/src/system_information.c')
-rw-r--r--openbsc/src/system_information.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/openbsc/src/system_information.c b/openbsc/src/system_information.c
index 6493794ef..42cd8ec6a 100644
--- a/openbsc/src/system_information.c
+++ b/openbsc/src/system_information.c
@@ -38,6 +38,22 @@
#define GSM_MACBLOCK_LEN 23
#define GSM_MACBLOCK_PADDING 0x2b
+/* verify the sizes of the system information type structs */
+
+/* rest octets are not part of the struct */
+static_assert(sizeof(struct gsm48_system_information_type_header) == 3, _si_header_size);
+static_assert(sizeof(struct gsm48_rach_control) == 3, _si_rach_control);
+static_assert(sizeof(struct gsm48_system_information_type_1) == 22, _si1_size);
+static_assert(sizeof(struct gsm48_system_information_type_2) == 23, _si2_size);
+static_assert(sizeof(struct gsm48_system_information_type_3) == 19, _si3_size);
+static_assert(sizeof(struct gsm48_system_information_type_4) == 13, _si4_size);
+
+/* bs11 forgot the l2 len, 0-6 rest octets */
+static_assert(sizeof(struct gsm48_system_information_type_5) == 18, _si5_size);
+static_assert(sizeof(struct gsm48_system_information_type_6) == 11, _si6_size);
+
+static_assert(sizeof(struct gsm48_system_information_type_13) == 3, _si13_size);
+
/* Frequency Lists as per TS 04.08 10.5.2.13 */
/* 10.5.2.13.2: Bit map 0 format */