From 84fb5bb6a09a6a358f98c654c84c3b99a0f24eef Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 8 Nov 2018 13:23:59 +0100 Subject: Move msgb_push helpers to public header The msgb_wrap_with_TL() is generally useful so it make sense to make it public to facilitate code re-use. Other helpers can be implemented as trivial wrappers over existing tlv.h functions. Update headers and code accordingly. Change-Id: I37e91d031fba28cf1c6735b8069b0265746f55e6 --- include/osmocom/gsm/tlv.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/osmocom/gsm') diff --git a/include/osmocom/gsm/tlv.h b/include/osmocom/gsm/tlv.h index 84fd511e..1ab964ad 100644 --- a/include/osmocom/gsm/tlv.h +++ b/include/osmocom/gsm/tlv.h @@ -341,6 +341,12 @@ static inline uint8_t *msgb_tlv_push(struct msgb *msg, uint8_t tag, uint8_t len, return buf; } +/*! push 1-byte tagged value */ +static inline uint8_t *msgb_tlv1_push(struct msgb *msg, uint8_t tag, uint8_t val) +{ + return msgb_tlv_push(msg, tag, 1, &val); +} + /*! push (prepend) a TV field to a \ref msgb * \returns pointer to first byte of newly-pushed information */ static inline uint8_t *msgb_tv_push(struct msgb *msg, uint8_t tag, uint8_t val) -- cgit v1.2.3