Change in libosmocore[master]: add osmo_bssap_tlv_parse2() for multiple identical T

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Wed Apr 10 17:50:47 UTC 2019


Neels Hofmeyr has uploaded this change for review. ( https://gerrit.osmocom.org/13580


Change subject: add osmo_bssap_tlv_parse2() for multiple identical T
......................................................................

add osmo_bssap_tlv_parse2() for multiple identical T

In BSSMAP messages, at least the Cell Identifier IE can appear more than once.

We have tlv_parse2() which allows decoding into an array of tlv_parsed to
cleanly handle multiple occurences. Hence add osmo_bssap_tlv_parse2() which
supports multiple occurences.

An alternative would be to directly call tlv_parse2() with gsm0808_att_tlvdef()
when multiple T occurences are needed, and I'm not really sure why
osmo_bssap_tlv_parse() exists in the first place. But because it does, add a
similar definition that is capable of handling multiple IEs with identical Tag
discriminator.

Change-Id: Ib9a2095f7498dc2cda2a57154b2dbe4621df72f8
---
M include/osmocom/gsm/gsm0808.h
1 file changed, 3 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/80/13580/1

diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h
index b31f07d..a4e63a9 100644
--- a/include/osmocom/gsm/gsm0808.h
+++ b/include/osmocom/gsm/gsm0808.h
@@ -305,6 +305,9 @@
 
 /*! Parse BSSAP TLV structure using \ref tlv_parse */
 #define osmo_bssap_tlv_parse(dec, buf, len) tlv_parse(dec, gsm0808_att_tlvdef(), buf, len, 0, 0)
+/*! Parse BSSAP TLV structure using \ref tlv_parse2 */
+#define osmo_bssap_tlv_parse2(dec, dec_multiples, buf, len) \
+	tlv_parse2(dec, dec_multiples, gsm0808_att_tlvdef(), buf, len, 0, 0)
 
 const char *gsm0808_bssmap_name(uint8_t msg_type);
 const char *gsm0808_bssap_name(uint8_t msg_type);

-- 
To view, visit https://gerrit.osmocom.org/13580
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9a2095f7498dc2cda2a57154b2dbe4621df72f8
Gerrit-Change-Number: 13580
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190410/95fea588/attachment.html>


More information about the gerrit-log mailing list