aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src
AgeCommit message (Collapse)AuthorFilesLines
2016-04-29Fix comment typoMax1-1/+1
2016-04-23Add missing includeMax1-0/+1
2016-04-22Add extra debug output with channel mode and typeMax4-9/+27
This provides helpful information for debugging internal MNCC handler.
2016-04-22Add vty check for max si2quater sizeMax2-9/+35
Explicitly check if added (U|E)ARFCN will fit into available si2quater message.
2016-04-22Add basic UARFCN supportMax3-21/+262
* add data structures, generation functions * vty interface for neightbor UARFCNs specific to SI2quater * vty test * unit test Fixes: OS#1666
2016-04-22Fix earfcn deletionMax1-2/+2
* fix typo in arg index * fix sign in error reporting * add vty test
2016-04-22Fix documentation for command parametersMax1-1/+2
2016-04-16nat/vty: Do not print token update statementHolger Hans Peter Freyther1-4/+1
On start this would print one line per BSC and this doesn't add a lot of value. Let's just remove this logging message.
2016-04-16Add basic SI2quater supportMax5-3/+302
* support for sending arbitrary static SI2quater. * vty interface for neightbor EARFCNs specific to SI2quater. * dynamic generation of SI2quater messages. * unit test for SI2quater messages. Fixes: OS#1630
2016-04-16Refactor SI-related codeMax2-20/+19
Move define to header file. Use inline functions where appropriate. Change int variables which are used as boolean into actual bool to make code easier to follow.
2016-04-16Add SI2quater support to SI3Max3-1/+17
Advertise SI2 quater presence and location (if available) using SI3 according to 3GPP TS 44.018 § 10.5.2.34
2016-04-16bsc_nat: forward_sccp_to_msc(): assert con presence (CID #57872)Neels Hofmeyr1-0/+1
2016-04-16gtphub_unmap_header_tei(): don't dereference unmapped_tei arg if not present ↵Neels Hofmeyr1-4/+6
(CID #57687)
2016-04-14NAT: reload BSCs config dynamicallyMax1-0/+29
Add vty tests for BSC configuration reloading. Load BSCs configuration on bscs-config-file command: * remove all runtime configured BSC not in the config file * close connections to all BSC with updated token value Fixes: OS#1670 Sponsored-by: On-Waves ehf
2016-04-14NAT: move BSC config into separate fileMax2-4/+50
Introduce new configuration option bscs-config-file which includes BSC configuration from the given file. Both absolute and relative (to the main config file) paths are supported. Add 'show bscs-config' command to display current BSC configuration. Note: it is still possible to have BSC configuration in the main file (provided proper index number is used) and in runtime but BSC configuration is no longer saved automatically. The management of included configuration file is left to external tools. Update configuration examples. Fixes: OS#1669 Sponsored-by: On-Waves ehf
2016-04-12NAT: allow allocating BSC in arbitrary orderMax2-12/+9
Check for existing BSC before allocating new one. Track number of remaining BSCs on deallocation. Explicitly use BSC number in allocation function.
2016-04-12Remove trivial wrapper functionMax1-13/+2
Rename gsm48_tx_chan_mode_modify() to gsm48_lchan_modify() and remove corresponding wrapper code.
2016-04-12NAT: extend debug output for ipaccess errorsMax1-2/+2
2016-04-12NAT: vty command to display number of BSCsMax1-0/+9
Add command 'show nat num-bscs-configured' to display number of configured BSCs. Sponsored-by: On-Waves ehf
2016-04-11Fix segfault with broken configMax1-0/+3
Fixes OS#1691
2016-04-07ctrl: Extend ctrl command to optionally handle alg+kiHolger Hans Peter Freyther1-2/+58
Extend the existing ctrl command to be able to specify the algorithm and Ki. In contrast to the VTY no size check is done. Together with the VTY this code only supports a small part of what is supported by libosmocore. The algorithm and ki are considered optional but if a valid algorithm other than "none" is passed, a KI must be passed as well. Extend the test coverage by passing the potential values. It is not verified that the KI/algorithm is stored.
2016-04-06db: If creating a subscriber in the db fails, return NULLHolger Hans Peter Freyther1-1/+4
We should not return a subscriber in case it was not written to the database. Instead free the memory allocated and return NULL. Callers in gsm_04_08.c are prepared to have the creation fail. Related: OS Issue #1657
2016-04-06subscr: Make db_create_subscriber fail on duplicatesHolger Hans Peter Freyther2-13/+13
The issue of db_create_subscriber updating an already existing subscr is that the same subscriber will then have two entries in the active subscribers list. In general this will break assumptions that a subscr can be compared by comparing the pointer. In the case of the VTY this was not an issue as the created subscr was immediately destroyed again but it is better to avoid this problem. Change the VTY command to find the subscriber and then call sync to have the updated time set. The side-effect is we will now have two queries for the subscriber. Once through subscr_get_by_imsi and once through db_create_subscriber. Change the db_create_subscriber to fail if a subscriber already exists, and add a testcase for this behavior and do not updated the 'updated' timestamp of an already existing subscriber. Add a testcase for this behavior. Related: OS Issue #1657
2016-04-01bsc: Add parameter to restart a btsHolger Hans Peter Freyther1-1/+11
The ip.access nanoBTS seems to have severe issues with BSSGP when changing the country code and/or network code. It is unlikely that the proprietary code is getting fixed so we extend the parameter for the apply-configuration command to carry the 'restart' param.
2016-04-01bsc: Add code to send ip.access reboot command to nanoBTSHolger Hans Peter Freyther1-0/+39
The nanoBTS continues to be buggy and seems to have broken BSSGP when changing SIs across new OML connections. Add an easy command to force the reboot of the system through OML.
2016-04-01abis: Send the message without enforcing to wait for a responseHolger Hans Peter Freyther1-1/+1
The user might issue restarts while no BTS is connected and we should not block the abis queue because of these messages.
2016-03-31Fix MM Auth: zero-initialize auth tuple before first useNeels Hofmeyr1-1/+10
Make sure a new auth tuple is initialized after db_get_lastauthtuple_for_subscr() returns an error, i.e. if no tuple is present for the subscriber yet. Before this patch, the first key_seq depended on the typically uninitialized value that was present in auth tuple's key_seq upon calling auth_get_tuple_for_subscr(). The very first key_seq used for a new subscriber will now always be 0. Before, it used to be mostly 1 ("(0 + 1) % 7"), but depended on whether the key_seq was indeed initialized with 0, actually by random.
2016-03-31Fix MM Auth: disallow key_seq mismatchNeels Hofmeyr1-0/+1
In auth_get_tuple_for_subscr(), add missing condition to match incoming key_seq with stored key_seq, so that re-authentication is requested for mismatching key_seqs. Add test for this issue.
2016-03-31MM Auth: return AUTH_NOT_AVAIL instead of hardcoded zeroNeels Hofmeyr1-4/+4
AUTH_NOT_AVAIL == 0, so this is no functional change.
2016-03-31MM Auth: introduce AUTH_ERROR constant.Neels Hofmeyr1-3/+3
Instead of using hardcoded -1 for errors, include -1 in the enum auth_action type; apply its use. In the mm_auth test, the string output changes from '(internal error)' to 'AUTH_ERROR', since now the proper enum value is used in auth_action_names[].
2016-03-31Add MM Auth test; add auth_action_str() functionNeels Hofmeyr1-0/+9
Add basic MM Authentication test setup, with fake DB access and RAND_bytes(). So far implement simple tests for IO error during DB access and missing auth entry. To print the auth action during tests, add struct auth_action_names and auth_action_str() inline function in auth.[hc].
2016-03-27osmo-bsc: fix compiler warning: store struct in vty->indexNeels Hofmeyr1-2/+2
Don't store an MSC index number in the vty->index void* value. Instead, store the osmo_msc_data struct directly. Thus avoid warnings about differences in int vs void* sizes, and save some index lookups.
2016-03-17Revert "move to hex TMSI representation"Harald Welte1-8/+7
This reverts commit 044fbe6568f82a12bf4e3addc7e3d6db529b6548.
2016-03-17move to hex TMSI representationVadim Yanitskiy1-7/+8
In OpenBSC, we traditionally displayed a TMSI in its integer representation, which is quite unusual in the telecom world. A TMSI is normally printed as a series of 8 hex digits. This patch aligns OpenBSC with the telecom industry standard. Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2016-03-17fix confusing typo in constant (THAN -> THEN)Neels Hofmeyr2-2/+2
2016-03-16mgcp: Fix compiler warnings on size_t on AMD64Holger Hans Peter Freyther1-4/+4
mgcp_transcode.c: In function 'decode_audio': mgcp_transcode.c:332:4: warning: format '%d' expects argument of type 'int', but argument 7 has type 'size_t' [-Wformat=] LOGP(DMGCP, LOGL_ERROR, ^ mgcp_transcode.c:332:4: warning: format '%d' expects argument of type 'int', but argument 8 has type 'long unsigned int' [-Wformat=] mgcp_transcode.c: In function 'encode_audio': mgcp_transcode.c:390:4: warning: format '%d' expects argument of type 'int', but argument 7 has type 'size_t' [-Wformat=] LOGP(DMGCP, LOGL_INFO, ^ mgcp_transcode.c:390:4: warning: format '%d' expects argument of type 'int', but argument 8 has type 'size_t' [-Wformat=] mgcp_transcode.c: In function 'mgcp_transcoding_process_rtp': mgcp_transcode.c:542:5: warning: format '%d' expects argument of type 'int', but argument 9 has type 'size_t' [-Wformat=] LOGP(DMGCP, LOGL_NOTICE, ^ mgcp_transcode.c:571:4: warning: format '%d' expects argument of type 'int', but argument 7 has type 'size_t' [-Wformat=] LOGP(DMGCP, LOGL_NOTICE, ^
2016-03-15bsc_scan_msc_msg: check protocol discriminatorNeels Hofmeyr1-0/+5
The function assumed an MM protocol discriminator without verifying it.
2016-03-15meas: Do not retry to close the databaseHolger Hans Peter Freyther1-11/+2
There is no concurrency involved and if it failed the first time, it will fail the second, third, ... time as well. Simply print that we will leak the database instance.
2016-03-1504.08: apply new transaction id inline functionsNeels Hofmeyr4-7/+7
libosmocore recently added inline functions to relieve callers from applying bitmasks and bit shifts to access the transaction id of a GSM 04.08 header. Apply these functions.
2016-03-1504.08: apply new bitmask functions, fix bitmask useNeels Hofmeyr12-37/+46
Replace hardcoded protocol discriminator and message type bitmasks with function calls recently introduced in libosmocore. Note that the release 98 bitmasks slightly differ from the release 99 bitmasks. This patch uses the "default" gsm48_hdr_msg_type invocation, thus it depends on libosmocore whether 98 or 99 bitmasks are used. In some places, use of the bitmask was erratic. Fix these implicitly by employing the bitmask functions: * silent_call.c: silent_call_reroute(): add missing bitmask for MM. * bsc_msg_filter.c: bsc_msg_filter_initial(): RR vs. MM messages. * osmo_bsc_filter.c: bsc_find_msc() and bsc_scan_bts_msg(): RR vs. MM messages. * bsc_nat_rewrite.c: bsc_nat_rewrite_msg(): SMS vs. CC messages. * bsc_ussd.c: no bitmask is applicable for the message types used here. * gb_proxy.c: gbproxy_imsi_acquisition(): missing bit mask for pdisc. In gprs_gb_parse.c: gprs_gb_parse_dtap(), add a log notice for unexpected message types.
2016-03-01db: evaluate return value of sqlite3_finalize(), tweak log output.Neels Hofmeyr1-4/+10
2016-02-29check return value of sqlite3_close(), retry up to three times.Neels Hofmeyr1-1/+11
2016-02-29use sqlite3_close() instead of sqlite3_close_v2()Neels Hofmeyr1-1/+1
This allows using sqlite3 v3.7.13, used by our current debian installation in the test setup. _v2 was added in v3.7.14.
2016-02-29minor commentNeels Hofmeyr1-0/+1
2016-02-29osmo_bsc_filter.c: add fixme noteNeels Hofmeyr1-0/+3
2016-02-25smpp: refactor initialization, add bind addressNeels Hofmeyr5-55/+167
Make the SMPP bind address configurable (used to be harcoded as "0.0.0.0"). Add VTY command smpp local-tcp A.B.C.D <1-65535> while keeping the old command 'local-tcp-port <1-65535>'. Both the old and the new command immediately change the SMPP listening address and port. Add a LOGL_NOTICE log when the SMPP listening address and/or port change. However, to be useful, this patch has to go somewhat further: refactor the initialization procedure, because it was impossible to run the VTY commands without an already established connection. The SMPP initialization procedure was weird. It would first open a connection on the default port, and a subsequent VTY port reconfiguration while reading the config file would try to re-establish a connection on a different port. If that failed, smpp would switch back to the default port instead of failing the program launch as the user would expect. If anything else ran on port 2775, SMPP would thus refuse to launch despite the config file having a different port: the first bind would always happen on 0.0.0.0:2775. Change that. In the VTY commands, merely store address and port if no fd is established yet. Introduce several SMPP initialization stages: * allocate struct and initialize pointers, * then read config file without immediately starting to listen, * and once the main program is ready, start listening. After that, the VTY command behaves as before: try to re-establish the old connection if the newly supplied address and port don't work out. I'm not actually sure why this switch-back behavior is needed, but fair enough. In detail, replace the function smpp_smsc_init() with the various steps smpp_smsc_alloc_init() -- prepare struct for VTY commands smpp_smsc_conf() -- set addr an port only, for reading the config file smpp_smsc_start() -- establish a first connection, for main() smpp_smsc_restart() -- switch running connection, for telnet VTY smpp_smsc_stop() -- tear down connection, used by _start() twice And replace smpp_openbsc_init() smpp_openbsc_set_net() with smpp_openbsc_alloc_init() smpp_openbsc_start() I'd have picked function names like "_bind"/"_unbind", but in the SMPP protocol there is also a bind/unbind process, so instead I chose the names "_start", "_restart" and "_stop". The smsc struct used to be talloc'd outside of smpp_smsc_init(). Since the smsc code internally uses talloc anyway and employs the smsc struct as talloc context, I decided to enforce talloc allocation within smpp_smsc_alloc_init(). Be stricter about osmo_signal_register_handler() return codes.
2016-02-25enable ctrl bind config for various programsNeels Hofmeyr7-20/+56
Add ctrl_vty_init() calls and feed the ctrl_vty_get_bind_addr() return value to ctrl_interface_setup() in the following programs: osmo-bsc osmo-bsc_nat osmo-nitb osmo-sgsn For osmo-sgsn, move the control interface setup invocation below the config parsing, so that the ctrl_vty_get_bind_addr() can return the configured address.
2016-02-25osmo-nitb: be strict about cmdline argsNeels Hofmeyr1-1/+3
Abort upon unknown options and missing option arguments. This came to my attention while rewiring the -m and -M options: passing -M without argument would launch nitb with wrong configuration. So, rather exit immediately. If there are legacy options that should be ignored, they deserve an own 'case:' in the option switch. There are none that I'm aware of though.
2016-02-25osmo-nitb: cosmetic: rename to rf_ctrl_path, following mncc_sock_pathNeels Hofmeyr1-4/+4
Strictly speaking, the unix domain socket location is not a name but a path. The MNCC socket is called path, so it is confusing to call the ctrl socket a 'name'.
2016-02-25osmo-nitb: add -M to pass specific MNCC socket pathNeels Hofmeyr2-10/+16
The old -m option without argument is still available and marked deprecated, to not make users' lives more difficult than necessary.