From b91a106932187125e00646ff9fd919050f533464 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Wed, 6 Jan 2010 06:38:14 +0100 Subject: [si] Go through the system_information structs and add static_asserts The structs are correct, the problem is coming from the rest octets --- openbsc/src/system_information.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'openbsc/src/system_information.c') 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 */ -- cgit v1.2.3