From 21ff9ae4264de159784a59ce4421365007bde08d Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 25 Jan 2019 15:47:24 +0100 Subject: add osmo_sccp_addr_cmp(), osmo_sccp_addr_ri_cmp() osmo-msc identifies its BSC and RNC peers by SCCP address, and compares those by memcmp(), which is not really accurate. Rather provide a meaningful osmo_sccp_addr_cmp() API to determine whether SCCP addresses are identical. Go for a full cmp that would also allow sorting. Change-Id: Ie9e2add7bbfae651c04e230d62e37cebeb91b0f5 --- include/osmocom/sigtran/sccp_sap.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index f64b7aa..9d285eb 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -276,5 +276,8 @@ void osmo_sccp_local_addr_by_instance(struct osmo_sccp_addr *dest_addr, uint32_t ssn); bool osmo_sccp_check_addr(struct osmo_sccp_addr *addr, uint32_t presence); +int osmo_sccp_addr_cmp(const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b, uint32_t presence_criteria); +int osmo_sccp_addr_ri_cmp(const struct osmo_sccp_addr *a, const struct osmo_sccp_addr *b); +int osmo_sccp_gt_cmp(const struct osmo_sccp_gt *a, const struct osmo_sccp_gt *b); const char *osmo_sccp_user_name(struct osmo_sccp_user *scu); -- cgit v1.2.3