aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmocom/sigtran/osmo_ss7.h4
-rw-r--r--src/osmo_ss7.c18
2 files changed, 22 insertions, 0 deletions
diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index 6778409..de9494b 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -436,6 +436,10 @@ struct osmo_ss7_asp
*osmo_ss7_asp_find_by_proto(struct osmo_ss7_as *as,
enum osmo_ss7_asp_protocol proto);
struct osmo_ss7_asp *
+osmo_ss7_asp_find(struct osmo_ss7_instance *inst, const char *name,
+ uint16_t remote_port, uint16_t local_port,
+ enum osmo_ss7_asp_protocol proto);
+struct osmo_ss7_asp *
osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name,
uint16_t remote_port, uint16_t local_port,
enum osmo_ss7_asp_protocol proto);
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index d74f8f9..a07fbed 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -1226,6 +1226,24 @@ struct osmo_ss7_asp
}
struct osmo_ss7_asp *
+osmo_ss7_asp_find(struct osmo_ss7_instance *inst, const char *name,
+ uint16_t remote_port, uint16_t local_port,
+ enum osmo_ss7_asp_protocol proto)
+{
+ struct osmo_ss7_asp *asp;
+
+ OSMO_ASSERT(ss7_initialized);
+ asp = osmo_ss7_asp_find_by_name(inst, name);
+ if (!asp)
+ return NULL;
+
+ if ((asp->cfg.remote.port != remote_port || asp->cfg.local.port != local_port || asp->cfg.proto != proto))
+ return NULL;
+
+ return asp;
+}
+
+struct osmo_ss7_asp *
osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name,
uint16_t remote_port, uint16_t local_port,
enum osmo_ss7_asp_protocol proto)