aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2014-08-28nitb: Add a test command to generate IMM.ASS.REJ messagezecke/hacks/stress-testingJacob Erlbeck2-5/+42
Add a VTY command to send up to 1000 IMM.ASS.REJ messages to a BTS. This can be used to check the AGCH queue handling. Sponsored-by: On-Waves ehf
2014-08-28nitb: Add a test command for stress testing all BTSsHolger Hans Peter Freyther1-0/+31
Add a VTY command that will attempt to all allocate all lchans that can provide a SDCCH. This can be used to stress-test a BTS and the radio link timeout and activation/release of it.
2014-08-25gprs: Attempt to fix distcheck by adding the header fileHolger Hans Peter Freyther1-1/+2
Due libdbi 0.9.x being broken I didn't run make distcheck and apparently Jacob has a similar issue and didn't run it either.
2014-08-25port over to libosmocore include/osmocom/gsm/meas_rep.hHarald Welte2-29/+4
Back in March 2013, some structures and defines related to decoded measurement reports have been moved from openbsc to libosmocore (libosmocore e128f4663104ed64e33e362cff2566f36d65e658) so that they can be used also from osmo-bts. This finally makes gsm_lchan follow suit for osmo-bts.
2014-08-25gprs: Link gbproxy to -lrt for clock_gettimeHolger Hans Peter Freyther1-1/+1
On older GNU libc systems we need to link to this library to use the clock_gettime symbol.
2014-08-24Use port number #defines for VTY and CTRL portsHarald Welte8-10/+18
.. as defined in libosmocore
2014-08-24move GSM_RESERVED_TMSI to libosmocoreHarald Welte4-6/+4
The gb_proxy shouldn't start to open the box of pandora by including the gsm_data_shared.h file, particularly not without defining the BSC role. In any case, as the reserved TMSI is something that's part of the GSM specs, and not specific to the OpenBSC implementation, it should be part of libosmocore.
2014-08-24gsm_data_shared: Add new trx_power_params for osmo-btsHarald Welte1-0/+1
2014-08-24Merge Jacob's GPRS GB Proxy related configsHolger Hans Peter Freyther14-1758/+3394
All review feedback will be addressed _after_ the split of the files. This is the only reasonable approach to get the split of files merged. I didn't have the time to review all of the code before the point of splitting.
2014-08-24gbproxy: Move peer definitions to gb_proxy_peer.cJacob Erlbeck7-188/+241
This patch moves the peer related definitions from gb_proxy.c to gb_proxy_peer.c and adjusts the prefix of each global symbol to gbproxy_: Peer definitions (prefix adjusted to gbproxy_): peer_ctr_description -> gprs/gb_proxy_peer.c (static) peer_ctrg_desc -> gprs/gb_proxy_peer.c (static) *peer_by_* -> gprs/gb_proxy_peer.c gbproxy_peer_alloc -> gprs/gb_proxy_peer.c gbproxy_peer_free -> gprs/gb_proxy_peer.c gbprox_cleanup_peers -> gprs/gb_proxy_peer.c Sponsored-by: On-Waves ehf
2014-08-24gbproxy: Refactor gb_proxy.c into several filesJacob Erlbeck12-1825/+1976
This patch moves several functions and declarations out of gb_proxy.c to make them reusable by other components and to separate them by context and task. Counter enums (prefix is changed to gbproxy_): enum gbprox_global_ctr -> gprs/gb_proxy.h enum gbprox_peer_ctr -> gprs/gb_proxy.h Generic Gb parsing (prefix is changed to gprs_gb_): struct gbproxy_parse_context -> openbsc/gprs_gb_parse.h gbprox_parse_dtap() -> gprs/gprs_gb_parse.c gbprox_parse_llc() -> gprs/gprs_gb_parse.c gbprox_parse_bssgp() -> gprs/gprs_gb_parse.c gbprox_log_parse_context() -> gprs/gprs_gb_parse.c *_shift(), *_match() -> gprs/gprs_gb_parse.c (no prefix) gbprox_parse_gmm_* -> gprs/gprs_gb_parse.c (static) gbprox_parse_gsm_* -> gprs/gprs_gb_parse.c (static) MI testing/parsing (prefix gprs_ added): is_mi_tmsi() -> gprs/gprs_utils.c is_mi_imsi() -> gprs/gprs_utils.c parse_mi_tmsi() -> gprs/gprs_utils.c TLLI state handling (prefix is changed to gbproxy_): gbprox_*tlli* -> gprs/gb_proxy_tlli.c (except gbprox_patch_tlli, gbproxy_make_sgsn_tlli) Message patching (prefix is changed to gbproxy_): gbprox_*patch* -> gprs/gb_proxy_patch.c gbprox_check_imsi -> gprs/gb_proxy_patch.c Sponsored-by: On-Waves ehf
2014-08-24gbproxy/test: Add test for TLLI patchingJacob Erlbeck2-0/+616
Add LLC test messages containing XID (SAPI LLGMM, U frame) and IP traffic (SAPI LL11, UI frame). Add a test case containing a complete SGSN session with TLLI/PTMSI patching enabled. Sponsored-by: On-Waves ehf
2014-08-24gbproxy: Use different TLLI/P-TMSI for BSS and SGSNJacob Erlbeck2-2/+53
This patch modifies gbprox_make_bss_ptmsi() to generate a new P-TMSI when patch_ptmsi is set in the configuration instead of using the P-TMSI assigned by the SGSN. It modifies gbprox_make_sgsn_tlli() to either use a foreign TLLI based on the SGSN side P-TMSI or (if there is none) generate a random TLLI if patch_ptmsi is set. Otherwise, the TLLI used by the BSS is used. The seeds for the pseudo-random sequences sre set based on time initially. Note that these are neither cryptographically safe nor protected against collisions. Ticket: OW#1259 Sponsored-by: On-Waves ehf
2014-08-24gbproxy: Add context info to log messagesJacob Erlbeck1-3/+9
This mainly adds the NSEI to the messages, similar to log messages ogf the existing gbproxy code. Sponsored-by: On-Waves ehf
2014-08-24gbproxy: Patch TLLI/P-TMSIJacob Erlbeck1-0/+123
This patch adds code to modify TLLIs and P-TMSIs. Related counters are also added. Sponsored-by: On-Waves ehf
2014-08-24gbproxy: Fix TLLI state handlingJacob Erlbeck1-19/+44
This patch contains fixes for the TLLI tracking and handling. It adds and uses gbprox_map_tlli() the map the source TLLI to the destination TLLI while respecting whether it is current or assigned. It removes gbprox_register_tlli() from the downlink path. It fixes TLLI validation and disables the use of the BSSGP TLLI IE. Sponsored-by: On-Waves ehf
2014-08-24gbproxy: Also handle LLC non UI and LL11 messagesJacob Erlbeck1-3/+3
Currently, these messages lead to a parsing error which prevents them from being processed any further. This patch sets the return value of gbprox_parse_llc to 1 in these cases and fixes a segfault which is triggered by any non-04.08 message. Sponsored-by: On-Waves ehf
2014-08-24gbproxy: Refactor gbprox_patch_raid(), use different RAI types properlyJacob Erlbeck1-31/+85
Currently gbprox_patch_raid() updates the local MCC/MNC with every BSS originated message, even if the RAI is an 'old' one. This patch separates state updating and patching into 2 functions gbprox_update_current_raid and gbprox_patch_raid. In addition, a field named old_raid_enc is added to gbproxy_parse_context, which is used for 'old RAI' IEs in Attach Requests and RA Update Requests. Only the bssg_raid_enc in BSS originated message is used to update the BSS side 'local' MCC/MNC. Sponsored-by: On-Waves ehf
2014-08-24gbproxy: Refactor gbprox_get_detached_tlli_infoJacob Erlbeck1-19/+27
This patch splits the functionality of gbprox_get_detached_tlli_info into 2 new functions: - gbprox_tlli_info_alloc to allocate an intialized and detached tlli_info - gbprox_detach_tlli_info to detach an already attached tlli_info Sponsored-by: On-Waves ehf
2014-08-24gbproxy: Add 'patch-ptmsi' command to enable TLLI/P-TMSI patchingJacob Erlbeck1-0/+29
This VTY command add the following commands to the gbproxy node: - patch-ptmsi: Enables P-TMSI/TLLI patching - no patch-ptmsi: Disables P-TMSI/TLLI patching Note that using these commands interactively can load to undefined behavior of existing LLC connections. Sponsored-by: On-Waves ehf
2014-08-24gbproxy: Track SGSN and BSS TLLI/PTMSI separatelyJacob Erlbeck5-99/+327
This patch separates BSS side from SGSN side TLLI/PTMSI tracking. When TLLI/PTMSI patching is not enabled, the corresponding states shall be identical. The TLLI/PTMSI state has been moved into the struct gbproxy_tlli_state and is used twice in gbproxy_tlli_info. Since the state handling for uplink and downlink messages is diverging, gbprox_update_state() is replaced by two functions gbprox_update_state_dl/gbprox_update_state_ul and gbprox_process_bssgp_message() is replaced by gbprox_process_bssgp_dl/gbprox_process_bssgp_ul. Sponsored-by: On-Waves ehf
2014-08-24gbproxy/test: Generate BSSGP and LLC layer for DTAP messagesJacob Erlbeck1-150/+299
This patch adds the functions send_bssgp_ul_unitdata(), send_bssgp_dl_unitdata(), send_llc_ul_ui(), and send_llc_dl_ui(). They are used instead of send_ns_unitdata() in test_gbproxy_ra_patching(). This make it easier to modify TLLI, N(U), and other parameters. Sponsored-by: On-Waves ehf
2014-08-24gbproxy/test: Fix BSSGP/LLC test messagesJacob Erlbeck2-26/+25
The following parts of the messages have been fixed - Attach Accept: checksum - Attach Complete: checksum - RA Update Accept: Use the same MS Radio Access Capabilities and DRX Parameters like the other messages The N(U) of most messages have not been fixed. Sponsored-by: On-Waves ehf
2014-08-24gbproxy: Handle old and new P-TMSI/TLLIJacob Erlbeck4-19/+124
Don't replace the current TLLI immediately, store it in an additional 'assigned_tlli' field and discard the old TLLI when both sides have used the new one (see GSM 04.08, 4.7.1.5). Add an Attach Complete message to test and check, whether the related field of the corresponding tlli_info struct are set as expected during the local TLLI validation cycle. Sponsored-by: On-Waves ehf
2014-08-24gbproxy: Update enable_patching flag on existing tlli_infoJacob Erlbeck2-8/+16
Currently the enable_patching field in tlli_info is not updated, when an IMSI is assigned to a TLLI that is already known. This patch fixes this in gbprox_update_state() after the call to gbprox_update_tlli_info(). The number of APN increases and the test output file is updated accordingly. Sponsored-by: On-Waves ehf
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