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/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/22832 )
Change subject: xua: introduce xua_msg_get_u32p() helper
......................................................................
xua: introduce xua_msg_get_u32p() helper
Change-Id: Id7780074b82bc668ae148456750b1a01799decd1
---
M include/osmocom/sigtran/xua_msg.h
M src/xua_msg.c
2 files changed, 11 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/32/22832/1
diff --git a/include/osmocom/sigtran/xua_msg.h b/include/osmocom/sigtran/xua_msg.h
index 329ba96..11bce6f 100644
--- a/include/osmocom/sigtran/xua_msg.h
+++ b/include/osmocom/sigtran/xua_msg.h
@@ -91,6 +91,7 @@
int xua_msg_add_u32(struct xua_msg *xua, uint16_t iei, uint32_t val);
uint32_t xua_msg_part_get_u32(const struct xua_msg_part *part);
uint32_t xua_msg_get_u32(const struct xua_msg *xua, uint16_t iei);
+const uint32_t *xua_msg_get_u32p(const struct xua_msg *xua, uint16_t iei, uint32_t *out);
const char *xua_msg_part_get_str(const struct xua_msg_part *part);
const char *xua_msg_get_str(const struct xua_msg *xua, uint16_t iei);
void xua_part_add_gt(struct msgb *msg, const struct osmo_sccp_gt *gt);
diff --git a/src/xua_msg.c b/src/xua_msg.c
index 42c580d..1df9abd 100644
--- a/src/xua_msg.c
+++ b/src/xua_msg.c
@@ -297,6 +297,16 @@
return xua_msg_part_get_u32(part);
}
+/* get a U32 IE in host-byte-order, returning whether it exists (!= NULL) or not (== NULL) */
+const uint32_t *xua_msg_get_u32p(const struct xua_msg *xua, uint16_t iei, uint32_t *out)
+{
+ struct xua_msg_part *part = xua_msg_find_tag(xua, iei);
+ if (!part)
+ return NULL;
+ *out = xua_msg_part_get_u32(part);
+ return out;
+}
+
const char *xua_msg_part_get_str(const struct xua_msg_part *part)
{
static char __thread buf[256];
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/22832
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Id7780074b82bc668ae148456750b1a01799decd1
Gerrit-Change-Number: 22832
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210210/41d6894c/attachment.htm>