aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
AgeCommit message (Collapse)AuthorFilesLines
2014-12-28log: Set the context for paging requests as well.shared/31c3Holger Hans Peter Freyther2-0/+12
2014-12-28db: Begin with some indexes to speed up look-upsHolger Hans Peter Freyther1-0/+6
For MT-SMS we need to look-up a subscriber based on the extension and to find a undelivered SMS we need to search for the sent column to be NULL. Add two indexes to speed-up this operation.
2014-12-28lchan: Remember why a channel is broken using static stringsHolger Hans Peter Freyther5-9/+24
Remember why a channel is being marked as broken. So we can maybe understand what happend.
2014-12-25sms: Remove the text of delivered SMS when they are sentHolger Hans Peter Freyther1-1/+3
When a SMS is marked as sent, clear the paypload. We might want to know about connections and delivered sms but certainly not about the content.
2014-12-25rtp: Remove the "correction" of timestampsHolger Hans Peter Freyther1-21/+0
We tend to comment out this code every XXC3, let's just get rid off it. The nanoBTS has a rather odd timing behavior. Jacob has spent hours this summer to trial/document/fix it in the MGCP code and this code is not getting close to working around the ip.access audio issues. If someobody still wants to use the nanoBTS then he should help to have the MGCP MGW use/share code with the rtp_proxy.c
2014-12-25db: Extend the test to mark a SMS as delivered and verify itHolger Hans Peter Freyther1-0/+7
Mark the SMS as delivered, then free it and try to get an undelivered SMS to that subscriber again and make sure it is failing.
2014-12-24sgsn: Add a subscriber based authentication phaseJacob Erlbeck7-82/+311
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 Erlbeck6-1/+189
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-23sgsn: Be more tolerant with state and SUSPEND/RESUMEJacob Erlbeck1-2/+4
Currently, when a BSSGP SUSPEND is received and the corresponding MM context is already in the state GMM_REGISTERED_SUSPENDED, a SUSPEND_NACK is returned which is not covered by GSM 08.18, 7.4.1. The same goes for RESUME in the state GMM_REGISTERED_NORMAL. This commit changes gprs_gmm_rx_suspend and gprs_gmm_rx_resume to not complain (and thus answer a NACK) when the MM context is either in GMM_REGISTERED_SUSPENDED or GMM_REGISTERED_NORMAL. Note that GSM 08.18, 7.4.1 and 7.5.1 only mention to send an NACK if the MS is not known. Even with this patch, the SGSN returns a NACK if either the MS is unknown _or_ the MM context ist not in one of the state GMM_REGISTERED_SUSPENDED and GMM_REGISTERED_NORMAL. Sponsored-by: On-Waves ehf
2014-12-23sgsn: Log requested state change in sgsn_auth_updateJacob Erlbeck1-2/+5
Sponsored-by: On-Waves ehf
2014-12-23openbsc: Ignore generated coverage analysis filesJacob Erlbeck1-0/+2
This patch adds *.gcda and *.gcno to .gitignore to skip files that are generated by gcc --coverage and related tools. Sponsored-by: On-Waves ehf
2014-12-23gprs: Add gprs_shift_tlv functionJacob Erlbeck3-9/+42
This function is similar to gprs_match_tlv with the exception, that the tag is not compared but returned in *tag instead. Sponsored-by: On-Waves ehf
2014-12-23gprs: Move TLV parser functions to gprs_utils.c and rename themJacob Erlbeck7-381/+384
Currently the parser functions for single information elements are defined within gprs_gb_parse.c and not exported explicitely. In addition they are named like libosmocore's TLV parser functions and do not have a proper name prefix. Since it is planned to use them for other protocols, they need to be globally accessible. This patch moves them to gprs_utils.c and renames them. The new names are: lv_shift -> gprs_shift_lv v_fixed_shift -> gprs_shift_v_fixed lv_shift -> gprs_shift_lv v_fixed_shift -> gprs_shift_v_fixed In the long term, these functions should be moved to libosmocore (and renamed again). Sponsored-by: On-Waves ehf
2014-12-23sgsn: Add missing LF in log messageJacob Erlbeck1-1/+1
Sponsored-by: On-Waves ehf
2014-12-18ho: Copy the multirate config to the new lchanHolger Hans Peter Freyther1-0/+1
The new lchan will be in speech mode already but for AMR we will need to provide a working multirate config in the channel activation, otherwise the channel act might be nacked. Copy the config from the current lchan into the new lchan. The abis code simply added the mrconf if the speech mode was amr. Before this commit the invalidate mrconf with all zeroes was copied/sent.
2014-12-17ho: Make sure the timer is always stoppedHolger Hans Peter Freyther1-14/+16
In case of a ho_chan_activ_nack (sent due another bug inside both sysmobts and openbsc) the code would not stop the timer but free the datastructure. This can lead to a clear segfault when the timer has expired. Create a "free" function which is responsible to detach the handover structure, stop the timer (which is idempotent) and free the structure.
2014-12-17bts: When one link drops.. check what needs to be droppedHolger Hans Peter Freyther3-1/+18
In case a BTS is dropped, iterate over the list of BTS and check if a dependency is now missing and then drop the BTS. This check could lead to check of 256*256 checks (e.g. all BTS on each other in the chain and the master is being dropped). The performance aspect of it doesn't matter for our usecase. We expect to have pairs of BTS right now.
2014-12-17bts: Add some simple dependency between different BTSHolger Hans Peter Freyther5-0/+136
E.g. for the sysmoBTS2050 we have the requirement that the first board connects before the second due clocking. The easiest point to enforce this is the BSC. Add a simple bitmask based system to allow to express dependencies for IP based systems.
2014-12-10bts: Remove unused fields from the trx structureHolger Hans Peter Freyther1-10/+0
These have either never been used or were replaced with a more generic approach.
2014-12-10sgsn: Support subscriber based authenticationJacob Erlbeck5-5/+70
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-10sgsn: Integrate Auth & Ciph into gsm48_gmm_authorizeJacob Erlbeck3-1/+29
Currently the Authentication and Ciphering procedure is not yet invoked by the GMM layer. This patch starts this procedure from within gsm48_gmm_authorize when the mm->auth_state has been set to SGSN_AUTH_AUTHENTICATE and a call to gsm0408_gprs_authenticate has been issued directly or indirectly by the call to sgsn_auth_request. Sponsored-by: On-Waves ehf
2014-12-10sgsn: Do not 'commit' implicitely when executing 'insert'Jacob Erlbeck1-2/+0
Currently the gprs_subscr_update function is called when the 'update-subscriber ... insert ...' command is executed. This will eventually notify the GMM layer which is rather the purpose of the 'commit' command. This patch removes the call from update_subscr_insert. Sponsored-by: On-Waves ehf
2014-12-09nat: Fix copy and paste in the test codeHolger Hans Peter Freyther1-2/+2
The test didn't test that the access-list has been properly removed. Fix the test to only remove the list once and verify that it is gone.
2014-12-09sgsn: Put SGSN related subscriber data into separate structJacob Erlbeck4-12/+26
There will be an increasing number of SGSN related fields per subscriber. Instead of extending gsm_subscriber accordingly, a single struct sgsn_subscriber_data object is assigned to it. The talloc context used to allocated that object is the subscr object itself. Therefore it will be freed automatically along with the subscr object. Sponsored-by: On-Waves ehf
2014-12-09sgsn: Add VTY commands to manage subscriber cacheJacob Erlbeck2-0/+159
This adds the following commands to the ENABLE node: - show subscriber cache - update-subscriber imsi IMSI insert authorized (0|1) - update-subscriber imsi IMSI cancel - update-subscriber imsi IMSI commit These commands are mainly testing tools and maintenance helpers. The update commands work asynchronously and can be used to complete a pending update request or to terminate an existing connection. The 'insert' command just update the subscriber records but does not notify the GMM layer. Invoke the 'commit' command to continue with pending procedures. Note that the subscriber cache is not stored persistently and will always be empty after an SGSN restart. Sponsored-by: On-Waves ehf
2014-12-09sgsn: Add gsm0408_gprs_access_cancelledJacob Erlbeck5-1/+150
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 Erlbeck8-13/+120
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 Erlbeck9-7/+267
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-09msc: Add per subscriber keep_in_ram flagJacob Erlbeck3-1/+22
Currently the keep_subscr flag in gsm_subscriber_group refers to a whole group of subscribers which makes it difficult to really delete single entries if the flag is set. This patch adds a keep_in_ram field to gsm_subscriber which allows for keeping subscriber objects in RAM while deleting others. Note that really deleting an entry requires that both flags (subscr_group->keep_subscr and subscr->keep_in_ram) are set to 0. So only the latter should be used if a specification requires the deletion of a subscriber entry. Sponsored-by: On-Waves ehf
2014-12-09sgsn: Remove warningsJacob Erlbeck1-3/+0
Remove warnings related to the SGSN specific code. Sponsored-by: On-Waves ehf
2014-12-09msc: Add net parameter to trans_allocJacob Erlbeck4-7/+11
The trans_alloc function still uses the subscr object to access the network object. This patch adds an explicit net parameter to this function and removes the access to subscr to obtain it. Sponsored-by: On-Waves ehf
2014-12-08sgsn: Do authentication based on SRES valuesJacob Erlbeck2-2/+33
Currently the SRES value in the Auth & Ciph Response is ignored. This patch checks the SRES value in response against the value stored in mm->auth_triplet.sres. If they don't match, an Auth & Ciph Reject message is sent to the MS. If they match, the mm->is_authenticated flag is set. Note that the procedure will not be started yet. Sponsored-by: On-Waves ehf
2014-12-08sgsn: Change Auth&Ciph timer handlingJacob Erlbeck3-6/+18
Currently mmctx_timer_start is called from within gsm48_tx_gmm_auth_ciph_req which differs from the way e.g. the identification procedure is implemented. It also makes it more difficult to restart the procedure after timeout, which is not implemented yet. In addition, the timer is not properly stopped when an AUTH & CIPH response is received. This patch removes this timer start from gsm48_tx_gmm_auth_ciph_req, adds the retransmission of Auth & Ciph requests to the timer callback function, and properly stops the timer in gsm48_rx_gmm_auth_ciph_resp. Sponsored-by: On-Waves ehf
2014-12-08sgsn: Fix and enable auth/ciph message generationJacob Erlbeck1-5/+2
Currently gsm48_tx_gmm_auth_ciph_req/_rej are commented out. In addition, gsm48_tx_gmm_auth_ciph_req uses a wrong encoding (two byte TV instead of two nibbles TV) of the CKSN information element. This patch fixes the encoding of the CKSN IE and enables the functions mentioned above. Sponsored-by: On-Waves ehf
2014-12-05bsc/test: Add tests for gsm_subscriber baseJacob Erlbeck7-1/+134
This commit adds test for the generic part of gsm_subscriber like reference counting and flag usage. Sponsored-by: On-Waves ehf
2014-12-05msc: Add and use gsm_subscriber_groupJacob Erlbeck24-93/+128
Currently every subcriber object directly refers to the gsm_network which contains a flag shared by every related subscriber (keep_subscr). This adds a dependency on gsm_network even if only the function defined in gsm_subscriber_base.c are used. This patch adds a new struct gsm_subscriber_group which contains the keep_subscr flag and a back reference to the network object. The latter is not dereferenced in gsm_subscriber_base.c, so it can safely be set to NULL when only that part of the gsm_subscriber API is being used. It also changes that API to use gsm_subscriber_group instead of gsm_network parameters. Since there are some places where a pointer to the gsm_network is needed but where only a gsm_subscriber is available, a 'net' back pointer is added to the group struct, too. Nevertheless subscr group and network could be separated completely, but this is not the topic of this commit. Sponsored-by: On-Waves ehf
2014-12-05msc: Don't use the subscriber to access the net objectJacob Erlbeck4-13/+13
Sponsored-by: On-Waves ehf
2014-12-05msc: Add net back pointer to gsm_transJacob Erlbeck3-33/+38
Currently the net pointer is obtained from trans->subscr->net. On the other hand, the list gsm_trans object is managed by the net object. This patch adds the back pointer to the structure and replaces all trans->subscr->net by trans->net expressions. In trans_alloc() the trans->net pointer is obtained from the subscr object. Sponsored-by: On-Waves ehf
2014-12-05ctrl: Allow to query if the OML link is connected or notHolger Hans Peter Freyther2-0/+38
Related: SYS#798
2014-12-05ctrl: Add command to get the current load of a BTSHolger Hans Peter Freyther2-0/+63
Add a command and test to see the current channel load and available channels per BTS. Related: SYS#798
2014-12-02sgsn/test: Add test case for unexpected Detach AcceptsJacob Erlbeck2-0/+36
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-12-02sgsn/test: Don't rely on the actual PRNG sequenceJacob Erlbeck1-1/+9
Currently the expected P-TMSI generated by the SGSN is hard-coded into the test. This adds a dependency on the implementation of rand() and thus the libc used. This breaks the test e.g. on FreeBSD. This patch modifies test_gmm_attach() to srand(1) first, generate the P-TMSI, and finally srand(1) again before starting the test. Sponsored-by: On-Waves ehf
2014-12-02gbproxy: Reset TLLIs when the link_info is found by IMSI/P-TMSIJacob Erlbeck3-21/+29
Currently when the MS does a re-attach without doing a proper detach first, the gbproxy uses the old local TLLI if patching and the keep mode are enabled. This leads to a failing attachment procedure when TLLI patching is also enabled. This patch changes gbproxy_update_link_state_ul to reset all TLLIs within the link_info if the message contains an unknown TLLI and an MI. This is generally the case with Attach Request messages. The gbproxy_get_link_info_ul gets an additional tlli_is_valid output parameter that is set, when a TLLI was present and found. This flag is then used instead of checking tlli.current == 0 to set TLLI/P-TMSI e.g. Attach Requests when a link_info was already present for the P-TMSI/IMSI used in such a request. Ticket: OW#1324 Sponsored-by: On-Waves ehf
2014-11-21bsc: Add ctrl command to set the TRX ARFCNHolger Hans Peter Freyther2-0/+23
2014-11-21bsc: Allow to generate new system information onlineHolger Hans Peter Freyther4-2/+49
Increase the bcch_change_mark and generate a new copy of the system information. Make the method public, add a small test case. Manually verified using the FakeBTS. I don't know if the MS will re-read these SIs. Related: SYS#739
2014-11-21bts: Store the bcch_change_mark in the bts structureHolger Hans Peter Freyther3-1/+8
Store the BCCH change mark inside the BTS structure. This will allow us increment the number and re-generate the SIs. Related: SYS#739
2014-11-21bsc: Allow to set the call-identityHolger Hans Peter Freyther2-0/+22
Allow to set the cell-identity through the control interface and add a small test for it. Related: SYS#739
2014-11-21bsc: Allow to apply configuration for an individual BTSHolger Hans Peter Freyther2-2/+39
This will drop a specific IP based BTS. It will lead to a re-connect of the BTS and the new settings will be applied then. Fixes: SYS#737
2014-11-20mgcp/sdp: Session name must not be empty pick an empty oneHolger Hans Peter Freyther2-0/+8
The session name must be present in a SDP file. The RFC proposes to use a space for it but the other equipment is using the dash so I have picked that as well. RFC 4566: The "s=" field is the textual session name. There MUST be one and only one "s=" field per session description. The "s=" field MUST NOT be empty and SHOULD contain ISO 10646 characters (but see also the "a=charset" attribute). If a session has no meaningful name, the alue "s= " SHOULD be used (i.e., a single space as the session name). Fixes: RT#2196
2014-11-19mgcp: Allow to omit sending the audio name at allHolger Hans Peter Freyther6-1/+121
Equipment like AudioCode appears to get upset when we use a builtin type and then assign a name to it. Allow to completely omit the name.