From f558ed4bb9c0f00997b8f97c2b251a574c1a64c4 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 2 Jun 2015 15:52:06 +0200 Subject: ipa: Properly parse LV stream of a ID_GET request For some reason the structure is closer to be a LV (length and value). The value is actually a tag but it is counted inside the length. Introduce an overload of the parse function to provide an offset for the length. This will be taken from the returned length. --- include/osmocom/gsm/ipa.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/osmocom') diff --git a/include/osmocom/gsm/ipa.h b/include/osmocom/gsm/ipa.h index 1227ee17..0bb01c59 100644 --- a/include/osmocom/gsm/ipa.h +++ b/include/osmocom/gsm/ipa.h @@ -27,6 +27,9 @@ const char *ipa_ccm_idtag_name(uint8_t tag); /* parse a buffer of ID tags into a osmocom TLV style representation */ int ipa_ccm_idtag_parse(struct tlv_parsed *dec, unsigned char *buf, int len); +/* Is the TAG included in the length field? */ +int ipa_ccm_idtag_parse_off(struct tlv_parsed *dec, unsigned char *buf, int len, const int len_offset); + /* parse an Unit ID in string format into the 'ipaccess_unit' data structure */ int ipa_parse_unitid(const char *str, struct ipaccess_unit *unit_data); -- cgit v1.2.3