aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/gprs_utils.h
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-12-11 11:01:46 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-12-23 15:08:52 +0100
commitdcfd456640b6e15f15c94f175eb145220b96ee1a (patch)
treecedfd3be2439683f569a3adacb536a692b7f989f /openbsc/include/openbsc/gprs_utils.h
parentc93919655753591bc883165f03f204a8773c4f64 (diff)
gprs: Move TLV parser functions to gprs_utils.c and rename them
Currently the parser functions for single information elements are defined within gprs_gb_parse.c and not exported explicitely. In addition they are named like libosmocore's TLV parser functions and do not have a proper name prefix. Since it is planned to use them for other protocols, they need to be globally accessible. This patch moves them to gprs_utils.c and renames them. The new names are: lv_shift -> gprs_shift_lv v_fixed_shift -> gprs_shift_v_fixed lv_shift -> gprs_shift_lv v_fixed_shift -> gprs_shift_v_fixed In the long term, these functions should be moved to libosmocore (and renamed again). Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/include/openbsc/gprs_utils.h')
-rw-r--r--openbsc/include/openbsc/gprs_utils.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gprs_utils.h b/openbsc/include/openbsc/gprs_utils.h
index 93c53501d..60d0ef6f5 100644
--- a/openbsc/include/openbsc/gprs_utils.h
+++ b/openbsc/include/openbsc/gprs_utils.h
@@ -35,3 +35,13 @@ int gprs_is_mi_tmsi(const uint8_t *value, size_t value_len);
int gprs_is_mi_imsi(const uint8_t *value, size_t value_len);
int gprs_parse_mi_tmsi(const uint8_t *value, size_t value_len, uint32_t *tmsi);
void gprs_parse_tmsi(const uint8_t *value, uint32_t *tmsi);
+
+int gprs_shift_v_fixed(uint8_t **data, size_t *data_len,
+ size_t len, uint8_t **value);
+int gprs_match_tv_fixed(uint8_t **data, size_t *data_len,
+ uint8_t tag, size_t len, uint8_t **value);
+int gprs_match_tlv(uint8_t **data, size_t *data_len,
+ uint8_t tag, uint8_t **value, size_t *value_len);
+int gprs_shift_lv(uint8_t **data, size_t *data_len,
+ uint8_t **value, size_t *value_len);
+