Commit Graph

14 Commits

Author SHA1 Message Date
Pau Espin 041ae3246d sbcap: Fix NULL pointer dereference
Related: Coverity CID#275347
Change-Id: I9ae1cad4ce4e3fe6cfd67ac6058fb7345a3dd49e
2022-08-01 10:49:12 +02:00
Pau Espin c190939f0c Split event list for smscb_message_fsm and smscb_peer_fsm
It really doesn't make sense to share the event list betwen those for
several reasons.
First, because ech of those FSM relate to different things:
* smscb_message_fsm: Handling/scheduling of 1 smscb towards all peers
* smscb_peer_fsm: Handling/scheduling of 1 smscb towards 1 peer.

The former has higher level interface used by the REST
API, plus some mid level interface used by smscb_peer_fsm.
The later has a mid level interface used by smscb_message_fsm to
interact, and a lower level interface used by the SBcAP/CBSP links to
talk to.

Furthermore, this makes it a lot easier understanding which events are
sent from one to another FSM.

Change-Id: I909474d1ff4ec7ed20aff0981da47074397df6cb
2022-07-29 14:49:30 +02:00
Pau Espin e6e878a2fc sbcap: Improve handling of WriteReplaceWarnResponse
If cause != accepted, submit a NACK to the upper layers.
In that case, in the upper layers we don't want to parse the PDU IE
"Unknown Tracking Area List" since it shouldn't be there. 3GPP TS
29.168 4.3.4.3.6 states:
"""
This IE shall only be included if the Cause IE indicates Message accepted, which means the MME will proceed with the
request for Tracking Areas that are known to the MME. The Cause IE indicating Tracking area not valid is used when
all Tracking Areas in the Request are invalid.
"""

Change-Id: I0a4d5bdbb6c4fd3870a4f4ebf226668b70fea06a
2022-07-29 14:49:30 +02:00
Pau Espin 4a9d22e5a0 sbcap: Request and handle Write Replace Warning Indication
Change-Id: I563e7d1c999f14b8197bb41e85b7bcf6262fe2a0
2022-07-29 14:49:30 +02:00
Pau Espin ab8b8402a4 sbcap: Log info about messages received and trasmitted
Change-Id: Ifd1eca79bf4fac63de8066cd6a18004138d51d04
2022-07-29 14:49:26 +02:00
Pau Espin e416069cf6 sbcap: Fix typo in comment
Change-Id: I6d519cb80a90e2a7e80e4608c713996f94043f21
2022-07-27 13:42:17 +02:00
Pau Espin e67faef4ec Move sbcap_as_find_ie() to libsbcap
This function is generic and can be (will be) used in more places.

Change-Id: Ib0c7fa12a8f6faa4271e4132ca5a5c656e717400
2022-07-27 13:42:17 +02:00
Pau Espin 745a2d6600 sbcap: Tx Error ind if Rx ProcedureCode is unknown
Change-Id: I3ee760b98d87f179917acbc369f56d72d0db571d
2022-07-27 13:42:17 +02:00
Pau Espin b093e6708d sbcap: Improve logging on non-implemented PWS Restart/Failure Ind
Change-Id: I0085ac40a7676d9c3626a9da38d02d3b1b2cf6b4
2022-07-27 13:42:17 +02:00
Pau Espin 66625de21c sbcap: Improve logging of rx Error Indication
Change-Id: I63871a57f219a98f8191e6ee4787fc33edb21528
2022-07-27 13:42:06 +02:00
Pau Espin 6db8c13fea sbcap: Drop unused events
Those events doesn't exist in SBc-AP.

Change-Id: Ie4843ed5debbd4282df487ada9596b4d75f4b46c
2022-07-26 14:33:47 +02:00
Pau Espin 678a9cb385 Refactor {cbsp,sbcap}_cbc_accept_cb
Delay allocating the structures until really needed.
First do checks agains the opened connection, and if an issue is
detected simply close the fd.
Next, fetch or allocate the related peer.
Finally, create the link from the fd.
This makes it easier to add early extra checks later when peers will
contain info on link_mode (client|server|disabled) later on.

Change-Id: Id4f83ec6b0b14e556b1caa9c80e7f68d062fec57
2022-07-21 20:33:38 +02:00
Pau Espin 351b2c8c2b Use cbc_{cbsp,sbcap}_link_close when possible
This way we abstract whether the underlaying stream is a TCP/SCTP client
or server.

Change-Id: Ie020b9b5ee93ae8d0c9e7266177728185e8635f2
2022-07-20 20:27:50 +02:00
Pau Espin 5f6dfe77d4 Rename {cbsp,sbcap}_server(_fsm).h s/server/link/
Change-Id: I1e56dd1fcba23f6efd209e9d4dcdc88c8866d250
2022-07-20 20:10:16 +02:00