The NSE wasn't notified when a NSVC went into the BLOCKED state from
an UNBLOCKED state.
Related: OS#5182
Change-Id: I09634e414e9bb966e6b5809b7de1b59fbabd413d
e7dfeac8dc introduced a regression in the block/unblock check
as it was using the priv->initiate_block instead of priv->om_blocked.
The initiate_block tracks who is responsible to unblock the NSVC.
Fixes: e7dfeac8dc ("gprs_ns2_vty: print a response to vty `nsvc <nsvci> (block|unblock|reset)")
Change-Id: I516faea223e30b120a297faed10636daa554be8a
The start_procedure() can't be called after ns2_nse_notify_unblocked()
because ns2_nse_notify_unblocked() might free the nsvc.
Otherwise the fsm will do use-after-free on the NSVC memory.
Related: SYS#5416
Change-Id: If97dfd123eefd71fc6c3fe886a243a21784aeeb4
Introduce 2 new logging sub systems for signal and unit data.
Unify log messages so all log messages look similiar.
Log also Rx PDUs. Ensure dropped Tx packets (BLOCK/RESET on SNS)
contain *Tx*.
Change-Id: I34b8fde2955ecc010d1dcd9512e1bba9211e2c0d
the previous commit fixed the state transition, but also caused
neither Tns-alive nor Tns-test to run
Change-Id: I07ea3fd5cec3d4acf4051930a1a3c746d6fd597c
The log line sneaked in when fixing the alive ms
Fixes: ab0e8646c4 ("gprs_ns2_vc_fsm: use CLOCK_MONOTONIC for alive elapsed timer")
Change-Id: Iffe367b240f47c39232bbc26991c19752a1c75ad
The alive elapsed timeout was only set once on the start of the
test procedure but not every time an ALIVE PDU was sent.
Fixes: OS#4997
Change-Id: I029696dfff21919f97ac4c33cdd82162b5ab1555
gettimeofday can jump and the comment says it should not be used for elapsed timer.
Related: OS#4997
Change-Id: I41989d8f9f82f4d1f7b97f11577653699365c8ae
Reading a log line like this:
<0026> gprs_ns2_vc_fsm.c:808 GPRS-NS2-VC(FR-hdlcnet1-DLCI16-NSE02001-NSVC00001)[0x6120000024a0]{UNBLOCKED}: Received Event RESET
is very ambiguous. Does it mean we received a NS-RESET message? Does it
mean the FSM was instructed to send a NS-RESET? ...
Let's make sure the human-readable names give a very clear indication
of what exactly is happening.
Change-Id: I8b7615b3eca04212831163ff0ea4aea35069cd0e
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
There are use cases in which the NS-VC FSM should go back to
unconfigured _without_ being re-started immediately. Let's permit
the caller to do that.
Change-Id: I31fe695a83d38ea1f10f5444e840633d7fa68442
The counters had all been lost in the ns -> ns2 configuration,
let's try to implement some more of them: LOST_ALIVE, BLOCKED,
LOST_RESET.
Change-Id: I75d8637bd142722fdf9a162a2369aa9cdc980a57
All public enum should have the prefix GPRS_NS2_.
API change which must be synchronized with osmo-pcu,
osmo-gbproxy, osmo-sgsn.
Change-Id: I548ff12f7277cbb7e1a630a3dc02b738ce89be72
All functions which are exposed by gprs_ns2_internal.h should not contain
the public prefix gprs_. Internal function should only contain ns2_ prefix.
Change-Id: Icecc5a918902cd10efac72bbac20780d39aab272
The NSVCI must match the PDUs. The only exception is a RESET with
dialect ipaccess. However those will be handled later.
Change-Id: I0ebdd4f4135b03a7d44a93aff3846c8ec19f333b
The NSE must match the PDUs. The only exception is a RESET with
dialect ipaccess. However those will be handled later.
Change-Id: I00bc04f3f46f5ae8ddd8b4b7d5479fb8e6463e1e
The NSVCI must match the PDUs. The only exception is a RESET with
dialect ipaccess. However those will be handled later.
Change-Id: I8518bdb03e9e33b04b77a2a346d04c5d29544a6c
The NSE must match the PDUs. The only exception is a RESET with
dialect ipaccess. However those will be handled later.
Change-Id: Ic8fc49d850490feb0ff69171a6b0881ae8696c0b
Let's avoid open-coding the printing of log context and rather rely on
log macros to prefix each log line with the relevant context. This
helps log readability, log post processing whether by grep or more
sophisticated tools.
Change-Id: I946c0e77686d91efc5afb62031e1ac1033a9a586
Similiar to the BSSGP layer prefix events with RX if it's an received PDU
or REQ if it's a request from the code.
Change-Id: I341fa28fb671d439c050d985c88ece1521430a99
A BLOCK message can be received when waiting for a UNBLOCK message
in state BLOCK
Related: SYS#5208
Change-Id: Ie7b34b3ef04aa28304143191222324e1a3786cb2
The vty should be able to block or unblock a specific NSVC.
Further more this case is special for the UNITDATA as those
can be still received until the other side response to the BLOCK PDU.
Related: OS#4939
Change-Id: Ic0ce3c5fabc8644cc1ee71a8f6dd783fadf7b84d
48.016 7.2: says an UNBLOCK pdu should be answered with UNBLOCK_ACK on
already unblocked NSVC
Related: SYS#5208
Change-Id: Ic92e99b2607d1e54ecb4668667065502a55a2ce0
IP-SNS NSVC are unconfigured and not started when the IP-SNS is doing the SNS configuration.
If those NSVC would be started it would result in unsolicitated NS-Alive PDUs.
Change-Id: Ifec7288dbe71f10109e8b5c3849bf8f23ac7b557
if we transition to UNBLOCKED as a result of a locally-generated
unblock action, then of course we will receive an inbound UNBLOCK-ACK.
Let's avoid error log messages and confusign the peer with NS-STATUS
in this case:
DLNS DEBUG GPRS-NS2-VC(FR-hdlcnet3-DLCI18-NSEI2001-NSVCI3)[0x612000001720]{UNBLOCKED}: Received Event UNBLOCK_ACK (gprs_ns2_vc_fsm.c:692)
DLNS ERROR GPRS-NS2-VC(FR-hdlcnet3-DLCI18-NSEI2001-NSVCI3)[0x612000001720]{UNBLOCKED}: Event UNBLOCK_ACK not permitted (gprs_ns2_vc_fsm.c:692)
Change-Id: Icc4d960ddad82e3ebbf571d8ff9f24854b52a946
The function gprs_ns2_vs_force_unconfigured() resets the NSVC state back
to the initial value when it was first started. This can be useful for
testing.
Related: SYS#5002
Change-Id: If96d56b19959372af4eba009661be19e985b4d51
NS_AFF_CAUSE_VC_* failure and recovery should indicate the NSVC in
question. Use the string representation reported by gprs_ns2_ll_str()
for that.
NS_AFF_CAUSE_VC_RECOVERY was never sent so do that on unblock as well.
Change-Id: Iad6f0dc4565a46868cbbe17c361dcd473006c83d
Related: SYS#4998
Until now NS2 always free'd it's own memory. Even when the msg
was sent as primitive to the upper layer.
Change the memory ownership when sending a primitive to the upper layer.
The upper layer has to free the msg buffer.
Merge together with: I180433735bfbb3375c41318d7a7709d5845199ba (osmo-pcu)
Change-Id: Id844d7acbcab102a7dc472d608a5e97a748ecb43
There shouldn't be any knowledge of the upper layer in the NS layer.
The PCU / SGSN / gbproxy have to add the pointer when parsing the primitives.
Change-Id: Id7edb8feb96436ba170383fc62d43ceb16955d53