Change in libosmocore[master]: gprs_ns2_vc_fsm: rename ST_ALIVE -> ST_RECOVERING

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

lynxis lazus gerrit-no-reply at lists.osmocom.org
Wed Feb 3 10:21:12 UTC 2021


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/22643 )


Change subject: gprs_ns2_vc_fsm: rename ST_ALIVE -> ST_RECOVERING
......................................................................

gprs_ns2_vc_fsm: rename ST_ALIVE -> ST_RECOVERING

ST_ALIVE isn't quite clear. This state means this NS-VC is still dead.
ST_ALIVE is used for NS-VC with vc_mode ALIVE (e.g. UDP NS-VC). It's
the first state when the remote hasn't yet answered or when
the NS-VC lost ALIVEs.

Related: OS#4958
Change-Id: I0b29e8ce6444546d90bde68b1f957f1013238784
---
M src/gb/gprs_ns2_vc_fsm.c
1 file changed, 15 insertions(+), 15 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/43/22643/1

diff --git a/src/gb/gprs_ns2_vc_fsm.c b/src/gb/gprs_ns2_vc_fsm.c
index 6314408..f8d5afa 100644
--- a/src/gb/gprs_ns2_vc_fsm.c
+++ b/src/gb/gprs_ns2_vc_fsm.c
@@ -97,7 +97,7 @@
 	GPRS_NS2_ST_BLOCKED,
 	GPRS_NS2_ST_UNBLOCKED, /* allows sending NS_UNITDATA */
 
-	GPRS_NS2_ST_ALIVE, /* only used when not using RESET/BLOCK procedure */
+	GPRS_NS2_ST_RECOVERING, /* only used when not using RESET/BLOCK procedure */
 };
 
 enum gprs_ns2_vc_event {
@@ -217,7 +217,7 @@
 			if (priv->nsvc->mode == GPRS_NS2_VC_MODE_BLOCKRESET) {
 				osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RESET, nsi->timeout[NS_TOUT_TNS_RESET], 0);
 			} else {
-				osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_ALIVE, nsi->timeout[NS_TOUT_TNS_ALIVE], 0);
+				osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RECOVERING, nsi->timeout[NS_TOUT_TNS_ALIVE], 0);
 			}
 		}
 		break;
@@ -244,7 +244,7 @@
 	case GPRS_NS2_EV_REQ_START:
 		switch (priv->nsvc->mode) {
 		case GPRS_NS2_VC_MODE_ALIVE:
-			osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_ALIVE, nsi->timeout[NS_TOUT_TNS_ALIVE], NS_TOUT_TNS_ALIVE);
+			osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RECOVERING, nsi->timeout[NS_TOUT_TNS_ALIVE], NS_TOUT_TNS_ALIVE);
 			break;
 		case GPRS_NS2_VC_MODE_BLOCKRESET:
 			osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RESET, nsi->timeout[NS_TOUT_TNS_RESET], NS_TOUT_TNS_RESET);
@@ -422,7 +422,7 @@
 	priv->alive.mode = NS_TOUT_TNS_TEST;
 	osmo_timer_schedule(&priv->alive.timer, nsi->timeout[NS_TOUT_TNS_TEST], 0);
 
-	if (old_state != GPRS_NS2_ST_ALIVE)
+	if (old_state != GPRS_NS2_ST_RECOVERING)
 		priv->N = 0;
 
 	ns2_tx_alive(priv->nsvc);
@@ -437,7 +437,7 @@
 static const struct osmo_fsm_state ns2_vc_states[] = {
 	[GPRS_NS2_ST_UNCONFIGURED] = {
 		.in_event_mask = S(GPRS_NS2_EV_REQ_START),
-		.out_state_mask = S(GPRS_NS2_ST_RESET) | S(GPRS_NS2_ST_ALIVE),
+		.out_state_mask = S(GPRS_NS2_ST_RESET) | S(GPRS_NS2_ST_RECOVERING),
 		.name = "UNCONFIGURED",
 		.action = ns2_st_unconfigured,
 		.onenter = ns2_st_unconfigured_onenter,
@@ -465,7 +465,7 @@
 	[GPRS_NS2_ST_UNBLOCKED] = {
 		.in_event_mask = S(GPRS_NS2_EV_RX_BLOCK) | S(GPRS_NS2_EV_RX_UNBLOCK_ACK) |
 				 S(GPRS_NS2_EV_RX_UNBLOCK),
-		.out_state_mask = S(GPRS_NS2_ST_RESET) | S(GPRS_NS2_ST_ALIVE) |
+		.out_state_mask = S(GPRS_NS2_ST_RESET) | S(GPRS_NS2_ST_RECOVERING) |
 				  S(GPRS_NS2_ST_BLOCKED) |
 				  S(GPRS_NS2_ST_UNCONFIGURED),
 		.name = "UNBLOCKED",
@@ -473,13 +473,13 @@
 		.onenter = ns2_st_unblocked_on_enter,
 	},
 
-	/* ST_ALIVE is only used on VC without RESET/BLOCK */
-	[GPRS_NS2_ST_ALIVE] = {
+	/* ST_RECOVERING is only used on VC without RESET/BLOCK */
+	[GPRS_NS2_ST_RECOVERING] = {
 		.in_event_mask = S(GPRS_NS2_EV_RX_ALIVE_ACK),
-		.out_state_mask = S(GPRS_NS2_ST_ALIVE) |
+		.out_state_mask = S(GPRS_NS2_ST_RECOVERING) |
 				  S(GPRS_NS2_ST_UNBLOCKED) |
 				  S(GPRS_NS2_ST_UNCONFIGURED),
-		.name = "ALIVE",
+		.name = "RECOVERING",
 		.action = ns2_st_alive,
 		.onenter = ns2_st_alive_onenter,
 		.onleave = ns2_st_alive_onleave,
@@ -523,14 +523,14 @@
 			}
 		}
 		break;
-	case GPRS_NS2_ST_ALIVE:
+	case GPRS_NS2_ST_RECOVERING:
 		if (priv->initiate_reset) {
 			priv->N++;
 			if (priv->N <= nsi->timeout[NS_TOUT_TNS_ALIVE_RETRIES]) {
-				osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_ALIVE, 0, 0);
+				osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RECOVERING, 0, 0);
 			} else {
 				priv->N = 0;
-				osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_ALIVE, 0, 0);
+				osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RECOVERING, 0, 0);
 			}
 			break;
 		}
@@ -606,7 +606,7 @@
 		break;
 	case GPRS_NS2_EV_RX_ALIVE_ACK:
 		/* for VCs without RESET/BLOCK/UNBLOCK, the connections comes after ALIVE_ACK unblocked */
-		if (fi->state == GPRS_NS2_ST_ALIVE)
+		if (fi->state == GPRS_NS2_ST_RECOVERING)
 			ns2_st_alive(fi, event, data);
 		else
 			recv_test_procedure(fi);
@@ -630,7 +630,7 @@
 				      0, msg);
 			break;
 		/* ALIVE can receive UNITDATA if the ALIVE_ACK is lost */
-		case GPRS_NS2_ST_ALIVE:
+		case GPRS_NS2_ST_RECOVERING:
 		case GPRS_NS2_ST_UNBLOCKED:
 			ns2_recv_unitdata(fi, msg);
 			return;

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22643
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I0b29e8ce6444546d90bde68b1f957f1013238784
Gerrit-Change-Number: 22643
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210203/25033c83/attachment.htm>


More information about the gerrit-log mailing list