aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2020-10-01 23:24:07 +0200
committerlaforge <laforge@osmocom.org>2020-10-03 07:19:48 +0000
commitda0a285612dae28d7e358141808a18ddc33cb4b2 (patch)
tree2932a00c5693523a891283854124f4817331970a
parentbf95f0fb2e63098f95864f3fa1fec1c3bc20091b (diff)
ns2: status ind: add additional flags (first and persistent)
Both flags are required to allow the NS user to sent BVC RESET for persistent NSE. On persistent NSE with persistent NS alive configuration (no RESET/UNBLOCK/BLOCK) the PCU can't detect if the SGSN has restartet or crashed. Change-Id: Iaad7b53d44338e5dd81dc2202f23bdcb715af804
-rw-r--r--include/osmocom/gprs/gprs_ns2.h6
-rw-r--r--src/gb/gprs_ns2.c4
-rw-r--r--src/gb/gprs_ns2_internal.h4
3 files changed, 14 insertions, 0 deletions
diff --git a/include/osmocom/gprs/gprs_ns2.h b/include/osmocom/gprs/gprs_ns2.h
index 6b88c723..036c594e 100644
--- a/include/osmocom/gprs/gprs_ns2.h
+++ b/include/osmocom/gprs/gprs_ns2.h
@@ -78,6 +78,12 @@ struct osmo_gprs_ns2_prim {
enum gprs_ns2_affecting_cause cause;
/* 48.016 5.2.2.6 transfer capability */
int transfer;
+ /* osmocom specific */
+ /* Persistent NSE/NSVC are configured by vty */
+ bool persistent;
+ /* Only true on the first time it's available.
+ * Allow the BSSGP layer to reset persistent NSE */
+ bool first;
} status;
} u;
};
diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c
index 53500d14..aca89942 100644
--- a/src/gb/gprs_ns2.c
+++ b/src/gb/gprs_ns2.c
@@ -353,6 +353,8 @@ void ns2_prim_status_ind(struct gprs_ns2_nse *nse,
nsp.bvci = bvci;
nsp.u.status.cause = cause;
nsp.u.status.transfer = -1;
+ nsp.u.status.first = nse->first;
+ nsp.u.status.persistent = nse->persistent;
osmo_prim_init(&nsp.oph, SAP_NS, PRIM_NS_STATUS,
PRIM_OP_INDICATION, NULL);
nse->nsi->cb(&nsp.oph, nse->nsi->cb_data);
@@ -559,6 +561,7 @@ struct gprs_ns2_nse *gprs_ns2_create_nse(struct gprs_ns2_inst *nsi, uint16_t nse
nse->nsei = nsei;
nse->nsi = nsi;
+ nse->first = true;
llist_add(&nse->list, &nsi->nse);
INIT_LLIST_HEAD(&nse->nsvc);
@@ -931,6 +934,7 @@ void ns2_nse_notify_unblocked(struct gprs_ns2_vc *nsvc, bool unblocked)
/* this is the first unblocked NSVC on an unavailable NSE */
nse->alive = true;
ns2_prim_status_ind(nse, 0, NS_AFF_CAUSE_RECOVERY);
+ nse->first = false;
return;
}
diff --git a/src/gb/gprs_ns2_internal.h b/src/gb/gprs_ns2_internal.h
index 1980ef8c..3d0f96da 100644
--- a/src/gb/gprs_ns2_internal.h
+++ b/src/gb/gprs_ns2_internal.h
@@ -120,6 +120,10 @@ struct gprs_ns2_nse {
/*! true if this NSE was created by VTY or pcu socket) */
bool persistent;
+ /*! true if this NSE wasn't yet alive at all.
+ * Will be true after the first status ind with NS_AFF_CAUSE_RECOVERY */
+ bool first;
+
/*! true if this NSE has at least one alive VC */
bool alive;