From 11a4d9dd91216fe353e94bfdbbab53bc4f891c0d Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Thu, 15 Feb 2018 18:28:04 +0100 Subject: support for more cell ID list types in libosmocore Introduce gsm0808_dec_cell_id_list2() with supports additional types of cell identifier lists. The new parsing routines are based on similar routines used by the paging code in osmo-bsc's osmo_bsc_bssap.c. Likewise, introduce gsm0808_enc_cell_id_list2() with support for the same additional types of cell identifier lists. The old API using struct gsm0808_cell_id_list is deprecated. The previous definition was insufficient because it assumed that all decoded cell ID types could be represented with a single uint16_t. It was declared in a GSM protocol header (gsm/protocol/gsm_08_08.h) despite being a host-side representation of data in an IE. The only user I am aware of is in osmo-msc, where this struct is used for one local variable. osmo-msc releases >= 1.1.0 make use of this API. While here, fix a small bug in a test: test_gsm0808_enc_dec_cell_id_list_bss() set the cell ID type to 'LAC' but obviously wants to use type 'BSS'. Change-Id: Ib7e754f538df0c83298a3c958b4e15a32fcb8abb Related: OS#2847 --- include/osmocom/gsm/protocol/gsm_08_08.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/osmocom/gsm/protocol') diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index ba347eff..947f90f2 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -501,8 +501,13 @@ struct gsm0808_encrypt_info { unsigned int key_len; }; -/* 3GPP TS 48.008 3.2.2.27 Cell Identifier List */ #define CELL_ID_LIST_LAC_MAXLEN 127 +/*! + * DEPRECATED: This definition of the cell identifier list is + * insufficient. It cannot support all types of cell identifiers. + * Use struct gsm0808_cell_id_list2 in gsm0808_utils.h instead. + * + * 3GPP TS 48.008 3.2.2.27 Cell Identifier List */ struct gsm0808_cell_id_list { uint8_t id_discr; uint16_t id_list_lac[CELL_ID_LIST_LAC_MAXLEN]; -- cgit v1.2.3