This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Max gerrit-no-reply at lists.osmocom.orgMax has uploaded this change for review. ( https://gerrit.osmocom.org/12080 Change subject: Add msgb_tl_put() helper ...................................................................... Add msgb_tl_put() helper When adding complex TLV structures where length of V is not known in advance it's handy to be able to simply add Tag and save the pointer to the Length field so it can be updated once entire Value is added and its length is known. Change-Id: I8dc1e4880352833a0a49c1dd0d7cb4148ac43aff --- M include/osmocom/gsm/tlv.h 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/80/12080/1 diff --git a/include/osmocom/gsm/tlv.h b/include/osmocom/gsm/tlv.h index 1ab964a..51bedd6 100644 --- a/include/osmocom/gsm/tlv.h +++ b/include/osmocom/gsm/tlv.h @@ -324,6 +324,18 @@ return v_put(buf, val); } +/*! put (append) a TL fields to a \ref msgb + * \returns pointer to the length field so it can be updated after adding new information under specified tag */ +static inline uint8_t *msgb_tl_put(struct msgb *msg, uint8_t tag) +{ + uint8_t *len = msgb_v_put(msg, tag); + + /* reserve space for length, len points to this reserved space already */ + msgb_v_put(msg, 0); + + return len; +} + /*! put (append) a TV16 field to a \ref msgb * \returns pointer to first byte after newly-put information */ static inline uint8_t *msgb_tv16_put(struct msgb *msg, uint8_t tag, uint16_t val) -- To view, visit https://gerrit.osmocom.org/12080 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I8dc1e4880352833a0a49c1dd0d7cb4148ac43aff Gerrit-Change-Number: 12080 Gerrit-PatchSet: 1 Gerrit-Owner: Max <msuraev at sysmocom.de> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181203/59e53541/attachment.htm>