aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-10-03Avoid compiling unneeded files when building without IuAlexander Couzens3-8/+7
Remove gprs_ranap.c and gprs_mm_state_iu_fsm.c from the Makefile when building without IU. Change-Id: I2386f8e86bbf0b87eedce9f57eb86b1b64998a69
2019-09-28sgsn: when receiving data PDU notify the Gb GMM fsmAlexander Couzens3-2/+21
When receiving a PDU, the GMM fsm will change to state MM_READY and will re-arm the T3314 Relates: OS#1941 Change-Id: I78f40762fb17bbd4a6f35608a793f8e5271e9b86
2019-09-19Introduce TODO-RELEASE filePau Espin Pedrol1-0/+1
It's going to be useful to track new dependency APIs being used which require dependency version release and version bump during release of osmo-sgsn. Change-Id: Ia495a8577001c6a223c31f4ddd7eee289e3523c7
2019-09-12gprs_ranap: refactor REQUIRE_MM defineAlexander Couzens1-16/+6
All branches need a MM context. Exit early if no MM context present. Change-Id: Ifa4c55f1f2c199fa63bd755311026b8586a65f3f
2019-09-12mm_gb_fsm: unassign the llme when entering MM_IDLEAlexander Couzens1-0/+11
MM_IDLE means there is no known state to this MM. Change-Id: Ieb0d6cea828842763c13942fe1a63dd89399f799
2019-09-12gprs_ranap: send CommonId after receiving Security Mode CompleteAlexander Couzens1-0/+1
After Security Mode Complete, the sender has been authenticated. Send a CommonId to enable paging coordination between CS and PS. Change-Id: If195c26e87ba3054e159746671babf93a12e7013
2019-09-10sgsn_pdp_ctx_terminate: check llme before accessingAlexander Couzens1-1/+2
Change-Id: Ib4361cdc12f9c1674c89c6fafeeb52a3f42abe1d
2019-09-06sgsn: Reject PdpActReq if no GTP pdp ctx existsPau Espin Pedrol1-0/+5
It could happen that SGSN drops GTP side of a pdp ctx (pdp->lib=NULL) while still maintaing the other side (to notify about the entire pdp ctx being torn down). If a PdpActReq arrives during that time, we need to account for that situation, otherwise osmo-sgsn crashes accessing pdp->lib. If no pdp->lib is found at that time, let's reject the request and expect at some point later in time the entire pdp context will be destroyed and reestablished. Related: OS#4173 Change-Id: I6dd87557ebb26fdbd280504abde10d976acecf64
2019-09-03Split out GPRS SM layer into its own filePau Espin Pedrol11-709/+780
Change-Id: Ie61d22e7868af6de73cdf9c731f07130b282599d
2019-09-03Implement GMM State using osmocom FSMPau Espin Pedrol11-53/+261
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-02enum gprs_gmm_state: Fix spec referencePau Espin Pedrol1-1/+1
Change-Id: I62121e46e5091e5b559397aa01f107ddc23e2c18
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 Pedrol39-111/+143
Change-Id: I16fccc0eadf588599b9e5578d0f4dbaf9df81737
2019-09-02Move out gtphub to its own subdirPau Espin Pedrol13-27/+55
Change-Id: I707d5e9b775179e732d281ce3d245de83d648eea
2019-09-02Move out gbproxy to its own subdirPau Espin Pedrol15-30/+62
Change-Id: I2cc98d3a276d953609bbbbaa9782a0112687791e
2019-09-02src/gprs/Makefile.am: Move build of shared .c files to an internal libPau Espin Pedrol3-14/+27
Build files shared by osmo-sgsn, osmo-gbpy and osmo-gtphub into a .la library, so we can later split each application into its own subdir and clearly identify what's used by who. Due to a dependency error with .Po files, I cannot depend on the specific .o files directly in LDADD for each binary, but it works fine on follow up commits when binaries are splitted into different makefiles, so it will be done later. Change-Id: Ib7665c530c086a5f3135c395bb8bf19ed4a882b6
2019-09-02vty: Print MM state and RAN type in show mm-contextPau Espin Pedrol3-1/+16
Value presviosuly printed as MM state is actually usually refereed as GMM state, so rename it. Change-Id: Ia06c53f0cd2a6348237ed3abeb9367d965745aba
2019-09-02Introduce FSM mm_state_iu_fsmPau Espin Pedrol10-65/+165
Implement TS 23.060 6.1.2 Mobility Management States (Iu mode) using osmocom FSM and drop old implementation. Most of the logic on each state is still kept in gprs_gmm.c, will be inserted into the FSM later. Change-Id: I4c9cf8c27194817c56e8949af0205e1cc14af317
2019-09-02Introduce FSM mm_state_gb_fsmPau Espin Pedrol10-125/+154
Implement TS 23.060 6.1.1 Mobility Management States (A/Gb mode) using osmocom FSM and drop old implementation. Most of the logic on each state is still kept in gprs_gmm.c, will be inserted into the FSM later. Change-Id: I04004423e993107374d5a3549b8a93ac169251dd
2019-09-02sgsn_vty: Print correct Iu mmctx id in 'show mm-context'Pau Espin Pedrol1-1/+14
Change-Id: I79333bef4a4bf743fcad07812c9a213b368ff2b6
2019-09-02sgsn_vty: Fix mmctx rate_ctr output indentationPau Espin Pedrol1-1/+1
Change-Id: I1b89c179e1ba08b65e31727fdce90c7b578f4d6d
2019-09-02sgsn_cdr.c: Fix ip addr string buffer sizePau Espin Pedrol1-3/+3
INET(6)_ADDRSTRLEN already contains the required extra null byte at the end, no need to add +1 to it. Change-Id: I5a16659e007c6883fe21582cce5dac544e6d4bb9
2019-09-02gprs_gmm.c: Replace inet_ntoa with inet_ntopPau Espin Pedrol1-3/+8
inet_ntop manual states: "inet_ntoa(3) is now considered to be deprecated in favor of inet_ntop()". Change-Id: I0c708d047122f349acf46797a9e5973040e7ae04
2019-09-02Merge common allocation steps for Gb and Iu ctxPau Espin Pedrol1-30/+27
This way it's easier to add new common functionalitites without forgetting to add it on both sides, and simplifies the code. Change-Id: Ib6c0427ac7b35295cf1caf2f28cb2a5c155b9d9c
2019-09-02Split enum gprs_pmm_state into Iu and Gb counterpartsPau Espin Pedrol6-36/+43
Those two state sets are not part of the same state machine, and are used in different scenarios, so let's split them and handle them in Gb and Iu specific parts of struct sgsn_mm_ctx. This is required in order to improve related code (for instance, use osmocom fsm). Change-Id: I6100d607da316da0595886c6968704dd9ccfbde9
2019-09-02Move llc->MM/SM Gb specific glue code to its own filePau Espin Pedrol7-62/+110
Now that we have RANAP/Iu handling specificities in its own file, let's have also Gb specific glue code for messages coming from llc up to MM/SM layer in its own file. This way same entry points in gprs_gmm.c are used by Gb and Iu: gsm0408_rcv_gmm() (for MM) and gsm0408_rcv_gsm() (for SM). Change-Id: Iaf57922a0970c1d03f6f1d6337d27ae3d4aaf32c
2019-09-02Move lots of Iu/ranap specific code into its own filePau Espin Pedrol11-238/+274
RANAP related functionalities were splitted among several files (gprs_gmm.c, gprs_sgsn.c and sgsn_libgtp.c). Let's move it into its own file to shrink complexity/size of existing files. It also allows to keep a lot of conditionally enabled code (BUILD_IU) and its dependencies (osmo-iuh) together. Change-Id: I549042aaff045a378de77d657cc396ee08f22f33
2019-09-02sgsn: gtp: Drop related pdp contexts on echo timeout against GGSNPau Espin Pedrol3-7/+16
Change-Id: I7e97bac1c13a2c26203eb64e590fd75d77eb44bd
2019-09-02Introduce log helper LOGGGSN and log category DGTPPau Espin Pedrol3-1/+13
It will be used in forthcoming commits. Change-Id: I30f46f44af1d0eee324b1a995c1dad2e1315af7c
2019-09-02gprs_gmm: gsm48_rx_gmm_att_req(): refactor duplicated codeAlexander Couzens1-10/+6
Change-Id: I709f847802a975e1a75d0b87ac5125240cfd0854
2019-09-02gprs_gmm: clarify comment of Iu follow-on requestAlexander Couzens1-2/+10
Change-Id: Ib6b3a1b250de373656310a3c8f88d1d39bdcee60
2019-09-02gprs_gmm: only update gb/iu cell information when Iu/Gb presentAlexander Couzens1-9/+15
This function should not do the transistion of Iu/Gb. Only copy simple data Change-Id: Id52761f3ea655a2d0cc663a950154c6b7c1b5f7a
2019-08-30gtp: cb_delete_context(): Clarify why pdp->lib is set to NULLPau Espin Pedrol1-2/+3
Change-Id: I02c46062d6dc9802d9cae057587e66a68a65436c
2019-08-28gtp: make echo_interval unsignedPau Espin Pedrol3-6/+5
There's no real need to use -1 to indicate echo timer as disabled, since 0 can also be used (it doesn't make sense to have a timer timeout of 0). This way code is simplified. Change-Id: I689034887188a53590eddeffda781629694eb5ed
2019-08-21gprs_gmm.c: Add spec document to function documentationPau Espin Pedrol1-16/+16
Change-Id: Ibb89499e9c1ab588336df34fde26faf3fbf2c72c
2019-08-21gprs_gmm.c: Print value_string of reject causePau Espin Pedrol1-1/+2
Change-Id: I71d9abcf7e3a836c475b7adbb95a82580e41ae6d
2019-08-21vty: Introduce cs7-instance-iuPau Espin Pedrol5-1/+25
Similar to what we already have in osmo-msc. Change-Id: Iaa9e1d06dd0430848ef4f7498a3c15d13f899904
2019-08-21examples: Add osmo-sgsn_custom-sccp.cfgPau Espin Pedrol1-0/+38
Change-Id: Id3a3ccbf168fbbc28153cbf7f0249294eee34d3d
2019-08-20gprs_gmm.c: Use osmo_rai_name() in log linePau Espin Pedrol1-3/+2
Change-Id: Ieab9b7696c93de9a5d3d42f614072a6f2181e37d
2019-08-20gprs/gprs_gmm: implement T3314. Timeout to reset MM state READY->STANDBYAlexander Couzens5-2/+98
When a MS MM state is READY its exact location is known (PCU). On Gb, T3314 (aka TS 23.060 "READY timer") sets the MM state from READY to STANDBY, where only the RA is known. Introduce a second set of timer variables, because state timer can run while another packet state timer is timing out. Related: OS#1941 Change-Id: I4ce23ebe50d141076c20c9c56990b7103cd25e55
2019-08-20tests: Introduce vty-transcript-test testsPau Espin Pedrol2-4/+88
Add a few commands to make sure it's working fine, and print all available timers with default values. Change-Id: Ifd092b9561d49be1f62769d95ba49f6e4aeb4066
2019-08-20Replace own timer infra with libosmocore osmo_tdefPau Espin Pedrol5-125/+131
VTY command "show timer" is also available now. Change-Id: Ia0cf5f0a49737fbc419e2ccc86312d01c6e0056e
2019-08-20tests: Verify that timers can be set over VTYPau Espin Pedrol1-0/+9
Change-Id: I486fc2a56e235a539836894d2042c1ca6e514ab9
2019-08-20gprs_gmm: Avoid spaces in fsm events and enum stringsPau Espin Pedrol2-17/+17
FSM doesn't expect receiving event names containing spaces (log lines generated are confusing). Similar for enums, it's better using code names to match easily and make log lines more clear. Change-Id: I16ede8bf8352b09bc772fd7b43fad2c2274b3ec1
2019-08-20Introduce and use log macros when no mm ctx availablePau Espin Pedrol4-14/+46
Change-Id: Iba22060d8646bc8ec6227684ccb91d98cb4c7be2
2019-08-20gprs_gmm.c: Call mmctx_set_(p)mm_state only on related ran_typePau Espin Pedrol1-14/+27
For new readers it's very confusing why PMM states and MM states are in the same enum, but handled with different functions, and sometimes called one right after the other with different enums. Calling them when on a different ran_type makes the function early return, so let's better conditionally call the function to make it clear in the flow when the function is expected to do something. Change-Id: I65ad9e180177bc9fc7c4a037cd85cfe33b161f73
2019-08-19gprs_gmm.c: Fix typo in log messagePau Espin Pedrol1-1/+1
Change-Id: I357f0af89f5d14d304c3e889a49a5f6c23b7fb7a
2019-08-19sgsn: use sccp_simple_client API to setup ss7 id 0 instead of 1Pau Espin Pedrol1-5/+5
Implementation of osmo_sccp_simple_client() API internally uses ss7 id 1, which is confusing since there's no 0 in use in osmo-sgsn. Let's explicitly use the 0 one so it is configured by "cs7 instance 0" in the VTY. Related: OS#4157 Change-Id: I0e23a6a76ebcba0b1b424e3d3b20d06c1da44cbe