aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/gsm/tlv.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-12-04 14:09:22 +0100
committerlaforge <laforge@osmocom.org>2020-12-08 12:27:38 +0000
commit30a929430686149f7f9cb6d29a3fae834e33ed85 (patch)
tree28ebe8e2d38277d5e8d38b4ee99d46d7ede5ce55 /include/osmocom/gsm/tlv.h
parent9510992c532e9046f887f6da055bb1bdb6118915 (diff)
tlv: Introduce enum with error codes for TLV parser functions
Diffstat (limited to 'include/osmocom/gsm/tlv.h')
-rw-r--r--include/osmocom/gsm/tlv.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/osmocom/gsm/tlv.h b/include/osmocom/gsm/tlv.h
index a307b3de..d34b7dab 100644
--- a/include/osmocom/gsm/tlv.h
+++ b/include/osmocom/gsm/tlv.h
@@ -40,6 +40,16 @@
/*! maximum length of TLV of one byte length */
#define TVLV_MAX_ONEBYTE 0x7f
+/*! error return codes of various TLV parser functions */
+enum osmo_tlv_parser_error {
+ OSMO_TLVP_ERR_OFS_BEYOND_BUFFER = -1,
+ OSMO_TLVP_ERR_OFS_LEN_BEYOND_BUFFER = -2,
+ OSMO_TLVP_ERR_UNKNOWN_TLV_TYPE = -3,
+
+ OSMO_TLVP_ERR_MAND_IE_MISSING = -50,
+ OSMO_TLVP_ERR_IE_TOO_SHORT = -51,
+};
+
/*! gross length of a TVLV type field */
static inline uint16_t TVLV_GROSS_LEN(uint16_t len)
{