pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42572?usp=email )
Change subject: cosmetic: xua_asp_fsm: Fix wrong indentation
......................................................................
cosmetic: xua_asp_fsm: Fix wrong indentation
Change-Id: I21c13ff7bc67c060e739eae38088ac00700680de
---
M src/xua_asp_fsm.c
1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/72/42572/1
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index bb163a0..39d121f 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -918,12 +918,12 @@
}
if (asp->cfg.role == OSMO_SS7_ASP_ROLE_SG) {
/* RFC4666 4.3.4.4: Transmit unsolicited ASPIA ACK no tnotify peer.
- * "If the ASP receives an ASP Inactive Ack without having sent an
- * ASP Inactive message, the ASP should now consider itself to be
- * in the ASP-INACTIVE state. If the ASP was previously in the
- * ASP-ACTIVE state, the ASP should then initiate procedures to
- * return itself to its previous state."
- */
+ * "If the ASP receives an ASP Inactive Ack without having sent an
+ * ASP Inactive message, the ASP should now consider itself to be
+ * in the ASP-INACTIVE state. If the ASP was previously in the
+ * ASP-ACTIVE state, the ASP should then initiate procedures to
+ * return itself to its previous state."
+ */
xua_asp_tx_unsolicited_aspia_ack(asp);
/* transition state and inform layer manager */
osmo_fsm_inst_state_chg(fi, XUA_ASP_S_INACTIVE, 0, 0);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42572?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I21c13ff7bc67c060e739eae38088ac00700680de
Gerrit-Change-Number: 42572
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42573?usp=email )
Change subject: Support administrative block in role ASP
......................................................................
Support administrative block in role ASP
Change-Id: If32902575e874d2acc9a5fc12509af42ed151739
---
M src/ss7_asp_vty.c
M src/xua_default_lm_fsm.c
2 files changed, 17 insertions(+), 15 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/73/42573/1
diff --git a/src/ss7_asp_vty.c b/src/ss7_asp_vty.c
index e3c82fe..89fb949 100644
--- a/src/ss7_asp_vty.c
+++ b/src/ss7_asp_vty.c
@@ -714,11 +714,6 @@
return CMD_WARNING;
}
- if (asp->cfg.role == OSMO_SS7_ASP_ROLE_ASP) {
- vty_out(vty, "%% 'block' not yet implemented in 'role asp'%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
-
ss7_asp_set_blocked(asp, true);
return CMD_SUCCESS;
}
diff --git a/src/xua_default_lm_fsm.c b/src/xua_default_lm_fsm.c
index f9f5cd4..773d6f2 100644
--- a/src/xua_default_lm_fsm.c
+++ b/src/xua_default_lm_fsm.c
@@ -199,6 +199,10 @@
static bool asp_act_needed(const struct osmo_ss7_asp *asp)
{
+ /* Avoid activating if ASP is adminsitratively blocked locally: */
+ if (asp->cfg.adm_state.blocked)
+ return false;
+
/* Don't change active ASP if there's already one active in the AS. */
if (ss7_asp_determine_traf_mode(asp) == OSMO_SS7_AS_TMOD_OVERRIDE) {
struct ss7_as_asp_assoc *assoc;
@@ -210,6 +214,13 @@
return true;
}
+static void submit_m_asp_active_req_if_needed(struct osmo_ss7_asp *asp)
+{
+ if (!asp_act_needed(asp))
+ return;
+ xlm_sap_down_simple(asp, OSMO_XLM_PRIM_M_ASP_ACTIVE, PRIM_OP_REQUEST);
+}
+
static void lm_idle(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
switch (event) {
@@ -342,10 +353,8 @@
struct xua_layer_manager_default_priv *lmp = fi->priv;
if (lmp->asp->cfg.role == OSMO_SS7_ASP_ROLE_ASP ||
- lmp->asp->cfg.role == OSMO_SS7_ASP_ROLE_IPSP) {
- if (asp_act_needed(lmp->asp))
- xlm_sap_down_simple(lmp->asp, OSMO_XLM_PRIM_M_ASP_ACTIVE, PRIM_OP_REQUEST);
- }
+ lmp->asp->cfg.role == OSMO_SS7_ASP_ROLE_IPSP)
+ submit_m_asp_active_req_if_needed(lmp->asp);
}
static void lm_inactive(struct osmo_fsm_inst *fi, uint32_t event, void *data)
@@ -366,16 +375,14 @@
break;
case LM_E_AS_INACTIVE_IND:
/* request the ASP to go into active state if needed */
- if (asp_act_needed(lmp->asp))
- xlm_sap_down_simple(lmp->asp, OSMO_XLM_PRIM_M_ASP_ACTIVE, PRIM_OP_REQUEST);
+ submit_m_asp_active_req_if_needed(lmp->asp);
break;
case LM_E_NOTIFY_IND:
ENSURE_ASP_OR_IPSP(fi, event);
OSMO_ASSERT(oxp->oph.primitive == OSMO_XLM_PRIM_M_NOTIFY);
OSMO_ASSERT(oxp->oph.operation == PRIM_OP_INDICATION);
/* request the ASP to go into active state if needed */
- if (asp_act_needed(lmp->asp))
- xlm_sap_down_simple(lmp->asp, OSMO_XLM_PRIM_M_ASP_ACTIVE, PRIM_OP_REQUEST);
+ submit_m_asp_active_req_if_needed(lmp->asp);
break;
case LM_E_ERROR_IND:
ENSURE_ASP_OR_IPSP(fi, event);
@@ -409,7 +416,7 @@
* peer's ASP became administratively blocked.
* Try to re-activate, if peer's ASP is indeed blocked we'll probably receive an
* ERR msg and continue from there in the case LM_E_ERROR_IND below. */
- xlm_sap_down_simple(lmp->asp, OSMO_XLM_PRIM_M_ASP_ACTIVE, PRIM_OP_REQUEST);
+ submit_m_asp_active_req_if_needed(lmp->asp);
break;
case LM_E_ASP_INACT_IND:
ENSURE_SG_OR_IPSP(fi, event);
@@ -417,7 +424,7 @@
break;
case LM_E_AS_INACTIVE_IND:
/* request the ASP to go into active state */
- xlm_sap_down_simple(lmp->asp, OSMO_XLM_PRIM_M_ASP_ACTIVE, PRIM_OP_REQUEST);
+ submit_m_asp_active_req_if_needed(lmp->asp);
break;
case LM_E_NOTIFY_IND:
ENSURE_ASP_OR_IPSP(fi, event);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42573?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: If32902575e874d2acc9a5fc12509af42ed151739
Gerrit-Change-Number: 42573
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42567?usp=email )
Change subject: xua_rkm: send_reg_req: Avoid adding Routing Context with value 0
......................................................................
xua_rkm: send_reg_req: Avoid adding Routing Context with value 0
We use routing context 0 internally as "no routing context". Since the
Routing Context in the Routing KEy IE in RKM REG REQ is optional, if
local rctx is 0 (because we expect to get one allocated by the STP and
receive it through RKM REG RESP), avoid sending it with the value 0.
Change-Id: Iaa584fea3020af06951aea16e638ac6e6a84ae21
---
M src/xua_rkm.c
1 file changed, 7 insertions(+), 2 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
diff --git a/src/xua_rkm.c b/src/xua_rkm.c
index 2e7c227..16b494b 100644
--- a/src/xua_rkm.c
+++ b/src/xua_rkm.c
@@ -120,13 +120,18 @@
{
struct msgb *msg = m3ua_msgb_alloc(__func__);
int tmod = osmo_ss7_tmode_to_xua(traf_mode);
+ uint16_t outter_len;
/* One individual Registration Request according to Chapter 3.6.1 */
msgb_put_u16(msg, M3UA_IEI_ROUT_KEY); /* outer IEI */
- msgb_put_u16(msg, 32 + 4); /* outer length */
+ outter_len = 24 + 4;
+ if (rkey->context > 0)
+ outter_len += 8;
+ msgb_put_u16(msg, outter_len); /* outer length */
/* nested IEIs */
msgb_t16l16vp_put_u32(msg, M3UA_IEI_LOC_RKEY_ID, rkey->l_rk_id);
- msgb_t16l16vp_put_u32(msg, M3UA_IEI_ROUTE_CTX, rkey->context);
+ if (rkey->context > 0)
+ msgb_t16l16vp_put_u32(msg, M3UA_IEI_ROUTE_CTX, rkey->context);
msgb_t16l16vp_put_u32(msg, M3UA_IEI_TRAF_MODE_TYP, tmod);
msgb_t16l16vp_put_u32(msg, M3UA_IEI_DEST_PC, rkey->pc);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42567?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Iaa584fea3020af06951aea16e638ac6e6a84ae21
Gerrit-Change-Number: 42567
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/42570?usp=email )
(
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: Use osmo_ss7_asp_active() in several places
......................................................................
Use osmo_ss7_asp_active() in several places
Change-Id: I172e691cb61ac68e2410b44e124737f7a4dd2775
---
M src/m3ua.c
M src/sua.c
M src/xua_as_fsm.c
M src/xua_rkm.c
4 files changed, 4 insertions(+), 4 deletions(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
fixeria: Looks good to me, approved
diff --git a/src/m3ua.c b/src/m3ua.c
index a22a64a..243f5b9 100644
--- a/src/m3ua.c
+++ b/src/m3ua.c
@@ -1166,7 +1166,7 @@
int rc;
/* SNM only permitted in ACTIVE state */
- if (asp->fi->state != XUA_ASP_S_ACTIVE) {
+ if (!osmo_ss7_asp_active(asp)) {
if (asp->fi->state == XUA_ASP_S_INACTIVE &&
asp->cfg.quirks & OSMO_SS7_ASP_QUIRK_SNM_INACTIVE) {
LOGPASP(asp, DLM3UA, LOGL_NOTICE, "quirk snm_inactive active: "
diff --git a/src/sua.c b/src/sua.c
index 9ebe4c6..b169d50 100644
--- a/src/sua.c
+++ b/src/sua.c
@@ -1113,7 +1113,7 @@
static int sua_rx_snm(struct osmo_ss7_asp *asp, struct xua_msg *xua)
{
/* SNM only permitted in ACTIVE state */
- if (asp->fi->state != XUA_ASP_S_ACTIVE) {
+ if (!osmo_ss7_asp_active(asp)) {
if (asp->fi->state == XUA_ASP_S_INACTIVE && asp->cfg.quirks & OSMO_SS7_ASP_QUIRK_SNM_INACTIVE) {
LOGPASP(asp, DLSUA, LOGL_NOTICE, "quirk snm_inactive active: "
"Accepting SSNM in state %s\n", osmo_fsm_inst_state_name(asp->fi));
diff --git a/src/xua_as_fsm.c b/src/xua_as_fsm.c
index 568834e..0ba1b2a 100644
--- a/src/xua_as_fsm.c
+++ b/src/xua_as_fsm.c
@@ -296,7 +296,7 @@
if (asp_cmp == asp)
continue;
- if (asp->fi && asp->fi->state == XUA_ASP_S_ACTIVE)
+ if (osmo_ss7_asp_active(asp))
return true;
}
diff --git a/src/xua_rkm.c b/src/xua_rkm.c
index 16b494b..92fbdac 100644
--- a/src/xua_rkm.c
+++ b/src/xua_rkm.c
@@ -420,7 +420,7 @@
}
/* Reject if ASP is still active */
- if (asp->fi->state == XUA_ASP_S_ACTIVE) {
+ if (osmo_ss7_asp_active(asp)) {
msgb_append_dereg_res(resp, M3UA_RKM_DEREG_ERR_ASP_ACTIVE, 0);
return -1;
}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42570?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I172e691cb61ac68e2410b44e124737f7a4dd2775
Gerrit-Change-Number: 42570
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>