Change in libosmocore[master]: tlv: add msgb_tv32_put(), similar to msgb_tv16_put()

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/.

fixeria gerrit-no-reply at lists.osmocom.org
Sat Feb 6 16:17:13 UTC 2021


fixeria has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/22758 )

Change subject: tlv: add msgb_tv32_put(), similar to msgb_tv16_put()
......................................................................

tlv: add msgb_tv32_put(), similar to msgb_tv16_put()

Change-Id: I11301b20038aa5d90d46d968f7eda3d53b560022
---
M include/osmocom/gsm/tlv.h
1 file changed, 10 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/gsm/tlv.h b/include/osmocom/gsm/tlv.h
index fe057f4..bcdebb3 100644
--- a/include/osmocom/gsm/tlv.h
+++ b/include/osmocom/gsm/tlv.h
@@ -414,6 +414,16 @@
 	return tv16_put(buf, tag, val);
 }
 
+/*! put (append) a TV32 field to a \ref msgb
+ *  \returns pointer to first byte after newly-put information */
+static inline uint8_t *msgb_tv32_put(struct msgb *msg, uint8_t tag, uint32_t val)
+{
+	uint8_t *buf = msgb_put(msg, 1 + 4);
+	*buf++ = tag;
+	osmo_store32be(val, buf);
+	return msg->tail;
+}
+
 /*! push (prepend) a TLV field to a \ref msgb
  *  \returns pointer to first byte of newly-pushed information */
 static inline uint8_t *msgb_tlv_push(struct msgb *msg, uint8_t tag, uint8_t len, const uint8_t *val)

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22758
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I11301b20038aa5d90d46d968f7eda3d53b560022
Gerrit-Change-Number: 22758
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210206/21b7b11a/attachment.htm>


More information about the gerrit-log mailing list