pespin submitted this change.
sigtran: Make osmo_ss7_route_table APIs private
The routing table is actually handled internally through VTY and no user
is making use of it.
Make it private, to ease extension in the future (it will be extended
to eg. support combined link load sharing).
Change-Id: Ie7c709c9849ef3d50aef94f79751c9c4a010c92a
---
M include/osmocom/sigtran/osmo_ss7.h
M src/Makefile.am
M src/osmo_ss7.c
M src/osmo_ss7_as.c
M src/osmo_ss7_hmrt.c
A src/osmo_ss7_route_table.c
M src/osmo_ss7_vty.c
M src/sccp_user.c
A src/ss7_route_table.h
M src/xua_as_fsm.c
M src/xua_rkm.c
M tests/ss7/ss7_test.c
12 files changed, 188 insertions(+), 142 deletions(-)
diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index 049c7d8..d009958 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -18,6 +18,7 @@
struct osmo_sccp_instance;
struct osmo_mtp_prim;
struct osmo_xua_layer_manager;
+struct osmo_ss7_route_table;
int osmo_ss7_init(void);
int osmo_ss7_find_free_rctx(struct osmo_ss7_instance *inst);
@@ -38,30 +39,6 @@
}
/***********************************************************************
- * SS7 Routing Tables
- ***********************************************************************/
-
-struct osmo_ss7_route_table {
- /*! member in list of routing tables */
- struct llist_head list;
- /*! \ref osmo_ss7_instance to which we belong */
- struct osmo_ss7_instance *inst;
- /*! list of \ref osmo_ss7_route */
- struct llist_head routes;
-
- struct {
- char *name;
- char *description;
- } cfg;
-};
-
-struct osmo_ss7_route_table *
-osmo_ss7_route_table_find(struct osmo_ss7_instance *inst, const char *name);
-struct osmo_ss7_route_table *
-osmo_ss7_route_table_find_or_create(struct osmo_ss7_instance *inst, const char *name);
-void osmo_ss7_route_table_destroy(struct osmo_ss7_route_table *rtbl);
-
-/***********************************************************************
* SS7 Instances
***********************************************************************/
@@ -230,11 +207,6 @@
};
struct osmo_ss7_route *
-osmo_ss7_route_find_dpc(struct osmo_ss7_route_table *rtbl, uint32_t dpc);
-struct osmo_ss7_route *
-osmo_ss7_route_find_dpc_mask(struct osmo_ss7_route_table *rtbl, uint32_t dpc,
- uint32_t mask);
-struct osmo_ss7_route *
osmo_ss7_route_lookup(struct osmo_ss7_instance *inst, uint32_t dpc);
struct osmo_ss7_route *
osmo_ss7_route_create(struct osmo_ss7_route_table *rtbl, uint32_t dpc,
diff --git a/src/Makefile.am b/src/Makefile.am
index 2a257ae..5dddb05 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,6 +5,7 @@
noinst_HEADERS = \
sccp_internal.h \
ss7_internal.h \
+ ss7_route_table.h \
xua_asp_fsm.h \
xua_as_fsm.h \
xua_internal.h \
@@ -37,6 +38,7 @@
osmo_ss7_hmrt.c \
osmo_ss7_vty.c \
osmo_ss7_xua_srv.c \
+ osmo_ss7_route_table.c \
sccp2sua.c \
sccp_helpers.c \
sccp_lbcs.c \
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 93bcfc2..38b07da 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -51,6 +51,7 @@
#include "sccp_internal.h"
#include "xua_internal.h"
#include "ss7_internal.h"
+#include "ss7_route_table.h"
#include "xua_asp_fsm.h"
#include "xua_as_fsm.h"
@@ -342,7 +343,7 @@
INIT_LLIST_HEAD(&inst->asp_list);
INIT_LLIST_HEAD(&inst->rtable_list);
INIT_LLIST_HEAD(&inst->xua_servers);
- inst->rtable_system = osmo_ss7_route_table_find_or_create(inst, "system");
+ inst->rtable_system = ss7_route_table_find_or_create(inst, "system");
/* default point code structure + formatting */
inst->cfg.pc_fmt.delimiter = '.';
@@ -610,49 +611,6 @@
return link;
}
-
-/***********************************************************************
- * SS7 Route Tables
- ***********************************************************************/
-
-struct osmo_ss7_route_table *
-osmo_ss7_route_table_find(struct osmo_ss7_instance *inst, const char *name)
-{
- struct osmo_ss7_route_table *rtbl;
- OSMO_ASSERT(ss7_initialized);
- llist_for_each_entry(rtbl, &inst->rtable_list, list) {
- if (!strcmp(rtbl->cfg.name, name))
- return rtbl;
- }
- return NULL;
-}
-
-struct osmo_ss7_route_table *
-osmo_ss7_route_table_find_or_create(struct osmo_ss7_instance *inst, const char *name)
-{
- struct osmo_ss7_route_table *rtbl;
-
- OSMO_ASSERT(ss7_initialized);
- rtbl = osmo_ss7_route_table_find(inst, name);
- if (!rtbl) {
- LOGSS7(inst, LOGL_INFO, "Creating Route Table %s\n", name);
- rtbl = talloc_zero(inst, struct osmo_ss7_route_table);
- rtbl->inst = inst;
- rtbl->cfg.name = talloc_strdup(rtbl, name);
- INIT_LLIST_HEAD(&rtbl->routes);
- llist_add_tail(&rtbl->list, &inst->rtable_list);
- }
- return rtbl;
-}
-
-void osmo_ss7_route_table_destroy(struct osmo_ss7_route_table *rtbl)
-{
- llist_del(&rtbl->list);
- /* routes are allocated as children of route table, will be
- * automatically freed() */
- talloc_free(rtbl);
-}
-
/***********************************************************************
* SS7 Routes
***********************************************************************/
@@ -752,53 +710,12 @@
return 0;
}
-/*! \brief Find a SS7 route for given destination point code in given table */
-struct osmo_ss7_route *
-osmo_ss7_route_find_dpc(struct osmo_ss7_route_table *rtbl, uint32_t dpc)
-{
- struct osmo_ss7_route *rt;
-
- OSMO_ASSERT(ss7_initialized);
-
- dpc = osmo_ss7_pc_normalize(&rtbl->inst->cfg.pc_fmt, dpc);
-
- /* we assume the routes are sorted by mask length, i.e. more
- * specific routes first, and less specific routes with shorter
- * mask later */
- llist_for_each_entry(rt, &rtbl->routes, list) {
- if ((dpc & rt->cfg.mask) == rt->cfg.pc)
- return rt;
- }
- return NULL;
-}
-
-/*! \brief Find a SS7 route for given destination point code + mask in given table */
-struct osmo_ss7_route *
-osmo_ss7_route_find_dpc_mask(struct osmo_ss7_route_table *rtbl, uint32_t dpc,
- uint32_t mask)
-{
- struct osmo_ss7_route *rt;
-
- OSMO_ASSERT(ss7_initialized);
- mask = osmo_ss7_pc_normalize(&rtbl->inst->cfg.pc_fmt, mask);
- dpc = osmo_ss7_pc_normalize(&rtbl->inst->cfg.pc_fmt, dpc);
-
- /* we assume the routes are sorted by mask length, i.e. more
- * specific routes first, and less specific routes with shorter
- * mask later */
- llist_for_each_entry(rt, &rtbl->routes, list) {
- if (dpc == rt->cfg.pc && mask == rt->cfg.mask)
- return rt;
- }
- return NULL;
-}
-
/*! \brief Find a SS7 route for given destination point code in given SS7 */
struct osmo_ss7_route *
osmo_ss7_route_lookup(struct osmo_ss7_instance *inst, uint32_t dpc)
{
OSMO_ASSERT(ss7_initialized);
- return osmo_ss7_route_find_dpc(inst->rtable_system, dpc);
+ return ss7_route_table_find_route_by_dpc(inst->rtable_system, dpc);
}
/* insert the route in the ordered list of routes. The list is sorted by
@@ -853,7 +770,7 @@
}
/* check for duplicates */
- prev_rt = osmo_ss7_route_find_dpc_mask(rtbl, rt->cfg.pc, rt->cfg.mask);
+ prev_rt = ss7_route_table_find_route_by_dpc_mask(rtbl, rt->cfg.pc, rt->cfg.mask);
if (prev_rt && !strcmp(prev_rt->cfg.linkset_name, rt->cfg.linkset_name)) {
LOGSS7(rtbl->inst, LOGL_ERROR,
"Refusing to create route with existing linkset name: pc=%u=%s mask=0x%x via linkset/AS '%s'\n",
@@ -899,7 +816,7 @@
/* Keep old behavior, return already existing route: */
if (rc == -EADDRINUSE) {
talloc_free(rt);
- return osmo_ss7_route_find_dpc_mask(rtbl, rt->cfg.pc, rt->cfg.mask);
+ return ss7_route_table_find_route_by_dpc_mask(rtbl, rt->cfg.pc, rt->cfg.mask);
}
return rt;
diff --git a/src/osmo_ss7_as.c b/src/osmo_ss7_as.c
index 9683e94..87e7e04 100644
--- a/src/osmo_ss7_as.c
+++ b/src/osmo_ss7_as.c
@@ -33,6 +33,7 @@
#include <osmocom/core/talloc.h>
#include <osmocom/core/logging.h>
+#include "ss7_route_table.h"
#include "ss7_internal.h"
#include "xua_as_fsm.h"
#include "xua_asp_fsm.h"
diff --git a/src/osmo_ss7_hmrt.c b/src/osmo_ss7_hmrt.c
index 3ac43b8..57d7388 100644
--- a/src/osmo_ss7_hmrt.c
+++ b/src/osmo_ss7_hmrt.c
@@ -35,6 +35,7 @@
#include <osmocom/sigtran/protocol/m3ua.h>
#include "xua_internal.h"
+#include "ss7_route_table.h"
#include "ss7_internal.h"
/* convert from M3UA message to MTP-TRANSFER.ind osmo_mtp_prim */
diff --git a/src/osmo_ss7_route_table.c b/src/osmo_ss7_route_table.c
new file mode 100644
index 0000000..2939bf4
--- /dev/null
+++ b/src/osmo_ss7_route_table.c
@@ -0,0 +1,112 @@
+/* (C) 2015-2017 by Harald Welte <laforge@gnumonks.org>
+ * (C) 2023-2024 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
+ * All Rights Reserved
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/logging.h>
+#include <osmocom/sigtran/mtp_sap.h>
+#include <osmocom/sigtran/osmo_ss7.h>
+
+#include "ss7_route_table.h"
+#include "ss7_internal.h"
+
+/***********************************************************************
+ * SS7 Route Tables
+ ***********************************************************************/
+
+struct osmo_ss7_route_table *
+ss7_route_table_find(struct osmo_ss7_instance *inst, const char *name)
+{
+ struct osmo_ss7_route_table *rtbl;
+ OSMO_ASSERT(ss7_initialized);
+ llist_for_each_entry(rtbl, &inst->rtable_list, list) {
+ if (!strcmp(rtbl->cfg.name, name))
+ return rtbl;
+ }
+ return NULL;
+}
+
+struct osmo_ss7_route_table *
+ss7_route_table_find_or_create(struct osmo_ss7_instance *inst, const char *name)
+{
+ struct osmo_ss7_route_table *rtbl;
+
+ OSMO_ASSERT(ss7_initialized);
+ rtbl = ss7_route_table_find(inst, name);
+ if (!rtbl) {
+ LOGSS7(inst, LOGL_INFO, "Creating Route Table %s\n", name);
+ rtbl = talloc_zero(inst, struct osmo_ss7_route_table);
+ rtbl->inst = inst;
+ rtbl->cfg.name = talloc_strdup(rtbl, name);
+ INIT_LLIST_HEAD(&rtbl->routes);
+ llist_add_tail(&rtbl->list, &inst->rtable_list);
+ }
+ return rtbl;
+}
+
+void
+ss7_route_table_destroy(struct osmo_ss7_route_table *rtbl)
+{
+ llist_del(&rtbl->list);
+ /* routes are allocated as children of route table, will be
+ * automatically freed() */
+ talloc_free(rtbl);
+}
+
+/*! \brief Find a SS7 route for given destination point code in given table */
+struct osmo_ss7_route *
+ss7_route_table_find_route_by_dpc(struct osmo_ss7_route_table *rtbl, uint32_t dpc)
+{
+ struct osmo_ss7_route *rt;
+
+ OSMO_ASSERT(ss7_initialized);
+
+ dpc = osmo_ss7_pc_normalize(&rtbl->inst->cfg.pc_fmt, dpc);
+
+ /* we assume the routes are sorted by mask length, i.e. more
+ * specific routes first, and less specific routes with shorter
+ * mask later */
+ llist_for_each_entry(rt, &rtbl->routes, list) {
+ if ((dpc & rt->cfg.mask) == rt->cfg.pc)
+ return rt;
+ }
+ return NULL;
+}
+
+/*! \brief Find a SS7 route for given destination point code + mask in given table */
+struct osmo_ss7_route *
+ss7_route_table_find_route_by_dpc_mask(struct osmo_ss7_route_table *rtbl, uint32_t dpc,
+ uint32_t mask)
+{
+ struct osmo_ss7_route *rt;
+
+ OSMO_ASSERT(ss7_initialized);
+ mask = osmo_ss7_pc_normalize(&rtbl->inst->cfg.pc_fmt, mask);
+ dpc = osmo_ss7_pc_normalize(&rtbl->inst->cfg.pc_fmt, dpc);
+
+ /* we assume the routes are sorted by mask length, i.e. more
+ * specific routes first, and less specific routes with shorter
+ * mask later */
+ llist_for_each_entry(rt, &rtbl->routes, list) {
+ if (dpc == rt->cfg.pc && mask == rt->cfg.mask)
+ return rt;
+ }
+ return NULL;
+}
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index e3142c7..aa8c9bc 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -46,6 +46,7 @@
#include "xua_internal.h"
#include <osmocom/sigtran/sccp_sap.h>
#include "sccp_internal.h"
+#include "ss7_route_table.h"
#include "ss7_internal.h"
#include <netinet/tcp.h>
@@ -470,7 +471,7 @@
return CMD_WARNING;
}
- rt = osmo_ss7_route_find_dpc_mask(rtable, dpc, mask);
+ rt = ss7_route_table_find_route_by_dpc_mask(rtable, dpc, mask);
if (!rt) {
vty_out(vty, "cannot find route to be deleted%s", VTY_NEWLINE);
return CMD_WARNING;
@@ -2022,7 +2023,7 @@
* (users may change the routing key via VTY during runtime) and then
* putting a new route (see below). */
if (cs7_role == CS7_ROLE_ASP) {
- rt = osmo_ss7_route_find_dpc_mask(as->inst->rtable_system, rkey->pc, 0xffffff);
+ rt = ss7_route_table_find_route_by_dpc_mask(as->inst->rtable_system, rkey->pc, 0xffffff);
if (rt)
osmo_ss7_route_destroy(rt);
}
diff --git a/src/sccp_user.c b/src/sccp_user.c
index 1dd3b30..277ca5f 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -39,6 +39,7 @@
#include "sccp_internal.h"
#include "xua_internal.h"
+#include "ss7_route_table.h"
#include "ss7_internal.h"
/*! \brief Find a SCCP User registered for given PC+SSN or SSN only
@@ -585,7 +586,7 @@
as->cfg.name);
/* Create a default route if necessary */
- rt = osmo_ss7_route_find_dpc_mask(ss7->rtable_system, 0, 0);
+ rt = ss7_route_table_find_route_by_dpc_mask(ss7->rtable_system, 0, 0);
if (!rt) {
LOGP(DLSCCP, LOGL_NOTICE, "%s: Creating default route\n", name);
rt = osmo_ss7_route_create(ss7->rtable_system, 0, 0,
diff --git a/src/ss7_route_table.h b/src/ss7_route_table.h
new file mode 100644
index 0000000..5c70c4c
--- /dev/null
+++ b/src/ss7_route_table.h
@@ -0,0 +1,36 @@
+#pragma once
+
+#include <stdint.h>
+#include <osmocom/core/linuxlist.h>
+
+/***********************************************************************
+ * SS7 Routing Tables
+ ***********************************************************************/
+
+struct osmo_ss7_instance;
+
+struct osmo_ss7_route_table {
+ /*! member in list of routing tables */
+ struct llist_head list;
+ /*! \ref osmo_ss7_instance to which we belong */
+ struct osmo_ss7_instance *inst;
+ /*! list of \ref osmo_ss7_route */
+ struct llist_head routes;
+
+ struct {
+ char *name;
+ char *description;
+ } cfg;
+};
+
+struct osmo_ss7_route_table *
+ss7_route_table_find(struct osmo_ss7_instance *inst, const char *name);
+struct osmo_ss7_route_table *
+ss7_route_table_find_or_create(struct osmo_ss7_instance *inst, const char *name);
+void ss7_route_table_destroy(struct osmo_ss7_route_table *rtbl);
+
+struct osmo_ss7_route *
+ss7_route_table_find_route_by_dpc(struct osmo_ss7_route_table *rtbl, uint32_t dpc);
+struct osmo_ss7_route *
+ss7_route_table_find_route_by_dpc_mask(struct osmo_ss7_route_table *rtbl, uint32_t dpc,
+ uint32_t mask);
diff --git a/src/xua_as_fsm.c b/src/xua_as_fsm.c
index 65f723c..2083ca0 100644
--- a/src/xua_as_fsm.c
+++ b/src/xua_as_fsm.c
@@ -23,6 +23,7 @@
#include <osmocom/sigtran/protocol/sua.h>
#include <osmocom/sigtran/protocol/m3ua.h>
+#include "ss7_route_table.h"
#include "xua_asp_fsm.h"
#include "xua_as_fsm.h"
#include "xua_internal.h"
@@ -230,7 +231,7 @@
struct osmo_ss7_as *as = xafp->as;
struct osmo_ss7_instance *inst = as->inst;
- if (osmo_ss7_route_find_dpc_mask(inst->rtable_system, as->cfg.routing_key.pc, 0xffffff))
+ if (ss7_route_table_find_route_by_dpc_mask(inst->rtable_system, as->cfg.routing_key.pc, 0xffffff))
return;
/* As opposed to M3UA, there is no RKM and we have to implicitly
@@ -251,7 +252,7 @@
return;
/* find the route which we have created if we ever reached ipa_asp_fsm_wait_id_ack2 */
- rt = osmo_ss7_route_find_dpc_mask(inst->rtable_system, as->cfg.routing_key.pc, 0xffffff);
+ rt = ss7_route_table_find_route_by_dpc_mask(inst->rtable_system, as->cfg.routing_key.pc, 0xffffff);
/* no route found, bail out */
if (!rt) {
LOGPFSML(fi, LOGL_NOTICE, "Attempting to delete route for this IPA AS, but cannot "
diff --git a/src/xua_rkm.c b/src/xua_rkm.c
index 007f4f7..774cf3a 100644
--- a/src/xua_rkm.c
+++ b/src/xua_rkm.c
@@ -28,6 +28,7 @@
#include <osmocom/sigtran/osmo_ss7.h>
#include <osmocom/sigtran/protocol/m3ua.h>
+#include "ss7_route_table.h"
#include "xua_internal.h"
#include "xua_as_fsm.h"
#include "xua_asp_fsm.h"
@@ -372,7 +373,7 @@
return -1;
}
- rt = osmo_ss7_route_find_dpc(inst->rtable_system, as->cfg.routing_key.pc);
+ rt = ss7_route_table_find_route_by_dpc(inst->rtable_system, as->cfg.routing_key.pc);
if (!rt) {
msgb_append_dereg_res(resp, M3UA_RKM_DEREG_ERR_UNKNOWN, 0);
return -1;
diff --git a/tests/ss7/ss7_test.c b/tests/ss7/ss7_test.c
index ad8dc77..5f00f78 100644
--- a/tests/ss7/ss7_test.c
+++ b/tests/ss7/ss7_test.c
@@ -1,3 +1,4 @@
+#include "../src/ss7_route_table.h"
#include "../src/xua_internal.h"
#include "../src/xua_asp_fsm.h"
@@ -143,15 +144,15 @@
printf("Testing SS7 routing\n");
/* creation / destruction */
- OSMO_ASSERT(osmo_ss7_route_table_find(s7i, "foobar") == NULL);
- rtbl = osmo_ss7_route_table_find_or_create(s7i, "foobar");
+ OSMO_ASSERT(ss7_route_table_find(s7i, "foobar") == NULL);
+ rtbl = ss7_route_table_find_or_create(s7i, "foobar");
OSMO_ASSERT(rtbl);
- OSMO_ASSERT(osmo_ss7_route_table_find_or_create(s7i, "foobar") == rtbl);
- osmo_ss7_route_table_destroy(rtbl);
- OSMO_ASSERT(osmo_ss7_route_table_find(s7i, "foobar") == NULL);
+ OSMO_ASSERT(ss7_route_table_find_or_create(s7i, "foobar") == rtbl);
+ ss7_route_table_destroy(rtbl);
+ OSMO_ASSERT(ss7_route_table_find(s7i, "foobar") == NULL);
/* we now work with system route table */
- rtbl = osmo_ss7_route_table_find(s7i, "system");
+ rtbl = ss7_route_table_find(s7i, "system");
OSMO_ASSERT(rtbl && rtbl == s7i->rtable_system);
lset_a = osmo_ss7_linkset_find_or_create(s7i, "a", 100);
@@ -160,32 +161,32 @@
OSMO_ASSERT(lset_b);
/* route with full mask */
- OSMO_ASSERT(osmo_ss7_route_find_dpc(rtbl, 12) == NULL);
+ OSMO_ASSERT(ss7_route_table_find_route_by_dpc(rtbl, 12) == NULL);
rt = osmo_ss7_route_create(rtbl, 12, 0xffff, "a");
printf("route with full mask: %s\n", osmo_ss7_route_print(rt));
OSMO_ASSERT(rt);
- OSMO_ASSERT(osmo_ss7_route_find_dpc(rtbl, 12) == rt);
+ OSMO_ASSERT(ss7_route_table_find_route_by_dpc(rtbl, 12) == rt);
osmo_ss7_route_destroy(rt);
/* route with partial mask */
rt = osmo_ss7_route_create(rtbl, 8, 0xfff8, "a");
printf("route with partial mask: %s\n", osmo_ss7_route_print(rt));
- OSMO_ASSERT(osmo_ss7_route_find_dpc(rtbl, 8) == rt);
- OSMO_ASSERT(osmo_ss7_route_find_dpc(rtbl, 9) == rt);
- OSMO_ASSERT(osmo_ss7_route_find_dpc(rtbl, 12) == rt);
- OSMO_ASSERT(osmo_ss7_route_find_dpc(rtbl, 15) == rt);
- OSMO_ASSERT(osmo_ss7_route_find_dpc(rtbl, 16) == NULL);
+ OSMO_ASSERT(ss7_route_table_find_route_by_dpc(rtbl, 8) == rt);
+ OSMO_ASSERT(ss7_route_table_find_route_by_dpc(rtbl, 9) == rt);
+ OSMO_ASSERT(ss7_route_table_find_route_by_dpc(rtbl, 12) == rt);
+ OSMO_ASSERT(ss7_route_table_find_route_by_dpc(rtbl, 15) == rt);
+ OSMO_ASSERT(ss7_route_table_find_route_by_dpc(rtbl, 16) == NULL);
/* insert more specific route for 12, must have higher priority
* than existing one */
rt12 = osmo_ss7_route_create(rtbl, 12, 0xffff, "b");
- OSMO_ASSERT(osmo_ss7_route_find_dpc(rtbl, 12) == rt12);
- OSMO_ASSERT(osmo_ss7_route_find_dpc(rtbl, 15) == rt);
- OSMO_ASSERT(osmo_ss7_route_find_dpc(rtbl, 16) == NULL);
+ OSMO_ASSERT(ss7_route_table_find_route_by_dpc(rtbl, 12) == rt12);
+ OSMO_ASSERT(ss7_route_table_find_route_by_dpc(rtbl, 15) == rt);
+ OSMO_ASSERT(ss7_route_table_find_route_by_dpc(rtbl, 16) == NULL);
/* add a default route, which should have lowest precedence */
rtdef = osmo_ss7_route_create(rtbl, 0, 0, "a");
- OSMO_ASSERT(osmo_ss7_route_find_dpc(rtbl, 12) == rt12);
- OSMO_ASSERT(osmo_ss7_route_find_dpc(rtbl, 15) == rt);
- OSMO_ASSERT(osmo_ss7_route_find_dpc(rtbl, 16) == rtdef);
+ OSMO_ASSERT(ss7_route_table_find_route_by_dpc(rtbl, 12) == rt12);
+ OSMO_ASSERT(ss7_route_table_find_route_by_dpc(rtbl, 15) == rt);
+ OSMO_ASSERT(ss7_route_table_find_route_by_dpc(rtbl, 16) == rtdef);
osmo_ss7_route_destroy(rtdef);
osmo_ss7_route_destroy(rt12);
To view, visit change 38626. To unsubscribe, or for help writing mail filters, visit settings.