diff options
author | Harald Welte <laforge@osmocom.org> | 2021-02-07 18:05:38 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2021-02-10 19:58:00 +0100 |
commit | 7daae9bd67215888c7d5e201ea2261fb6c8fbb2b (patch) | |
tree | 6c548436362a4c8360453b6be65b69f121b9f0f5 /src/sccp_scmg.c | |
parent | 0d53666108318435391de2696ba88d277e2b4211 (diff) |
sccp: more SCMG handling: SSA and SSP message handling
When a SSP (Subsystem Prohibited) or SSA (Subsystem Available) SCMG
message is received, we must generate the respective primitives towards
the SCCP user.
Change-Id: I149166a25113f5d3e3536f9297bf89ff3139b9e3
Diffstat (limited to 'src/sccp_scmg.c')
-rw-r--r-- | src/sccp_scmg.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/src/sccp_scmg.c b/src/sccp_scmg.c index ed16fe7..49e09ca 100644 --- a/src/sccp_scmg.c +++ b/src/sccp_scmg.c @@ -167,6 +167,33 @@ static int sccp_scmg_tx(struct osmo_sccp_user *scu, const struct osmo_sccp_addr } +/* Subsystem Allowed received */ +static int scmg_rx_ssa(struct osmo_sccp_user *scu, const struct osmo_sccp_addr *calling_addr, + const struct osmo_sccp_addr *called_addr, const struct sccp_scmg_msg *ssa) +{ + /* Q.714 5.3.3 */ + if (ssa->affected_ssn == SCCP_SSN_MANAGEMENT) + return 0; + + /* if the SSN is not marked as prohibited, ignore */ + + /* Q.714 5.3.2.2 a) */ + sccp_scmg_rx_ssn_allowed(scu->inst, ssa->affected_pc, ssa->affected_ssn, ssa->smi); + + /* If the remote SCCP, at which the subsystem reported in the SSA message resides, is marked + * inaccessible, then the message is treated as an implicit indication of SCCP restart */ + return 0; +} + +/* Subsystem Prohibited received */ +static int scmg_rx_ssp(struct osmo_sccp_user *scu, const struct osmo_sccp_addr *calling_addr, + const struct osmo_sccp_addr *called_addr, const struct sccp_scmg_msg *ssp) +{ + /* Q.714 5.3.2.2 a) */ + sccp_scmg_rx_ssn_prohibited(scu->inst, ssp->affected_pc, ssp->affected_ssn, ssp->smi); + return 0; +} + /* Subsystem Test received */ static int scmg_rx_sst(struct osmo_sccp_user *scu, const struct osmo_sccp_addr *calling_addr, const struct osmo_sccp_addr *called_addr, const struct sccp_scmg_msg *sst) @@ -191,10 +218,12 @@ static int scmg_rx(struct osmo_sccp_user *scu, const struct osmo_sccp_addr *call const struct osmo_sccp_addr *called_addr, const struct sccp_scmg_msg *scmg) { switch (scmg->msg_type) { + case SCCP_SCMG_MSGT_SSA: + return scmg_rx_ssa(scu, calling_addr, called_addr, scmg); + case SCCP_SCMG_MSGT_SSP: + return scmg_rx_ssp(scu, calling_addr, called_addr, scmg); case SCCP_SCMG_MSGT_SST: return scmg_rx_sst(scu, calling_addr, called_addr, scmg); - case SCCP_SCMG_MSGT_SSP: - case SCCP_SCMG_MSGT_SSA: case SCCP_SCMG_MSGT_SOR: case SCCP_SCMG_MSGT_SOG: case SCCP_SCMG_MSGT_SSC: |