From ed15c74a01a044afc087a02f0e947ae49533762a Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 7 Apr 2017 17:14:54 +0200 Subject: Add a default layer manager using RKM to register PC with SG This "default layer manager" can optionally be used by a xUA ASP. It will handle the xUA Layer Manager (xlm) primitives and use them to behave as follows: * bring the ASP into state "INACTIVE" * see if the SG can match our connection (based on IP address + port information) to a statically configured ASP configuration with associated AS(s). If yes, it will send us a NOTIFY message with AS-INACTIVE. * if the above doesn't work, try to dynamically register a routing key using RKM for the point code that was locally confiured on the ASP/client. If that works, the SG will now have created ASP and AS objects as well as a routing key and be able to serve us, sending the NOTIFY with the AS-INACTIVE state. * After either of the two above, we will attempt to transition into ASP-ACTIVE. The SG should send us an AS-ACTIVE notification in return * if anything fails, abort and disconnect the SCTP connection, restart related FSMs and start from scratch Change-Id: I78d4623dd213b5c59007a026a6cc3cfe5c04af50 --- include/osmocom/sigtran/osmo_ss7.h | 4 +++- include/osmocom/sigtran/sigtran_sap.h | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index dff206d..c3a81bb 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -345,7 +345,8 @@ struct osmo_ss7_asp { bool asp_id_present; /* Layer Manager to which we talk */ - struct osmo_xua_layer_manager *lm; + const struct osmo_xua_layer_manager *lm; + void *lm_priv; /*! Were we dynamically allocated */ bool dyn_allocated; @@ -372,6 +373,7 @@ osmo_ss7_asp_find_or_create(struct osmo_ss7_instance *inst, const char *name, void osmo_ss7_asp_destroy(struct osmo_ss7_asp *asp); int osmo_ss7_asp_send(struct osmo_ss7_asp *asp, struct msgb *msg); int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp); +int osmo_ss7_asp_use_default_lm(struct osmo_ss7_asp *asp, int log_level); #define LOGPASP(asp, subsys, level, fmt, args ...) \ LOGP(subsys, level, "asp-%s: " fmt, (asp)->cfg.name, ## args) diff --git a/include/osmocom/sigtran/sigtran_sap.h b/include/osmocom/sigtran/sigtran_sap.h index 80cfefc..87504c8 100644 --- a/include/osmocom/sigtran/sigtran_sap.h +++ b/include/osmocom/sigtran/sigtran_sap.h @@ -51,10 +51,16 @@ struct osmo_xlm_prim_rk_reg { /* routing key */ struct osmo_ss7_routing_key key; enum osmo_ss7_as_traffic_mode traf_mode; + + /* Status: Confirm only */ + uint32_t status; }; struct osmo_xlm_prim_rk_dereg { uint32_t route_ctx; + + /* Status: Confirm only */ + uint32_t status; }; struct osmo_xlm_prim { @@ -62,9 +68,14 @@ struct osmo_xlm_prim { union { struct osmo_xlm_prim_notify notify; struct osmo_xlm_prim_error error; + struct osmo_xlm_prim_rk_reg rk_reg; + struct osmo_xlm_prim_rk_dereg rk_dereg; } u; }; #define msgb_xlm_prim(msg) ((struct osmo_xlm_prim *)(msg)->l1h) char *osmo_xlm_prim_name(struct osmo_prim_hdr *oph); + +/* XUA LM-SAP towards stack */ +int osmo_xlm_sap_down(struct osmo_ss7_asp *asp, struct osmo_prim_hdr *oph); -- cgit v1.2.3