From dae7491c14f5e7bdfecb25fba5c2624127daadc8 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Wed, 19 Jul 2017 18:41:09 +0200 Subject: sccp: make simple client configurable via VTY The osmo_sccp_simple_client_on_ss7_id and osmo_sccp_simple_client are not entirely configurable via VTY commands. The relation to the VTY is implicit. The user may set up instance objects via VTY (cs7/ss7, AS, ASP), which are then automatically created on startup. Each cs7 instance gets its own ID via the VTY configuration. When osmo_sccp_simple_client_on_ss7_id() is called with the cs7 instance id. (for osmo_sccp_simple_client() the ID will be hardcoded to 1), the function automatically checks if the CS7 instance is present, if not it will create one automatically using the caller supplied parameters as a defult. If a CS7 instance is present, the function checks for the presence of an AS and an ASP. These objects are present, they will be used. If not, new objects will be created. Both functions must not be called if an SCCP instance is already present. Since there can only be one SCCP instance per CS7 instance, this is an error condition. Add additional logic that checks to detect an already existing, valid configuration. If no or an insufficient configuration is detected, use the caller supplied parameters as default configuration. Change-Id: I293f3526ce6182dca74a169a23449dbc7af57c7c --- include/osmocom/sigtran/osmo_ss7.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 57a4e06..87ace4a 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -307,6 +307,8 @@ struct osmo_ss7_as * osmo_ss7_as_find_by_rctx(struct osmo_ss7_instance *inst, uint32_t rctx); struct osmo_ss7_as * osmo_ss7_as_find_by_l_rk_id(struct osmo_ss7_instance *inst, uint32_t l_rk_id); +struct osmo_ss7_as *osmo_ss7_as_find_by_proto(struct osmo_ss7_instance *inst, + enum osmo_ss7_asp_protocol proto); struct osmo_ss7_as * osmo_ss7_as_find_or_create(struct osmo_ss7_instance *inst, const char *name, enum osmo_ss7_asp_protocol proto); @@ -383,6 +385,9 @@ struct osmo_ss7_asp { struct osmo_ss7_asp * osmo_ss7_asp_find_by_name(struct osmo_ss7_instance *inst, const char *name); +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_or_create(struct osmo_ss7_instance *inst, const char *name, uint16_t remote_port, uint16_t local_port, -- cgit v1.2.3