aboutsummaryrefslogtreecommitdiffstats
path: root/src/sgsn/gprs_gmm.c
AgeCommit message (Collapse)AuthorFilesLines
2023-01-11Move extern declarations of tall_sgsn_ctx to sgsn.hPau Espin Pedrol1-1/+0
Change-Id: Ifbd54b2e92db8d4a0e0cd1c569cfd83dd85165b8
2023-01-05Move gtp related functions to gtp.hPau Espin Pedrol1-0/+1
The functions are implemented in sgsn_libgtp.c and hence belong to header file gtp.h Change-Id: I7f5cf2895b05e03435769548b61051e6284ccb3c
2022-12-28Move some functions gprs_gb.[c,h] -> gprs_gmm.[c,h]Pau Espin Pedrol1-0/+49
This leaves only NS protocol related code in gprs_gb.[c,h], which will be renamed to gprs_ns.[c,h] in a follow up patch. Change-Id: I3dcbe1d0f75cb91ec8b700e239e2ba16fff030a2
2022-03-10Iu: add UEA encryptionNeels Hofmeyr1-1/+8
Add vty 'encryption uea 0 1 2', defaults to 'encryption uea 0' to yield previous behavior. If any UEA above 0 is enabled, include the UEA key in the Iu Security Mode Command. I noticed that only the code bit in st_iu_security_cmd_on_enter() affects the test. The same code in gsm48_gmm_authorize() seems to be dead code? But applying the patch there as well just to be safe. We cannot yet verify the chosen UEA to match a configured UEA level, because the iu_client.c does not send us message details with the RANAP_IU_EVENT_SECURITY_MODE_COMPLETE. Also we cannot yet send the set of configured UEA to the hNodeB, since, again, iu_client.c does not provide the proper API for it. The proper solution here is to completely dissolve iu_client.c and do all Iu handling in osmo-sgsn itself -- see OS#5487. Related: SYS#5516 Related: I1a7c3b156830058c43f15f55883ea301d2d01d5f (osmo-ttcn3-hacks) Change-Id: I27e8e0078c45426bf227bb44aac82a4875d18d0f
2022-03-07s/cipher_support_mask/gea_encryption_maskNeels Hofmeyr1-3/+3
will add uea_encryption_mask, and find that the name 'cipher_support_mask' is not concise enough. Related: SYS#5516 Change-Id: Ie8d4a0534c5b751f698bce425427bb1d28ddea31
2021-06-16add support for multiple encryption algorithms and a5/4Eric1-5/+43
Change-Id: Ie6700c4e9d2df1eb5fde1b971e287b62668cc2de Related: SYS#5324
2021-06-04Use new stat item/ctr getter APIsPau Espin Pedrol1-11/+11
Generated with spatch: """ @@ expression E1, E2; @@ - &E2->ctr[E1] + rate_ctr_group_get_ctr(E2, E1) """ Change-Id: I2e064883ac6dafa89e41a297a886a9ebd26ce925
2021-04-14mm_state_{gb,iu}_fsm: Improve naming for detach eventPau Espin Pedrol1-2/+2
The E_(P)MM_IMPLICIT_DETACH event was actually sent and handled when the UE was considered to be detached, no matter the reason, be it due to implicit detach, or Detach Request received, etc. So, let's properly name the event to avoid confusions in the code. Related: SYS#5389 Change-Id: I224ea9db80b4d96696934cea06349dab036f919b
2021-04-13gprs_gmm.c: State proper GMM prefix logging rx/tx of GMM messagesPau Espin Pedrol1-23/+23
Change-Id: I58af41acdc4a04870b4cf2ea34a272d46d896254
2021-03-25mm_iu: Send event E_PMM_PS_CONN_ESTABLISH upon rx GMM SERVICE REQUESTPau Espin Pedrol1-1/+1
Attach event should only be triggered by rx Attach Request, not other messages. Furthermore, currently E_PMM_PS_CONN_ESTABLISH is defined and expected in FSM but not sent by anyone. Also, The opposite transition is done by E_PMM_PS_CONN_RELEASE: """ MM_STATE_Iu(0)[0x81379b0]{Connected}: Received Event E_PMM_PS_CONN_RELEASE MM_STATE_Iu(0)[0x81379b0]{Connected}: state_chg to Idle ... MM(001010123456063/c8b8bd08) -> GMM SERVICE REQUEST MI(3367550216) type="signalling" MM_STATE_Iu(0)[0x81379b0]{Idle}: Received Event E_PMM_PS_ATTACH MM_STATE_Iu(0)[0x81379b0]{Idle}: Event E_PMM_PS_ATTACH not permitted """ Related: SYS#5389 Change-Id: Ica00891f91834522f4dea2508b62af34e4c4eca7
2021-03-25gmm: log GMM msg type name instead of numberPau Espin Pedrol1-2/+2
Change-Id: I2dc6eb5bfb0f44caf2687e582d660f71fdd647a2
2020-12-01gmm: Introduce comment to ease addition of Network feature support IE laterPau Espin Pedrol1-0/+3
Change-Id: I131cba3de3c80c61d5549e7c31b4eacaaeddb040
2020-12-01gmm: fix build without define PTMSI_ALLOCPau Espin Pedrol1-3/+7
Change-Id: Idcac01c4634af81ef884dc2b1b20dec3f8d12236
2020-10-23process_ms_ctx_status: Fix crash deleting PDP Ctx if GTP side was already ↵Pau Espin Pedrol1-1/+4
released sgsn_delete_pdp_ctx() should never be called without checking if the GTP side is available, since it may happen that it has already been released by the time the mmctx tells us the pdp ctx is gone on the MS side. Fixes: OS#4817 Change-Id: Ie618874545172ec98355174a2ee041fc4a8bec16
2020-10-23process_ms_ctx_status: refactor to avoid code duplicationPau Espin Pedrol1-15/+10
Change-Id: I1d1a1284c1563b3a5598e79d8ffd544288de4d62
2020-09-21Fix Radio Priority in MM Attach and PDP Context ActivationKeith1-1/+1
3GPP TS 24.008 Section 10.5.7.2 Radio Priority states that the Radio Priority IE is 3 bits as follows: -------------------------------------------- 0 0 1 priority level 1 (highest) 0 1 0 priority level 2 0 1 1 priority level 3 1 0 0 priority level 4 (lowest) All other values are interpreted as priority level 4 by this version of the protocol. -------------------------------------------- However at least the MediaTek MT6753 and MT6592 have been observed to interpret a value of 0 0 0 in an undetermined way resulting in lack of access to RACH in the cell. Fixes: OS#4506 Change-Id: I810cd541eb5764ee3f2c238bcd3a10836228d0b5
2020-09-20gmm: on invalid RA id reject the MS with an implicit detachAlexander Couzens1-10/+20
As long the SGSN doesn't support PS handover treat unknown RA as invalid and do an implicit detach. Fixes ttcn3 crash when an RAU happen within an Attach Request Change-Id: I6a0b335d51f58c26349f7e0a62b2107d7d351d07
2020-06-18use new osmo_mobile_identity API everywhereNeels Hofmeyr1-70/+86
Depends: If4f7be606e54cfa1c59084cf169785b1cbda5cf5 (libosmocore) Change-Id: I4cacb10bac419633ca0c14f244f9903f7f517b49
2020-05-10fix nullpointer: in gsm48_rx_gmm_ra_upd_req()Neels Hofmeyr1-1/+1
This caused frequent crashes at 36c3. The "proper" fix is probably elsewhere (lynxis mentions an unfinished patch), but at least this prevented some crashes during active operation. Once this is merged, we can (re)enable SGSN_Tests_Iu.TC_geran_attach_iu_rau, which tests exactly for this scenario: A Subscriber / MM context that is so far attached via GERAN, but now receives a RAU via UTRAN/Iu. Closes: OS#4339 Change-Id: Ifde15dc4151d84748f0e67b32c9c260cb2d9d8fc
2020-02-04gprs_gmm_fsm.c: Implement RAT change between 2g and 3gAlexander Couzens1-1/+31
Related: OS#2737 Change-Id: I3fc614da6ba137e871ee0fe86ca22b6a4a354dd2
2020-02-04gprs_gmm: Check for RAT change and ensure this only happens for RAU/ATTDaniel Willmann1-0/+27
Change-Id: I38cb31907eddeade5350cdb648df179408d908d2 Related: OS#3727
2019-11-21gprs_gmm.c: Send XID reset with received TLLIPau Espin Pedrol1-1/+1
Otherwise lower layers will end up using a TLLI from PTMSI which was not yet announced to the MS if it is still not in GMM attached state, as showcased by SGSN_Tests.TC_attach_req_id_req_ra_update. Related: OS#3957, OS#4245 Change-Id: Ide51726abb82f5784eca4ab8d62b2ad8512be843
2019-11-21Improve logging in gprs_llc.c codePau Espin Pedrol1-2/+2
Change-Id: Id89cc6760179fb9b1709a30b5d1af41d466b280b
2019-11-08gmm: Fix assertion hit during RA UPD REQ before completting gmm attachPau Espin Pedrol1-2/+2
Output: 20191107021548500 DMM <0002> gprs_gb.c:40 MM_STATE_Gb(2596296189)[0x6120000084a0]{Idle}: Received Event E_MM_PDU_RECEPTION 20191107021548500 DMM <0002> gprs_gmm.c:1531 MM(/d4b6d7af) -> GMM RA UPDATE REQUEST type="RA updating" 20191107021548501 DMM <0002> gprs_gmm.c:1615 MM(/d4b6d7af) The MM context cannot be used, RA: 901-70-2758-208 Assert failed mmctx->gb.llme == NULL gprs_gmm.c:1620 Scenario reproducing the crash can be triggered with TTCN3 SGSN_Tests.TC_attach_req_id_req_ra_update. Basically, SGSN first receives an ATTACH REQ with a given RA ID, then SGSN switches to state CommonProcedureInitiated and sends GMM ID REQ, and MS/PCU answers immediatelly with a RA Update instead with a new RA ID. Related: OS#3957, OS#4245 Change-Id: I64fa5cf1b427d3abb99e553e584897261a827ce6
2019-10-08gprs_gmm: release Iu connection on RAU failuresAlexander Couzens1-0/+6
When a RAU fails without an a GMM context, release the Iu connection after sending a response. Change-Id: I05a9200f55d608ccfb3f86184c324a2b428da76b
2019-09-03Split out GPRS SM layer into its own filePau Espin Pedrol1-700/+6
Change-Id: Ie61d22e7868af6de73cdf9c731f07130b282599d
2019-09-03Implement GMM State using osmocom FSMPau Espin Pedrol1-23/+21
State machine inspired in the one from TS 24.008 4.1.3.3.1. Some state transitions are inroduced in the code but are still commented out since we lack some functionalitites or improvements in the code to handle different scenarios. Most of the logic is still outside of the FSM, but at least now the states are handled in a sane way triggered by events. Change-Id: Idecb43c10d66224d4f9ba9320825040ce6cf9a07
2019-09-02gmm: Move code handling GMM PTMSI Realloc Complete to its own functionPau Espin Pedrol1-11/+17
Change-Id: I3b21a976c6683bea5419a33f0ccb8b56483d6e21
2019-09-02gmm: Move code handling GMM Routing Area Update Complete to its own functionPau Espin Pedrol1-25/+32
Change-Id: I8e28ac03edf82374e804701ebe635e1171a2b36a
2019-09-02gmm: Move code handling GMM Attach Complete to its own functionPau Espin Pedrol1-33/+40
Change-Id: I2d8d947ab1eb4100f404b885461f7a30583c9ac6
2019-09-02Move out sgsn to its own subdirPau Espin Pedrol1-0/+2852
Change-Id: I16fccc0eadf588599b9e5578d0f4dbaf9df81737