aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2023-03-30tests: $(BUILT_SOURCES) is not defined, depend on osmo-sgsnVadim Yanitskiy1-5/+5
Change-Id: I4f9e99ed3673bb51fa5f7d374c35c3c92735eacb
2023-03-11tests: use -no-install libtool flag to avoid ./lt-* scriptsVadim Yanitskiy7-0/+12
This option should be used for any executables which are used only for testing, or for generating other files and are consequently never installed. By specifying this option, we are telling Libtool that the executable it links will only ever be executed from where it is built in the build tree. Libtool is usually able to considerably speed up the link process for such executables. Change-Id: I8af6a38d7abbf06aa8268981c80c3bfda2f80a27
2023-01-11vty: Introduce encryption cipher-plugin-path commandPau Espin Pedrol1-0/+2
The load of plugins will eventually be moved to libosmo-gprs implementation, and path will be passed as a parameter. Once it's moved inside libosmo-gprs, it will be more strict on load failures, which can cause internally if the path doesn't exist (unless NULL is passed). Hence, add a VTY config to allow configuring the right path, and have it disabled by default. Change-Id: I4f965c7afafa193f4d7486750dd3e43cca22bb65
2023-01-11Move global mmctx list into struct sgsn_instancePau Espin Pedrol1-0/+3
Change-Id: Idf8458902321da03b9b0831dad3ad383a9c7afa1
2023-01-11Split gprs_sgsn.{c,h} -> {auth,mmctx,sgsn}.{c,h}Pau Espin Pedrol2-1/+4
Some level of split already existed, like sgsn_auth.c, but headers were entangled together. Let's clearly separate application centric code (sgsn.c/h), auth related code (auth.c/h) and mmctx related code (mmctx.c/h). Change-Id: I048a082851c1275c959649942904205b02acce2a
2023-01-11gtphub.h: Remove dependency on sgsn/gprs_sgsn.hPau Espin Pedrol1-1/+2
It is only really needed to import define GSM_APN_LENGTH, which is actually also available in libosmogsm. Hence simply use the one from libosmogsm. Change-Id: I4c6110feeeaa1adfb6b1f0147eeb56dfe34636ec
2023-01-11Move gtphub header to include/osmocom/gtphub/Pau Espin Pedrol1-1/+1
Change-Id: I82e1f2a3bc8e22b28747a540879bd661f1704cde
2023-01-11Move sgsn_pdp_ctx to its own file pdpctx.{c,h}Pau Espin Pedrol1-0/+1
This further shrinks the mess in gprs_sgsn.h, and allows to easily see layer violations (like pdpctx.c requiring llc.h) Change-Id: Iad4da06efee7d8514ff48423bdaebc0f26413cc1
2023-01-11gtp_{ggsn,mme}: Allocate contexts under struct sgsn_instancePau Espin Pedrol1-3/+3
This way apns are managed by the lifcycle of the main global struct sgsn_instance automatically. Change-Id: Ie65d59632a368c6957c33dca64e856ace792b2c6
2023-01-05Move global apn_list inside struct sgsn_instancePau Espin Pedrol1-0/+1
This way apns are managed by the lifcycle of the main global struct sgsn_instance automatically. Change-Id: I8cc8e540cfb64d0f130e9c0aaedf7b0835f8fe16
2023-01-05Move struct sgsn_subscriber_pdp_data to gprs_subscriber.hPau Espin Pedrol1-3/+0
The functions driving its lifcyecles are already in gprs_subscriber.c, and are used mainly by functions in the same file, hence move it to the related header to further shrink gprs_sgsn.h. Change-Id: Iff7be91af130a3317d57d3649c17e3d5d2540e7a
2023-01-05Move struct apn_ctx and APN related definitions to its own filePau Espin Pedrol1-0/+1
This allows further shrinking of gprs_sgsn.{c,h} and also being able to use GSM_APN_LENGTH on different headers easily (needed by follow-up patch). Change-Id: Id225ed8b84e1376f4a30f17dd4b153b6b1a6efa8
2023-01-05Keep sgsn subsystems under struct sgsn_instance lifecyclePau Espin Pedrol2-16/+17
Rework initialization and destruction of several sgsn subsystems to be allocated & released together with the struct sgsn_instance. This makes it easier to destroy and recreate the entire context and allows us to start moving global variables scattered around to be under struct sgsn_instance. Change-Id: Idf60519b8e475b94d38bbb69e737132a5afaefab
2023-01-05Fix -Werror=old-style-definitionPau Espin Pedrol3-8/+8
Change-Id: I119d4ba58d9c68df12b433b0cee924468a1473d8
2023-01-05Move struct sgsn_ggsn_ctx to its own file gtp_ggsn.{c,h}Pau Espin Pedrol2-0/+2
Similar to what we already have for struct sgsn_mme_ctx in gtp_mme.{c,h}. This is just the nth step of properly splitting different protocol layers, data model, etc. Change-Id: Iad1895f09e43e299df7bb126bf52fdb98268392e
2023-01-04Replace gprs_str_to_apn() with libosmocore API osmo_apn_from_str()Pau Espin Pedrol1-17/+17
The exact same function exists in libosmocore with a different naming. Change-Id: Ibef55a648f2d58f4fdd24fa553efde530982af2d
2023-01-02Move gprs_tmr_to_secs() to tests/gprs/gprs_test.cPau Espin Pedrol1-0/+16
That function is only used in the test. Let's hence move the function to the same test file in order to simplify osmo-sgsn code. Change-Id: I69d80810362d75eb93974af34f61639514f99f8a
2022-12-28Rename gprs_gb.[c,h] -> gprs_ns.[c,h]Pau Espin Pedrol1-1/+1
All remaining code in that file is NS protocol related, hence let's rename it so that we end up with one file per protocol in the Gb stack. Change-Id: I8312c8a70d60cab48764950c5b57ca02964e9db2
2022-12-28Create new specific file for BSSGP codePau Espin Pedrol1-0/+1
Right now there's no much code there since the related code is totally entangled with the LLC one. This will eventually change in the future when we switch to use libosmo-gprs. Hence, this commit is a preparation to have already some place to put new BSSGP specific code in the future. Change-Id: I816396ab5ccb86032bbc21b41a959934a7768780
2022-12-22Move gprs_gb_parse.[c,h] to tests/sgsn/Pau Espin Pedrol4-2/+754
That big file is really only used by tests/sgsn/sgsn_test nowadays, so let's keep it out of osmo-sgsn app code base. Change-Id: Ia5a639832f52b2f015a2800bd0d94a28d7bc689b
2022-11-04vty: Make new libgtp tdefs configurable through VTYPau Espin Pedrol1-0/+1
Related: OS#5485 Depends: osmo-ggsn.git Change-Id I10bc8e2e197c0e8753b23b684b5ae41025672bf7 Change-Id: I46e9cd158a9f2f721c69f807beb7bb67a459f4a4
2022-04-13tests: use 'check_PROGRAMS' instead of 'noinst_PROGRAMS'Vadim Yanitskiy7-7/+7
When using 'check_PROGRAMS', autoconf/automake generates smarter Makefiles, so that the test programs are not being compiled during the normal 'make all', but only during 'make check'. Change-Id: I8118ee3d3da9bdcd0c691471ef91b95dba21004a
2022-03-10Iu: add UEA encryptionNeels Hofmeyr1-0/+1
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-1/+1
will add uea_encryption_mask, and find that the name 'cipher_support_mask' is not concise enough. Related: SYS#5516 Change-Id: Ie8d4a0534c5b751f698bce425427bb1d28ddea31
2021-11-15tests/Makefile.am: do not try removing non-existing filesVadim Yanitskiy1-3/+3
Change-Id: Ie9f4a9aa4061e4e4c659b1ad71596846ce75df7b
2021-06-16add support for multiple encryption algorithms and a5/4Eric2-1/+2
Change-Id: Ie6700c4e9d2df1eb5fde1b971e287b62668cc2de Related: SYS#5324
2021-05-19Support forwarding RIM messages over GTPCv1 EUTRAN<->GERANPau Espin Pedrol2-0/+57
MMEs connect over Gn interface using GTPCv1 towards the SGSN in order to exchange RIM PDUs by using "RAN Information Relay" GTPCv1 message type. For more info, see 3GPP TS 29.060 sec 7.5.14.1 "RAN Information Relay" In order to support it, this commit does the following: * Uses new libgtp APIs to rx and tx RAN Information Relay messages. The same "gsn" object is reused, ie. the local GTPCv1 socket address used for exchanging messages against GGSN is reused. * Adds a new "sgsn_mme_ctx" struct holding information about MMEs allowed by the SGSN, each one containing information about the GTP address it uses, the in/out routing based on TAI requests, etc. The set of MMEs and their config can be set up using new VTY node introduced in this commit. * The RIM related code in SGSN is refactored to allow forwarding from and to several types of addresses/interfaces. Depends: osmo-ggsn.git Change-Id Iea3eb032ccd4aed5187baca7f7719349d76039d4 Depends: libosmocore.git Change-Id I534db7d8bc5ceb19a2a6866f07d5f5c70e456c5c Related: SYS#5314 Change-Id: I396450b8d8b66595dab8ff7bf41cbf964bb40d93
2021-04-14Iu: Drop timer X3314Pau Espin Pedrol1-1/+0
This Iu timer is Osmocom specific, but is made to resemble T3314 timer from GERAN (also named READY timer). The idea of this activity timer was to arm it whenever PMM state transitions to CONNECTED, and then rearm it every time there's some sort of activity, until there's none for some time, then we send a Release Command to close the conn with the HNGBW/RNC. That's the same principle as per spec-defined READY timer T3314. However, there's still a fundamental problem with it: GTP-U in GERAN passes through the SGSN, but in UTRAN, the GTP-U stream goes directly from the HnodeB to the GGSN. Hence, there's no proper way to re-arm this timer upon activity in UTRAN, basically because the SGSN will never see (userplane data) activity. That explains why the E_MM_PDU_RECEPTION event exists for mm_state_gb_fsm, but doesn't exist for mm_state_iu_fsm. As a result, the timer is currently never rearmed, which means it will transition to IDLE always after 44 seconds (default value) once it went into CONNECTED state. In UTRAN, there is a SCCP connection for each subscriber between RNC/hNB and SGSN. If the subscriber is no longer in the respective state, the RNC/hNB should release that IuPS SCCP connection, whcih in turn means the SGSN cleans up its state. Furthermore, SCCP has a built-in IT (inactivity timer). So should the RNC/hNB die, that timer would time out, and the SGSN-side local SCCP stack (provider) wold send a RELEASE.ind for that connection to the user (SGSN). TLDR; this timer is not really needed and cannot be implemented properly in UTRAN, so let's remove it. Related: OS#5116 Change-Id: Ibc71829e417bf2dd0c27deb842369dd4f17010d6
2021-03-10Remove bogus DNS log categoryHarald Welte1-5/+0
When we switched to the libosmogb NS2 implementation, we should have removed the DNS category, as NS2 uses DLNS internally and hence DNS is unused. Change-Id: Ia4723ab344ad6a1927029a2d5d0dda020266b39d Closes: OS#5058
2021-02-08gbproxy: remove (moved to own repository)Oliver Smith4-132/+0
New repository: https://git.osmocom.org/osmo-gbproxy/ Related: OS#4992 Change-Id: I37f7cebaf2a06bd93627a452f5df44edcfc0f87a
2021-01-04sgsn: Use the new NS2 apiAlexander Couzens1-1/+1
The new NS2 api supports NSE with multiple NS-VC and contains a NS-VC fsm. FR/GRE support is not working. The configuration is compatible except for FR/GRE. Relates: OS#4629 Depends-on: Iaad7b53d44338e5dd81dc2202f23bdcb715af804 (libosmocore) Depends-on: I6cef42749555e577d5573f2ed8b8bce4cf842a98 (libosmocore) Change-Id: I92a3bcaf166b091a22d74c7c1586964d33d7cc9d
2020-12-29gbproxy: Add SGSN NRI configurationDaniel Willmann4-2/+79
In order to support SGSN pooling we need to configure the various NRI parameters such as the bitlen, NULL NRI, and which NRIs are assigned to which SGSN. Related: OS#4890, OS#4472 Change-Id: Id67592aa7712e5e04e7264b2fb8f26d57eb7e69e
2020-12-14gbproxy: rename vty command "show gbproxy ..." to "show gbproxy bvc ..."Harald Welte1-1/+1
we have other objects to show, and the orthogoanl way to do this is to rename the existing one. Change-Id: I7836a37533a2de81720acedda712d61f429df12c
2020-12-12gbproxy: Improve VTY state introspectionHarald Welte1-1/+1
* allow to print not only BSS-side BVCs, but also SGSN-side * differentiate between SIG and PTP BVC * print the actual BVC FSM state name instead of just UNBLOCKED/nothing Change-Id: I8e09a9dc296b15094d191b0451d04457c815d116
2020-12-10gbproxy major rewrite for SGSN pool supportHarald Welte1-1/+1
Rewrite of a large part of osmo-gbproxy in order to prepare for SGSN pool support. The amount of changes are of such fundamental nature that it doesn't make sense to try to split this into hundreds of individual changesets. Related: OS#4472 Change-Id: Ie0746f17927a9509c3806cc80dc1a31d25df7937
2020-12-10migrate to DLBSSGP as log sub-system for BSSGPHarald Welte1-5/+0
Change-Id: I69ee10b6fad1da2053cf6f3ae99d3ecf62a144ce Depends: libosmocore.git Change-Id I506190aae9217c0956e4b5764d1a0c0772268e93
2020-12-07gbproxy: Delete gbproxy_testHarald Welte5-1486/+0
The test is actually performing invalid operations such as sending empty NS packets without even a BSSGP header - and assumes that gbproxy should route those. Given that we have a much more comprehensive tset suite in GBProxy_Tests.ttcn in osmo-ttch3-hacks.git, it makes sense to remove the testsuite. It may contain many more wrong assumptions, or assumptions that no longer hold true with the "gbproxy 2020". Change-Id: I053aebab6bf5d0ee955f2221bf27925b36140cf3
2020-12-05gbproxy: Remove patching, TLLI-tracking and SGSN2 supportHarald Welte3-9306/+0
Those features were introduced a long time ago for one specific use case at one specific user, and they are not needed anymore. They complicate the code base significantly and are hard to maintain with all the upcoming modifications regarding SGSN pool supoprt. Change-Id: Id9cc2e1c63486491ac5bb68876088a615075fde6
2020-12-05gbproxy: convert nse->bvcs from llist_head to hashtableHarald Welte2-19/+20
For the common lookup-by-bvci, this should reduce the computational complexity significantly. Depends: libosmocore.git I8ef73a62fe9846ce45058eb21cf999dd3eed5741 Change-Id: Ic8e9279fd61a3c514fc3203429f36a468f0e81d3
2020-12-05gbproxy: convert bss_nses from llist_head to hashtableHarald Welte1-2/+2
For the common lookup-by-nsei, this should reduce the computational complexity significantly. Depends: libosmocore.git I8ef73a62fe9846ce45058eb21cf999dd3eed5741 Change-Id: Idbb6a362332bb6e3ce22102e7409ae80d0980f44
2020-12-05gbproxy: Rename gbproxy_cfg.nses to gbproxy_cfg.bss_nsesHarald Welte1-1/+1
We will soon also have a list of sgsn-side NSEs, and we need to differentiate those. Change-Id: If5accec0c70c01b88927ea07beba6f6488bd9d5a Related: OS#4472
2020-12-05gb_proxy: Rename gbproxy_peer to gbproxy_bvcHarald Welte1-51/+51
I cannot really read the code while it contains its historical weird naming. A "peer" used to be a strange amalgamation of NSE + BVC, while in reality we can have any number of BVC on top of each NSE. We recently started to split the peer into a gbproxy_nse_peer + gbproxy_peer. This takes it one step further and renames gbproxy_peer to gbproxy_bvc, as that's really what it is. Change-Id: Iae01067282a6401f6af4cab731202872d2cdb080
2020-11-30gbproxy: Ensure BVC0 is reset before handling PtP BVCsDaniel Willmann2-0/+109
Change-Id: I9c67f973f7bca00e8eb22a024ef2282c007dd84b Related: SYS#5226
2020-11-30gbproxy: Add NSE peer that can have multiple gbproxy_peersDaniel Willmann2-103/+108
We want this level of indirection to support multiple BVCs per NSE. The current code assumes that an NSE only has one BVC which breaks messages on the signalling BVC which should only be sent once to an NSE regardless of the number of BVCs it contains. Change-Id: I97cc6c8f8c0f1b91577ab8f679c4ae217cc88076 Related: SYS#5226
2020-11-30gbproxy: Remove test testing NSVCI changeDaniel Willmann2-255/+2
This was overlooked in commit 82182d which already removed lots of NS-specific code in gbproxy_test.c From that commit message: """ Since NS2 has a different abstraction we mock up the prim send/recv functions and don't test NS like the old tests did. """ Change-Id: Ic1d7e646e633c9fa62812f5005ed10c0108a06f2 Related: SYS#5226
2020-11-09osmo-gbproxy: Free msgb in ns2 prim callbackDaniel Willmann1-3/+1
Commit cce88282388f in libosmocore changed the msg ownership model - the callback that the user registers is now responsible for freeing the msg. Change-Id: Iee940aba7d94afefb5957dbe5f0b04dcf951b31c Related: SYS#4998
2020-11-06gbproxy: Add todo for BVC RESET logicDaniel Willmann1-2/+0
When we receive a signalling BVC RESET from the SGSN we want to reset the signalling BVCs for every peer. Change-Id: I98c1a53d0e4b9a988e9ddec97ce0c67ded6f6326 Related: SYS#4998
2020-11-06Port gbproxy to NS2Alexander Couzens3-4754/+3054
Since NS2 has a different abstraction we mock up the prim send/recv functions and don't test NS like the old tests did. Related: SYS#4998 Change-Id: Iecfd0408a35a11638d254c1db3c1d477b1a11524
2020-10-20VTY: Add gtp state-dir commandKeith1-0/+1
The SGSN initialises GTP with gtp_statedir of "./" which may not be the desired path for writing the gsn_restart file. When starting from systemd for example, we might write to the system root. This patch allows override via the config file. Closes: OS#4820 Change-Id: Ib3ffb7fd6ea1d9b0286111d8c2cba9da5394ca58
2020-10-02gtphub_test: fix compilation error on gcc 10.2.0Alexander Couzens1-0/+2
Ensure dump && hex can't be zero. gtphub_test.c: In function ‘_reply_is.constprop’: gtphub_test.c:535:3: error: ‘%s’ directive argument is null [-Werror=format-overflow=] Change-Id: Id27bf46855a228935fe706584f9b27cf3facf623