path: root/openbsc/tests/sgsn/sgsn_test.ok
AgeCommit message (Collapse)AuthorFilesLines
2017-10-26remove sgsn, gbproxy and gtphub from openbsc.gitHarald Welte1-45/+0
The GPRS related programs osmo-sgsn, osmo-gtphub and osmo-gbproxy have been split off into the separate osmo-sgsn repository, which can be found at git://git.osmocom.org/osmo-sgsn.git http://git.osmocom.org/osmo-sgsn/ This is technically unrelated but conceptually part of the larger NITB-split activities. I did a brief log of all changes in src/gprs and couldn't find any commits that we might have applied here but which are missing from osmo-sgsn.git. Change-Id: If60e28b23f5cfb2c4eb354951363a2bb63f3e0de
2017-02-25add struct gprs_subscr, separating gprs from gsm_subscriberNeels Hofmeyr1-0/+8
Prepare for replacing gsm_subscriber with vlr_subscriber. vlr_subscriber will not make sense to be used in gprs, so have a dedicated GPRS subscriber struct. (Could change if the gprs code were to use libvlr; is currently independent). Related: OS#1592 Change-Id: Ia8b391ee009c8545763cba04505be3947835120e
2016-12-13Revert "Support Deactivate PDP Context Request from network"Neels Hofmeyr1-4/+0
This reverts commit 1611df5226199da2bf2fba3d22d93cc1a6c6c777. This is due to a segfault introduced to the asan build only. See: http://lists.osmocom.org/pipermail/openbsc/2016-December/009966.html Subject: new sanitizer breakage: SIGSEGV in sgsn_create_pdp_ctx() Date: Tue Dec 13 12:08:32 UTC 2016 Change-Id: Ic926c0e6778947b516994822e3a21d4fde25bb02
2016-12-12Support Deactivate PDP Context Request from networkPravin Kumarvel1-0/+4
Enable Deactivate PDP context based on the IMSI of the subscriber. When there are PDP contexts present for a MM context, PDP context will be deactivated along with GMM Detach(MM context deletion). If there are no PDP present, MM context will be deleted to avoid further PDP context request from the MS. Test cases is added to check this functionality. Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13
2016-06-20typo in sgsn_testNeels Hofmeyr1-1/+1
(committing just to test gerrit, if it goes through it's still a valid change) Change-Id: I3291ea2da99cd7f0e2f340b0e6fd6022d088beb8
2016-02-22sgsn: Re-add searching for MM ctx based on TLLI / P-TMSI matchesJacob Erlbeck1-1/+0
If an MM context cannot be found based on BBSGP info and a RA UPDATE REQUEST is received, try to find an MM context with an P-TMSI from which the TLLI could have been derived. This also checks, whether the routing area matches. This is similar to the old behaviour removed by the commits "sgsn: Only look at TLLIs in sgsn_mm_ctx_by_tlli" and "sgsn: Remove tlli_foreign2local", except that this will only be done for RA UPDATE REQUESTs now. Sponsored-by: On-Waves ehf
2016-02-22sgsn/test: Add test case test_gmm_routing_areasJacob Erlbeck1-0/+8
This test add different cases of routing area changes. Sponsored-by: On-Waves ehf
2015-02-06Revert "gprs: Block other GSUP procedures during PURGE_MS"Jacob Erlbeck1-1/+0
This reverts commit f81cacc6814dde73f203d125b0065d1451a98317. Since the PURGE MS retry mechanism had been removed, this feature is not used anymore. It just makes the code more complex. Conflicts: openbsc/include/openbsc/gprs_sgsn.h openbsc/src/gprs/gprs_subscriber.c openbsc/tests/sgsn/sgsn_test.c
2015-02-06sgsn: Select GGSN based on APNJacob Erlbeck1-0/+1
Currently the APN IE in the Activate PDP Contex Request and the PDP data that is stored with the subscriber is ignored completely. This commit adds the sgsn_mm_ctx_find_ggsn_ctx that checks the APN IE against the subscriber's PDP data entries if both are present. If there is no match, the request is rejected. If an APN IE has not been included but PDP data entries are present, the function checks all of these entries against the static 'apn' configuration to find a suitable entry. If an APN has not been determined so far and any APN is allowed, the configuration is checked with an empty APN string, to allow for default configurations based on the IMSI prefix only. If nothing of this succeeded but the request wasn't rejected either, and there is no 'apn' configuration at all or if any APN is allowed but a default configuration ist not present, the GGSN with id 0 is used (if present). Otherwise the request is rejected ('missing APN'). Ticket: OW#1334 Sponsored-by: On-Waves ehf
2015-02-06sgsn: Add functions to handle APN contextsJacob Erlbeck1-0/+1
This commit adds the exported functions apn_ctx_find_alloc, apn_ctx_free, apn_ctx_by_name, and apn_ctx_match to manage and retrieve APN to GGSN mappings. The following VTY commands are added to 'config-sgsn': - apn APN ggsn <0-255> - apn APN imsi-prefix PREFIX ggsn <0-255> which maps an APN gateway string to an SGSN id. The SGSN must be configured in advance. When matching an APN string, entries with a leading '*' are used for suffix matching, otherwise an exact match is done. When a prefix is given, it is matched against the IMSI. If several entries match, a longer matching IMSI prefix has precedence. If there are several matching entries with the same PREFIX, the entry with longest matching APN is returned. Ticket: OW#1334 Sponsored-by: On-Waves ehf
2015-01-20gprs: Block other GSUP procedures during PURGE_MSJacob Erlbeck1-0/+1
GSM 09.02, mandates that no other MAP procedures shall be started until the PURGE_MS procedure has been completed. This patch implements this by adding corresponding state and checks to gprs_subscr_purge, gprs_subscr_location_update, and gprs_subscr_update_auth_info. If an Update Location or a Send Auth Info Req procedure is not started because of blocking, the retry mechanism is aborted to shorten the blocking time. The outstanding Purge MS procedure itself is not aborted. Sponsored-by: On-Waves ehf
2015-01-18sgsn/test: Add test that intercepts gprs_gsup_client_sendJacob Erlbeck1-0/+1
This test replaces gprs_gsup_client_send by a custom function, that emulates a GSUP remote peer by calling gprs_subscr_rx_gsup_message with responses for all requests. It then executes a full Attach/Detach cycle. Sponsored-by: On-Waves ehf
2015-01-18sgsn/test: Extend tests to simulate lost GSUP requestsJacob Erlbeck1-0/+1
This patch extends test_gmm_attach to optionally resend Attach Requests until the SGSN responds to it instead of calling OSMO_ASSERT at a few places. The test_gmm_attach_subscr_gsup_auth test optionally uses this feature. It is called once in either mode. Sponsored-by: On-Waves ehf
2015-01-18sgsn/test: Add GMM test for a GSUP based attach procedureJacob Erlbeck1-0/+1
This test calls test_gmm_attach() where the mocked subscriber functions insert GSUP messages instead of manipulating the subscriber structure directly. Sponsored-by: On-Waves ehf
2015-01-10gprs: Add subscriber functions to create/handle GSUP messagesJacob Erlbeck1-0/+1
This patch extends gprs_subscr_query_auth_info and gprs_subscr_location_update to create GSUP messages with the help of a static gprs_subscr_tx_gsup_message function. A corresponding gprs_subscr_rx_gsup_message is added which takes a messages, gets the subscr, and updates it accordingly. Sponsored-by: On-Waves ehf [hfreyther: Added a msgb_free gprs_subscr_tx_gsup_message]
2014-12-24sgsn: Add a subscriber based authentication phaseJacob Erlbeck1-0/+1
This implements the MAP way of subscriber validation when the MS tries to perform an Attach Request: 1. perform authentication (optionally invoke the sendAuthInfo procedure), starts the Auth & Ciph procedure 2. perform update location 3. insert subscriber data 4. finish the update location 5. Attach Accept / Attach Reject The authentication triplets are used and eventually updated if all of them have been used. This is currently accessible via the VTY interface by the following commands: - update-subscriber imsi IMSI update-auth-info - update-subscriber imsi IMSI update-location-result (ok|ERR-CAUSE) Sponsored-by: On-Waves ehf
2014-12-24sgsn: Add support for authentication tripletsJacob Erlbeck1-0/+1
This commit add data structures, functions, initialization, and VTY commands for per subscriber authentication triplets. The following VTY command is added: - update-subscriber imsi IMSI \ insert auth-triplet <1-5> sres SRES rand RAND kc KC Note that the triplets are not really used by the SGSN yet. Sponsored-by: On-Waves ehf
2014-12-10sgsn: Support subscriber based authenticationJacob Erlbeck1-0/+1
This commit mainly extends sgsn_auth.c to use and support the auth_state SGSN_AUTH_AUTHENTICATE. It will be activated when IMSI and IMEI are available, authentication is required (subscr->sgsn_data->authenticate is set), but the MM context is not marked as authenticated. If the state has been set to SGSN_AUTH_AUTHENTICATE and sgsn_auth_update() is called, the GMM layer will be informed by invoking gsm0408_gprs_authenticate(). Sponsored-by: On-Waves ehf
2014-12-09sgsn: Add gsm0408_gprs_access_cancelledJacob Erlbeck1-0/+1
This function is called to delete an established MM context silently without invoking a detach procedure. It is called when a subscriber is cancelled by the HLR. This generally happens, when an MS has moved to another routing area and has to use another SGSN. Sponsored-by: On-Waves ehf
2014-12-09sgsn: Integrate subscriber handling into the SGSNJacob Erlbeck1-1/+2
This commit adds a new authorization policy 'remote' and uses the subscriber cache for authorization when this policy is being used. Note that there is no remote backend implemented yet. After the IMSI/IMEI have been acquired, a request would be sent to the remote peer. The attach/auth-ciph procedure continues when authorization info has been received from the peer. This means, that gprs_subscr_update() must be called then to tell the GMM layer that it can proceed. A later commit will add VTY commands to do this manually. Sponsored-by: On-Waves ehf
2014-12-09sgsn: Add gprs_subscriber.cJacob Erlbeck1-0/+1
This patch adds GPRS specific functions for gsm_subscriber objects (allocation, retrieval, deletion) and subscriber data requests/updates. The sgsn_update_subscriber_data callback is used to notify the sgsn about updates and is extended by a parameter that passes a reference to a gsm_subscriber. Sponsored-by: On-Waves ehf
2014-12-02sgsn/test: Add test case for unexpected Detach AcceptsJacob Erlbeck1-0/+1
The commit "sgsn: Don't send XID reset after Detach Accept" fixed the SGSN to not respond to a Detach Accept message when there is no MM context. This patch adds a test case to verify, that there is really no message sent in that case. The test fails when the commit mentioned aboved is reverted. Sponsored-by: On-Waves ehf
2014-11-14sgsn: Don't assign a new P-TMSI if one is pendingJacob Erlbeck1-0/+4
Currently every time an RA Update Req or an Attach Req is processed, a new P-TMSI is allocated. When an MS issues another of these messages before it has completed the first procedure, old_ptmsi is replaced by ptmsi (and thus lost) and ptmsi is replaced by the newly allocated P-TMSI. This can confuse the gbproxy, which can loose track of the logical link then. At least a Blackberry emits a double set of RA Upd Req messages from time to time which may be just 20ms apart. This patch adds a check whether mm->ptmsi or mm->old_ptmsi are set. If both are set, the P-TMSI is not re-allocated. This is only the case, when the Complete message has not been received yet, since that message will reset old_ptmsi. Sponsored-by: On-Waves ehf
2014-11-14sgsn: Cleanup after RA Update Reject / Attach RejectJacob Erlbeck1-0/+6
Currently, the LLME is not cleaned up after sending an RA Update Reject. This happens after entering a routing area from outside, since in that case the SGSN sends an RA Update Reject (implicitly detached) which causes the MS to restart the attach procedure. The LLME is also not updated if an Attach Request with message errors (encoding, invalid MI type) is received or if an MM context cannot be allocated. This patch changes gsm48_rx_gmm_ra_upd_req and gsm48_rx_gmm_att_req to unassign the LLME or free the MM context (if available) after a Reject message has been sent. Ticket: OW#1324 Sponsored-by: On-Waves ehf
2014-11-11sgsn/test: Add test_gmm_attachJacob Erlbeck1-0/+1
This test checks the attach procedure until the Attach Complete is received. Note that authorization and GMM state updates are not working properly yet. Sponsored-by: On-Waves ehf
2014-11-05sgsn: Unassign the LLME after GMM Status without mmctxJacob Erlbeck1-0/+1
Currently the LLME is not deleted when a GMM Status message is received for which a mmctx cannot be found. This can fill the LLME list with unneeded entries. This patch adds code to unassign the LLME in that case. Ticket: OW#1324 Sponsored-by: On-Waves ehf
2014-10-27sgsn: Handle Detach Requests even when there is no mmctxJacob Erlbeck1-0/+1
Currently, when a Detach Request is received with an unknown TLLI, it is answered by another Detach Request (!), even when a power_off Type is used. This patch uses gsm48_rx_gmm_det_req to handle the message instead. So this function is changed to cope with a NULL mmctx. In that case it doesn't unassign the llme, so this must be done manually afterwards. Sponsored-by: On-Waves ehf
2014-10-27sgsn/test: Add test case for Detach Request (MO, power-off = 1)Jacob Erlbeck1-0/+1
Currently only a Detach Request (MO) message with power_off = 0 is checked. This commit adds a new test case with power_off set to 1. It also adds checks for the number of messages generated by the SGSN to verify that these messages are handled differently. Note that the handling of power_off isn't implemented yet. Therefore the corresponding assertion is being disabled yet. Sponsored-by: On-Waves ehf
2014-10-09sgsn: Add test that exposes a dangling pointer to the LLMEHolger Hans Peter Freyther1-0/+1
On detach the LLME get's unassigned (and hence destroyed) but the GMM context will still point to that dead structure.
2014-10-09sgsn: Create testcase that verifies that llmes get deletedHolger Hans Peter Freyther1-0/+2
On an "unassignment" this code verifies that the LLME will vanish from the list of LLMEs. We assume that this doesn't create a memory leak.
2014-10-09sgsn: Add boilerplate code for a SGSN testHolger Hans Peter Freyther1-0/+0