From f74cfd35acadbebe7ccd9fc02d05920958f43ad3 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 24 Mar 2017 20:16:33 +0100 Subject: Add SW Description (de)marshalling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * data structure representing 3GPP TS 52.021 §9.4.62 SW Description * function to serialize it into msgb * function to deserialize it from buffer * functions to extract/estimate buffer size for SW Description * test harness (partially taken from OpenBSC) There are several similar functions to deal with SW Description in OpenBSC, there's also need to use similar functionality in OsmoBTS. Hence it's better to put the code into common library with proper tests and documentation. Change-Id: Ib63b6b5e83b8914864fc7edd789f8958cdc993cd Related: OS#1614 --- include/osmocom/gsm/protocol/gsm_12_21.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') diff --git a/include/osmocom/gsm/protocol/gsm_12_21.h b/include/osmocom/gsm/protocol/gsm_12_21.h index c88f0b13..b35da447 100644 --- a/include/osmocom/gsm/protocol/gsm_12_21.h +++ b/include/osmocom/gsm/protocol/gsm_12_21.h @@ -29,6 +29,7 @@ /*! \file gsm_12_21.h */ #include +#include #include /*! \brief generic header in front of every OML message according to TS 08.59 */ @@ -791,6 +792,21 @@ enum ipac_bcch_info_type { IPAC_BINF_CELL_ALLOC = (1 << 2), }; +/*! \brief 3GPP TS 52.021 §9.4.62 SW Description */ +struct abis_nm_sw_desc { + uint8_t file_id[UINT8_MAX]; + uint8_t file_id_len; + + uint8_t file_version[UINT8_MAX]; + uint8_t file_version_len; +}; + +uint16_t abis_nm_sw_desc_len(const struct abis_nm_sw_desc *sw, bool put_sw_descr); +uint16_t abis_nm_put_sw_desc(struct msgb *msg, const struct abis_nm_sw_desc *sw, bool put_sw_descr); +uint16_t abis_nm_put_sw_file(struct msgb *msg, const char *id, const char *ver, bool put_sw_desc); +uint32_t abis_nm_get_sw_desc_len(const uint8_t * buf, size_t len); +int abis_nm_get_sw_conf(const uint8_t * buf, size_t buf_len, struct abis_nm_sw_desc *sw, uint16_t sw_len); + struct msgb *abis_nm_fail_evt_rep(enum abis_nm_event_type t, enum abis_nm_severity s, enum abis_nm_pcause_type ct, -- cgit v1.2.3