neels has uploaded this change for review.
cnpool prep: add SCCP_EV_USER_ABORT
To ease patch review, I decided to submit this separately from the
caller, which follows in subsequent patch
I5479eded786ec26062d49403a8be12967f113cdb
The new event will be dispatched when there are SCCP config changes
pending, and the human user types 'apply sccp' on the telnet VTY. The
aim is to disconnect all connections so we can create a new SCCP User.
Related: SYS#6412
Change-Id: Idff8e09b5328c904b175e4d4df7d4044a34f4a20
---
M include/osmocom/hnbgw/context_map.h
M src/osmo-hnbgw/context_map_sccp.c
2 files changed, 38 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/28/33128/1
diff --git a/include/osmocom/hnbgw/context_map.h b/include/osmocom/hnbgw/context_map.h
index 55d96ea..bcc3238 100644
--- a/include/osmocom/hnbgw/context_map.h
+++ b/include/osmocom/hnbgw/context_map.h
@@ -55,6 +55,9 @@
MAP_SCCP_EV_RAN_LINK_LOST,
/* Receiving an SCCP RLSD from CN, or libosmo-sigtran tells us about SCCP connection timeout. All done. */
MAP_SCCP_EV_RX_RELEASED,
+ /* The human admin asks to drop the current SCCP connection, by telnet VTY 'apply sccp' in presence of SCCP
+ * config changes. */
+ MAP_SCCP_EV_USER_ABORT,
};
/* For context_map_get_state(), to combine the RUA and SCCP states, for VTY reporting only. */
diff --git a/src/osmo-hnbgw/context_map_sccp.c b/src/osmo-hnbgw/context_map_sccp.c
index 00b24f2..cc65b6e 100644
--- a/src/osmo-hnbgw/context_map_sccp.c
+++ b/src/osmo-hnbgw/context_map_sccp.c
@@ -54,6 +54,7 @@
OSMO_VALUE_STRING(MAP_SCCP_EV_RAN_DISC),
OSMO_VALUE_STRING(MAP_SCCP_EV_RAN_LINK_LOST),
OSMO_VALUE_STRING(MAP_SCCP_EV_RX_RELEASED),
+ OSMO_VALUE_STRING(MAP_SCCP_EV_USER_ABORT),
{}
};
@@ -281,6 +282,7 @@
case MAP_SCCP_EV_RAN_LINK_LOST:
case MAP_SCCP_EV_RAN_DISC:
+ case MAP_SCCP_EV_USER_ABORT:
/* No CR has been sent yet, just go to disconnected state. */
if (msg_has_l2_data(ranap_msg))
LOG_MAP(map, DLSCCP, LOGL_ERROR, "SCCP not connected, cannot dispatch RANAP message\n");
@@ -317,6 +319,7 @@
case MAP_SCCP_EV_RAN_LINK_LOST:
case MAP_SCCP_EV_RAN_DISC:
+ case MAP_SCCP_EV_USER_ABORT:
/* RUA connection was terminated. First wait for the CC before releasing the SCCP conn. */
if (msg_has_l2_data(ranap_msg))
LOGPFSML(fi, LOGL_ERROR, "Connection not yet confirmed, cannot forward RANAP to CN\n");
@@ -373,6 +376,9 @@
case MAP_SCCP_EV_RAN_LINK_LOST:
/* RUA has disconnected ungracefully, so there is no Iu Release that told the CN to disconnect.
* Disconnect on the SCCP layer, ungracefully. */
+ case MAP_SCCP_EV_USER_ABORT:
+ /* The user is asking for disconnection, so there is no Iu Release in progress. Disconnect now. */
+
/* There won't be any ranap_msg, but if a caller wants to dispatch a msg, forward it before
* disconnecting. */
tx_sccp_df1(fi, ranap_msg);
@@ -440,6 +446,12 @@
handle_rx_sccp(fi, ranap_msg);
return;
+ case MAP_SCCP_EV_USER_ABORT:
+ /* Stop waiting for RLSD, send RLSD now. */
+ tx_sccp_rlsd(fi);
+ map_sccp_fsm_state_chg(MAP_SCCP_ST_DISCONNECTED);
+ return;
+
default:
OSMO_ASSERT(false);
}
@@ -511,6 +523,7 @@
| S(MAP_SCCP_EV_RAN_DISC)
| S(MAP_SCCP_EV_RAN_LINK_LOST)
| S(MAP_SCCP_EV_RX_RELEASED)
+ | S(MAP_SCCP_EV_USER_ABORT)
,
.out_state_mask = 0
| S(MAP_SCCP_ST_INIT)
@@ -527,6 +540,7 @@
| S(MAP_SCCP_EV_RAN_DISC)
| S(MAP_SCCP_EV_RAN_LINK_LOST)
| S(MAP_SCCP_EV_RX_RELEASED)
+ | S(MAP_SCCP_EV_USER_ABORT)
,
.out_state_mask = 0
| S(MAP_SCCP_ST_CONNECTED)
@@ -543,6 +557,7 @@
| S(MAP_SCCP_EV_RAN_LINK_LOST)
| S(MAP_SCCP_EV_RX_RELEASED)
| S(MAP_SCCP_EV_RX_CONNECTION_CONFIRM)
+ | S(MAP_SCCP_EV_USER_ABORT)
,
.out_state_mask = 0
| S(MAP_SCCP_ST_WAIT_RLSD)
@@ -560,6 +575,7 @@
| S(MAP_SCCP_EV_RAN_DISC)
| S(MAP_SCCP_EV_RAN_LINK_LOST)
| S(MAP_SCCP_EV_RX_CONNECTION_CONFIRM)
+ | S(MAP_SCCP_EV_USER_ABORT)
,
.out_state_mask = 0
| S(MAP_SCCP_ST_DISCONNECTED)
@@ -573,6 +589,7 @@
| S(MAP_SCCP_EV_TX_DATA_REQUEST)
| S(MAP_SCCP_EV_RAN_DISC)
| S(MAP_SCCP_EV_RAN_LINK_LOST)
+ | S(MAP_SCCP_EV_USER_ABORT)
,
.onenter = map_sccp_disconnected_onenter,
.action = map_sccp_disconnected_action,
To view, visit change 33128. To unsubscribe, or for help writing mail filters, visit settings.