summaryrefslogtreecommitdiffstats
path: root/include/osmocom/gsm
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-03-24 20:16:33 +0100
committerMax <msuraev@sysmocom.de>2017-04-28 08:45:09 +0000
commitf74cfd35acadbebe7ccd9fc02d05920958f43ad3 (patch)
tree77392c943c0633674807e1a311428d78221b8623 /include/osmocom/gsm
parent8a4895c0e5de4f04b5de85ed6bbae60edca3df9c (diff)
Add SW Description (de)marshalling
* 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
Diffstat (limited to 'include/osmocom/gsm')
-rw-r--r--include/osmocom/gsm/protocol/gsm_12_21.h16
1 files changed, 16 insertions, 0 deletions
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 <stdint.h>
+#include <stdbool.h>
#include <osmocom/gsm/tlv.h>
/*! \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,