Change in libosmo-sccp[master]: add OSMO_SCCP_ADDR_T_MASK for osmo_sccp_addr_cmp()

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

neels gerrit-no-reply at lists.osmocom.org
Sat Sep 5 10:12:55 UTC 2020


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/19984 )


Change subject: add OSMO_SCCP_ADDR_T_MASK for osmo_sccp_addr_cmp()
......................................................................

add OSMO_SCCP_ADDR_T_MASK for osmo_sccp_addr_cmp()

Avoid magic number 0xffffffff and rather provide a mask value for all address
components.

Change-Id: I13ff0858e496c4392b8e1590d62f7eb80f191a07
---
M include/osmocom/sigtran/sccp_sap.h
M src/sccp_user.c
2 files changed, 3 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/84/19984/1

diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h
index 817ac45..de9b24c 100644
--- a/include/osmocom/sigtran/sccp_sap.h
+++ b/include/osmocom/sigtran/sccp_sap.h
@@ -51,6 +51,7 @@
 #define OSMO_SCCP_ADDR_T_SSN	0x0004 /* subsystem number */
 #define OSMO_SCCP_ADDR_T_IPv4	0x0008
 #define OSMO_SCCP_ADDR_T_IPv6	0x0010
+#define OSMO_SCCP_ADDR_T_MASK	0x001f
 
 /* Q.713 3.4.1 + RFC 3868 3.10.2.3 */
 enum osmo_sccp_routing_ind {
diff --git a/src/sccp_user.c b/src/sccp_user.c
index e1329ac..880cab1 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -342,8 +342,8 @@
  * The SCCP addresses' Routing Indicator is not compared, see osmo_sccp_addr_ri_cmp().
  * \param[in] a  left side.
  * \param[in] b  right side.
- * \param[in] presence_criteria  A bitmask of OSMO_SCCP_ADDR_T_* values, or 0xffffffff to compare all parts, except the
- *                               routing indicator.
+ * \param[in] presence_criteria  A bitmask of OSMO_SCCP_ADDR_T_* values, or OSMO_SCCP_ADDR_T_MASK to compare all parts,
+ *                               except the routing indicator.
  * \return -1 if a < b, 1 if a > b, and 0 if all checked values match.
  */
 int osmo_sccp_addr_cmp(const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b, uint32_t presence_criteria)

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

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I13ff0858e496c4392b8e1590d62f7eb80f191a07
Gerrit-Change-Number: 19984
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200905/d14fd553/attachment.htm>


More information about the gerrit-log mailing list