summaryrefslogtreecommitdiffstats
path: root/src/shared/libosmocore/src
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2010-04-25 17:53:16 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2010-04-25 17:53:16 +0200
commitd0629eee06c529683508be78bb9b14b3f0d7996c (patch)
tree826c2c1cb7abf720436bcc0b231326955a76a192 /src/shared/libosmocore/src
parente91d8a934c685f9d89f10d3e2fd927102f022cd3 (diff)
Added single octet TV (type + value) to libosmocore.
In case of a single octet, the upper nibble is the type, the lower nibble carries the value.
Diffstat (limited to 'src/shared/libosmocore/src')
-rw-r--r--src/shared/libosmocore/src/tlv_parser.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/shared/libosmocore/src/tlv_parser.c b/src/shared/libosmocore/src/tlv_parser.c
index 407e57aa..bbef7a9a 100644
--- a/src/shared/libosmocore/src/tlv_parser.c
+++ b/src/shared/libosmocore/src/tlv_parser.c
@@ -36,6 +36,14 @@ int tlv_parse_one(uint8_t *o_tag, uint16_t *o_len, const uint8_t **o_val,
tag = *buf;
*o_tag = tag;
+ /* single octet TV IE */
+ if (def->def[tag & 0xf0].type == TLV_TYPE_SINGLE_TV) {
+ *o_tag = tag & 0xf0;
+ *o_val = buf;
+ *o_len = 1;
+ return 1;
+ }
+
/* FIXME: use tables for knwon IEI */
switch (def->def[tag].type) {
case TLV_TYPE_T: