aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
AgeCommit message (Collapse)AuthorFilesLines
2014-08-24gbproxy: Parse Detach Request messagesJacob Erlbeck3-44/+75
GSM 24.008 also allows a P-TMSI field in Detach request messages. This patch adds gbprox_parse_gmm_detach_req() to parse Detach Request messages which sets the ptmsi field if the IE is present. In addition, when power_off is set to 1 (MO only), the invalidate_tlli field is set, since Detach Request message is expected in this case. The second detach test (see 'RA update') is modified to use power_off instead of relying on a Detach Accept from the network. To make this work, the PTMSI of the RA Update Accept is fixed to match the TLLI of the Detach Request. Sponsored-by: On-Waves ehf
2014-08-24move gsm_bts_num() to gsm_data_shared.[ch]Harald Welte4-18/+17
this way we can drop a copy of this function from osmo-bts.
2014-08-22misc: Introduce a more neutral configure option for CTRL/VTYHolger Hans Peter Freyther2-10/+15
We started with only testing the VTY but now test VTY and CTRL interface with this python framework and might even extend this to SMPP. So add and "--enable-external-tests" directive which enables the external interface tests.
2014-08-22gbproxy: Add gbprox_clear_patch_filter() (Coverity)Jacob Erlbeck4-6/+18
Add a separate function to clear the IMSI filter to be used instead of gbprox_set_patch_filter(cfg, NULL, ...). Albeit it fixes a Coverity issue (Unchecked return value), it is a false positive, since the return value is always 0 in these cases. Nevertheless it is more obvious what happens when an explicit clear function is called. Using NULL as filter argument of gbprox_set_patch_filter still clears the filter. Fixes: Coverity CID 1231255 Sponsored-by: On-Waves ehf
2014-08-21fix missing '\' at end of line in Makefile.amHarald Welte1-1/+1
... causing header files to be missing from 'make dist'. this was introduced in ba874b82be0ad1752b46009ba403f9b7bf24492d
2014-08-21Fix bsc_ctrl_node_lookup after libctrl changesHarald Welte1-3/+5
As bsc_ctrl_node_lookup() is called for each iteration, the variables 'bts' and 'trx' are no longer static accross multiple calls, which means we need a different way to determine if we are in the right node while matching for a trx or a ts.
2014-08-21configure.ac: Depend on libosmocore 0.7.0Harald Welte1-2/+2
2014-08-21libctrl: Follow rename of controlif_setup -> ctrl_interface_setupHarald Welte2-2/+2
2014-08-21libctrl: Move bulk of node lookup code into libosmocoreHarald Welte3-184/+5
Now that the bulk of the control interface node lookup has no reference to the BSC specific data structures, we are moving it into libosmocore. A control interface user now only registers an optional small node lookup function like bsc_ctrl_node_lookup()
2014-08-21ctrl_if: Split bsc_ctrl_cmd_handle() in two partsHarald Welte1-50/+81
The idea here is that bsc_ctrl_cmd_handle now has no dependency at all to the BSC related data structures and thus can actually become part of libctrl. The new function bsc_ctrl_node_lookup however will remain bsc-specific.
2014-08-21move libctrl from openbsc to libosmoctrl (libosmocore.git)Harald Welte29-1331/+49
2014-08-21systemd: Add Install section to service filesDaniel Willmann4-0/+12
That way the services can be enabled with > systemctl enable <service>
2014-08-21Fix control interface build after IPA rename/migrationHarald Welte1-2/+3
2014-08-20adopt recent IPA related symbol renameHarald Welte8-20/+27
... which happened during recent migration of IPA functionality from libosmo-abis into libosmocore.
2014-08-18ipaccess-proxy: avoid namespace collision with libosmo-abisHarald Welte2-17/+17
2014-08-13gbproxy: Fix warnings (signed/unsigned)Jacob Erlbeck1-6/+6
Adresses: gbproxy_test.c:1288:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Sponsored-by: On-Waves ehf
2014-08-13gbproxy: Pass tlli_info aroundJacob Erlbeck3-30/+76
This patch modifies the code to pass a pointer to the tlli_info around once it has been acquired. To achieve this, gbprox_register_tlli() and gbprox_update_state() are modified to return it (if it has been found or created), and gbprox_patch_llc(), gbprox_patch_bssgp(), and gbprox_update_state_after() are modified to take it as parameter. Add a new function gbprox_touch_tlli() to update timestamp and list ordering for existing tlli_infos. The motivation behind this patch is to make the tlli_info available to the patching code and to avoid repeated searches for the same TLLI. Sponsored-by: On-Waves ehf
2014-08-13gbproxy: Optimize gbprox_remove_stale_tllisJacob Erlbeck1-15/+33
The current implementation of this function is O(N), where N is the number of entries. The new implementation is O(D), where D is the number of entries that are going to be deleted. Sponsored-by: On-Waves ehf
2014-08-13gbproxy/test: More TLLI expiry testingJacob Erlbeck2-6/+66
This patch adds a combined expiry test to remove one entry by list length and another by age. This patch also modifies the existing age based test to register both TLLI with a different timestamp and to remove only one of the TLLI entries by age based expiration. Sponsored-by: On-Waves ehf
2014-08-13gbproxy: Don't call time() in TLLI related functionsJacob Erlbeck3-59/+58
Currently time() is called at several places to control TLLI aging. Beside calling time() more often than necessary, the decision which timesource is to be used is coded into the TLLI handling, and testing complex aging scenarios is cumbersome. This patch passes the current time as a parameter instead. The call to time() is moved to gbprox_process_bssgp_message(). Sponsored-by: On-Waves ehf
2014-08-13gbproxy: Don't remove stale TLLI automaticallyJacob Erlbeck3-18/+24
This patches removes the call to gbprox_remove_stale_tllis() from gbprox_register_tlli(), so it must be called explicitly now. The call is now done from within gbprox_update_state_after(). In addition, the TLLI cache size counter is also kept in sync when gbprox_remove_stale_tllis is called manually. The call to gbproxy_peer_free() in gbproxy_peer_free() is moved behind the TLLI to allow for counter updates in gbprox_delete_tlli(). Sponsored-by: On-Waves ehf
2014-08-13gbproxy: Move parse_ctx logging into separate functionJacob Erlbeck1-30/+50
Sponsored-by: On-Waves ehf
2014-08-13gbproxy: Refactor gbproxy_patch_bssgp_messageJacob Erlbeck1-56/+81
This patch refactors that function by separating the actual patch code into a new function gbproxy_patch_bssgp(), similar to gbproxy_patch_llc(). The remaining function is renamed to gbproxy_process_bssgp_message. The existing function gbproxy_parse_bssgp_message() is renamed to gbproxy_process_bssgp_message to match gbproxy_parse_llc. Sponsored-by: On-Waves ehf
2014-08-13gbproxy: Test and fix IMSI/TMSI matchingJacob Erlbeck4-6/+84
This adds a test for gbprox_set_patch_filter() and gbprox_check_imsi(). It also fixes the masking of the type field when IMSIs are checked by using GSM_MI_TYPE_MASK (0x07) instead of 0x0f. Sponsored-by: On-Waves ehf
2014-08-13gbproxy: Track TLLI even when the IMSI is not knownJacob Erlbeck5-48/+86
Currently only TLLIs for which it is known that they may be patched are put into the TLLI list. This patch changes this to add TLLIs even when the IMSI is not yet known. A enable_patching flag is added to the gbproxy_tlli_info structure to control patching. Note that this puts every active TLLI into the list where accesses are O(N) currently. Sponsored-by: On-Waves ehf
2014-08-13gbproxy: Make pointers to MI const in parse/check functionsJacob Erlbeck1-3/+5
The encoded mobile identity will never be modified in is_mi_tmsi/is_mi_imsi/parse_mi_tmsi, thus the pointer is made const. Sponsored-by: On-Waves ehf
2014-08-13gbproxy: Explicitly convert PTMSI to TLLIJacob Erlbeck1-3/+6
This patch modifies the new_ptmsi handling by setting its two most significant bits before using it as TLLI. Sponsored-by: On-Waves ehf
2014-08-13gbproxy: Parse additional IMSI/PTMSI/TLLI fieldsJacob Erlbeck3-14/+121
This adds parsing support for the following messages: - Attach Request: IMSI/PTMSI - Identity Response: IMSI/PTMSI - BSSGP: Optional TLLI IE - BSSGP/PAGING_PS: PTMSI A new new_ptmsi_enc field is added for newly assigned PTMSI in SGSN->BSS messages (instead of ptmsi_enc). The ptmsi_enc field is now used for informational PTMSI IE in messages. Sponsored-by: On-Waves ehf
2014-08-12gbproxy: Separate BSSGP parsing from patchingJacob Erlbeck1-123/+183
This adds a gbprox_parse_bssgp_message() function that contains the parsing part of the former gbprox_patch_bssgp_message(). This includes a call to gbprox_parse_llc(). The calls to gbprox_patch_llc(), gbprox_update_state() and gbprox_update_state_after() have therefore been moved to gbprox_patch_bssgp_message(). Sponsored-by: On-Waves ehf
2014-08-12gbproxy: Unify TLLI trackingJacob Erlbeck1-76/+121
This patch unifies the TLLI tracking for all LLC messages. The TLLI state handling is moved into separate functions. Only Detach Accept messages are taken into account to release a TLLI, which is safe but not optimal. Sponsored-by: On-Waves ehf
2014-08-12gbproxy: Move patching code out of the 04.08 specific functionsJacob Erlbeck1-94/+133
Currently, parsing and optionally patching is done in the same functions (e.g. gbprox_patch_gmm_attach_req()). This patch moves the patching code out of these functions into gbprox_patch_llc() and just stores pointers to the relevant data areas into parse_ctx. Consequently the len_change parameter is removed and the _patch_ in the function's names is renamed to _parse_. In addition, the patching_is_enabled checks and counter increments are moved out of these functions, too. Sponsored-by: On-Waves ehf
2014-08-09sysmobts: Add variable for N(S) + 1 needed for the sysmobtsHolger Hans Peter Freyther1-0/+1
We could use the upper three bits of the ciph_state to store the sequence number but make the code understandable first.
2014-08-08bsc: Add a ctrl command to send a ussdNotify for a callHolger Hans Peter Freyther5-4/+89
Send a non-call related SS message for an active call indentified by the CIC of that call. As an ugly hack the order of the SS release and the invocation are changed. That was necessary for the E71 on a TCH. The time between notify and release was just too short. The right would be to wait for the returnResultLast but this would involve keeping more local state. Let's see how far we get here. It might be necessary to change the order in the other call sites as well.
2014-08-08ctrl: Allow the value to contain spaces. No need to split the stringHolger Hans Peter Freyther1-1/+1
2014-08-08gbproxy/test: Fix BSSGP RESET message sizeJacob Erlbeck2-92/+92
The given msg array size doesn't match the initializer's size. Sponsored-by: On-Waves ehf
2014-08-08gbproxy: Track all TLLIs (not only LOCAL)Jacob Erlbeck1-5/+0
This patch removes all checks for the TLLI type. Sponsored-by: On-Waves ehf
2014-08-05sgsn: Make P-TMSI a local TLLI to avoid clashHolger Hans Peter Freyther1-1/+1
Some broken equipment does not convert the P-TMSI to a Local TLLI. This leads to the SGSN ignoring the GPRS Attach Complete message from the phone. Proprietary SGSNs and some documentation we found state that one should always set the two highest bits of a P-TMSI to one. This will help broken equipment and will avoid a potential P-TMSI/TLLI clash. The P-TMSI/Local TLLI mapping is now bijective.
2014-08-05gprs: Refactor gbprox_register_tlli()Jacob Erlbeck1-32/+54
Currently gbprox_register_tlli() is a rather complex function. This patch splits it into several smaller functions to ease reviewing and maintaining it. Sponsored-by: On-Waves ehf
2014-08-05gbproxy/test: Test TLLI expiryHolger Hans Peter Freyther4-39/+237
This adds a unit test for gbprox_register_tlli() and gbprox_remove_stale_tllis(). The dump_peers() function is extended by a cfg parameter to support a non-global gbproxy_config. Done with Jacob
2014-08-04gbproxy: Remove broken TLLI comparisonJacob Erlbeck1-1/+0
This comparison bit-ored the TLLI with 0xc000 instead of 0xc000000. Since this has never worked properly yet and since normalizing to local TLLIs doesn't seem sensible here, the comparison is removed entirely. Sponsored-by: On-Waves ehf
2014-08-04gbproxy: Kill the global gbprox_global_patch_state structHolger Hans Peter Freyther4-22/+25
Move this patching state into the gbproxy_config as well. Done by Jacob
2014-08-04gbproxy: Add a hint to the compiler that all parameters are not NULLHolger Hans Peter Freyther1-0/+8
In these functions we assume that peer is not NULL. Add a compiler attribute in the hope that either coverity or GCC/Clang will help us to find a misusage. Done with Jacob
2014-08-04gbproxy: Remove global state from the gbproxyHolger Hans Peter Freyther5-134/+143
Global state prevents us from writing simple units tests for single routines. Go through the code and add pointers to the gbproxy configuration. Only the vty and the test code remain using the global gbproxy instance.
2014-08-04gprs: The methods moved to gprs_utils.h remove them hereHolger Hans Peter Freyther1-3/+0
Stop declaring the apn routines in here. Done with Jacob
2014-08-04gprs: Add testcases for the APN string/octet conversion and fix itHolger Hans Peter Freyther6-9/+119
Create a testcase for the gprs_str_to_apn and gprs_apn_to_str routines. While writing the testcase we noticed it is possible to write more bytes than should have been allowed. This is fixed by checking that the max_len is at least 1 (needed to write the first length octet) and to do the size check before writing to the output. Modify the signature of gprs_str_to_apn to put the length/size next to the parameter that requires a size. Done with Jacob
2014-08-04gbproxy: Use gbprox_delete_tlli if possibleHolger Hans Peter Freyther1-8/+4
Make use of the delete routine in more places and get test coverage for it. Done with Jacob
2014-08-04gprs: Create a gprs_utils file and move to be shared code in thereHolger Hans Peter Freyther8-136/+201
We intend to move some of these routines to libosmocore but to avoid a feature symbol clash we are prefixing these routines with gprs_. Done with Jacob
2014-08-04gbproxy: Use gbproxy_ for all structuresHolger Hans Peter Freyther4-97/+97
The application is called gbproxy but the structures and functions were inconsistently named as either gbprox or gbproxy. Rename all structures to use gbproxy. Done with Jacob
2014-08-04gbproxy: The dump routines are only used by the test, move it thereHolger Hans Peter Freyther3-130/+129
Done with Jacob
2014-08-04gbproxy: Have a clear namespace for the public functionsHolger Hans Peter Freyther3-7/+6
Done with Jacob