summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Expand osmo_gettimeofday() docsMax2017-10-231-1/+7
| | | | | Change-Id: I9bc835aea56f5f2fb652bb5ab3405e354ba3b95c Related: OS#2586
* abis_nm: Add abis_nm_admin_name() APIPau Espin Pedrol2017-10-231-0/+7
| | | | | | | | | Similar APIs exist for opstate and availability status. This patch does not break backward compatibility because osmo-bsc still requires direct use of the structure in get_string_value(). Change-Id: Ieace734aaff3f07606113feddde65b75202d96d6
* socket: add function osmo_sock_local_ip() to query local ipPhilipp Maier2017-10-232-0/+55
| | | | | | | | | | In some cases it is required to know the ip-address of the interface through that a given remote IP-Address can be reached. Add function osmo_sock_local_ip() to determine the local ip-address for a given remote ip-address Change-Id: I2988cc52b196fc8476703d1287e24cb4a48491c2
* GPRS: log NS socketMax2017-10-231-0/+1
| | | | | | | Let's log NS UDP socket creation similar to the way we log it for telnet and ctrl interfaces. Change-Id: Ic9d0f94ab2c1bb33f67cd4f1c9236b64108c0bb6
* add function msgb_printf() to print formatted text into msg bufPhilipp Maier2017-10-224-0/+162
| | | | | | | | | | | In ASCII string based protocols it a printf() version that prints directly to the message buffer may be useful. Add function msgb_printf(), make sure that msg buffer bounderies are not exceeded. If the end of the tail buffer is hit, return with an error code. Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3
* Make osmo_apn_to_str() more robustMax2017-10-202-0/+10
| | | | | | | Previously it would crash on NULL input. Let's handle it gracefully instead. Corresponding test case is also added. Change-Id: I587153e49d1c92128fac3ae5c124adba9592378e
* Disable doxygen in jenkins for embedded testsMax2017-10-201-0/+1
| | | | | | | There's no point in regenerating documentation with Doxygen in embedded environment. Change-Id: I6504db04445f5e9c1117379c8803e10df5634324
* Cleanup jenkins build scriptsMax2017-10-203-32/+26
| | | | | | | | | * reorder builds to avoid rm -rf invocation * avoid useless double autoreconf * move common parts into shared helper * move common build steps into separate function Change-Id: I24e500e132f5c8e8133d35548cb7b4e4552331d0
* GPRS: print remote state info for NS peerMax2017-10-201-3/+5
| | | | | Change-Id: I1714c68909507eae6ef2933661a085859aca3b54 Related: SYS#3610
* api doc: fix two doxygen group closing bracesNeels Hofmeyr2017-10-172-2/+2
| | | | Change-Id: I6c1f47d13c5b7a9cb2281de9f017df4f1ed88ba7
* [doc] Properly define gsm0800 group and move all related files into itHarald Welte2017-10-174-5/+14
| | | | Change-Id: I91920c69c86d6a1932172becacb76faff2d3eb1e
* [doc] Properly define 'oap' group and add introductory textHarald Welte2017-10-172-4/+12
| | | | Change-Id: I1e875991ae1dd93862f850f85d40b3dac61ece72
* [doc] Define 'gsup' group with proper name, add intro textHarald Welte2017-10-172-4/+20
| | | | Change-Id: Ieee6213dc5aad082a2d439c7418b51f281b80b1a
* [doc] make sure all SMS related code is part of the 'sms' groupHarald Welte2017-10-178-11/+27
| | | | Change-Id: I24c56ccb56d5b39cfb887808f91b715da54c0f8b
* [doc] gea has separate group; A5 is not part of crypto but a5 groupHarald Welte2017-10-174-18/+18
| | | | Change-Id: I2fd24c86f9b52244073ec800a3287e3d38e660d9
* [doc] Provide proper name for 'auth' groupHarald Welte2017-10-171-1/+1
| | | | Change-Id: I5fb1c34475ea9db36c2ec5cddc988074a72a35f7
* [doc] Ensure include/crypt/* is part of libosmogsm documentationHarald Welte2017-10-171-1/+1
| | | | Change-Id: Ic41f807dabb3b0d2d20b9d8963cad639e98f04dd
* [doc] Ensure stats.h is parsed properly for DoxygenHarald Welte2017-10-171-1/+1
| | | | | | | | | stats.h uses a rather crude '#ifdef unix' hack, which means that Doxygen will not scan the body of the file. This patch ensures 'unix' is defined to parse the stats.h body and thus have all relevant information in it is parsed. Change-Id: I65384e5cc01f2ad7783cf6b71ab78b4422902aa1
* [doc] TLV parser has far grown beyond GSM L3Harald Welte2017-10-161-1/+1
| | | | | | Let's hence not call the group "GSM L3 compatible TLV parser" Change-Id: Ic53f9c0d5ee787f994f42cf2aff313c6e131fbe6
* [doc] Rename "RSL" to "A-bis RSL" in documentation.Harald Welte2017-10-161-1/+1
| | | | | | | We also have "A-bis OML" and it's a bit odd to have one with prefix and the other without. Change-Id: Ida325f8a9c40b40c1aeaa4edfd1123ced7cc92b8
* [doc] Don't add libosmovty bits to libosmocore groupsHarald Welte2017-10-164-30/+29
| | | | | | | | Let's not put files of libosmovty into Doxygen groups of libosmocore, as this seems to confuse Doxygen. Also, some minor updates/fixes of libosmovty documentation. Change-Id: I70e612b8d06aabefe634fcd7861641ffb941d974
* [doc] Expand Doxuygen documentation for osmo_primHarald Welte2017-10-162-5/+28
| | | | | | Also, make sure prim.c is actually part of the 'prim' module. Change-Id: I4363e46a5f606eb2114a9cc1d2086007eaa58d31
* [doc] Introductory text on what the logging ring buffer is aboutHarald Welte2017-10-161-0/+7
| | | | Change-Id: I876cd31e03a53ca90e658e353c0c8a839dece8ad
* [doc] Make sure loggingrb.c file is in correct Doxygen group.Harald Welte2017-10-161-1/+1
| | | | | | loggingrb.c, like loggingrb.h should be part of the loggingrb group! Change-Id: I4822a46631b45df1afda202c00038b6ad2c8b5ae
* [doc] Doxygen documentation on osmo_hexdump print buffer sizeHarald Welte2017-10-161-0/+6
| | | | Change-Id: I83ca2a3a555e5b3c1b7f23bf9e463a5063a8006c
* [doc] Put CRC-16 and generic CRC code in one Doxygen moduleHarald Welte2017-10-165-11/+28
| | | | | | .. and add missing API documentation bits Change-Id: I67119894bcbf8c779426a0272bae4c5ce1fbd1ed
* [doc] bits.c: Better / more Doxygen documentationHarald Welte2017-10-162-10/+17
| | | | Change-Id: If824a5c8d8ee6e3dc96a3fddeb105786c0c027c1
* [doc] rate_ctr: Extend Doxygen API documentation with human-readable text on ↵Harald Welte2017-10-161-2/+35
| | | | | | its use Change-Id: If9abd46e1b0ebb6114522418fd3b45c1d802968a
* [doc] src/logging.c: Fix Doxygen syntax to make logging.c show up in logging ↵Harald Welte2017-10-161-1/+1
| | | | | | group Change-Id: I56718e1eca1739a1b0a790f2f3a1b554899a93ab
* [doc] Add Doxygen API documentation for stats.c and stats_statsd.cHarald Welte2017-10-163-22/+145
| | | | Change-Id: I8e49505f5c19beac90290fdba8821714e8eecd97
* [doc] counter.[ch] Add Doxygen API documentationHarald Welte2017-10-162-16/+23
| | | | | | | This adds a more complete set of API documentation for all osmo_counter relatedd functions and definitions. Change-Id: I24283c05620ee86a8beb165af98a85d754549efb
* [doc] stat_item: Complete doxygen documentation for APIHarald Welte2017-10-162-42/+89
| | | | | | | | The stat_item code base had some incomplete doxygen documentation so far. Let's complete it, and at the same time fix some cosmetic as well as copy+paste issues in the existing documentation bits. Change-Id: Ib514c137b40bf7b9791bd74be99af0b65575f2b6
* Rename 'statistics.c' to 'counter.c'Harald Welte2017-10-159-67/+70
| | | | | | | | | With stat_item, stats.c and stats_statsd.c, it is becoming a bit difficult to understand file naming. Also, the 'statistics.c' file actually only contained osmo_counter handling, so let's rename it to counter.c altogether. Change-Id: I2cfb2310543902b7da46cb15a76e2da317eaed7d
* gsm: make osmo_imsi_str_valid() NULL-safeNeels Hofmeyr2017-10-103-0/+6
| | | | | | | | | No callers that would pass NULL exist, but let's check against NULL from the start. Fixup for recent change I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522. Change-Id: I111fbf29228929f2cd6ffa06bcb1f69da223224e
* Fix build on older systemsMax2017-10-101-0/+3
| | | | | | | | Make sure GRND_NONBLOCK is always defined, even when using syscall directly. Change-Id: I1bcac37ee1847596b49122f9307bd2689ba71b1b Related: OS#1694
* utils: add osmo_is_hexstr(), add unit testNeels Hofmeyr2017-10-094-0/+132
| | | | | | Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: Idf75946eb0a84e145adad13fc7c78bb7a267aa0a
* auth: add OSMO_MILENAGE_IND_BITLEN_MAXNeels Hofmeyr2017-10-092-1/+2
| | | | | | Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: Ic39f3404d1a49ffd06070aa9897b36f219eacf4d
* auth: add value_strings for osmo_sub_auth_type, comment on osmo_auth_alg_name()Neels Hofmeyr2017-10-093-1/+15
| | | | | | | | | Add osmo_sub_auth_type_names[] and osmo_sub_auth_type_name(). Also add a hint to enum osmo_auth_algo's API doc that osmo_auth_alg_name() already exists (it is defined further below). Change-Id: I652a929bcd11c694d86812fb03d0a1cbd985efda
* Add function to generate random identifierMax2017-10-095-8/+63
| | | | | | | | | | | | | | | | | The function is a wrapper on top of getrandom() (if available via glibc) or corresponding syscall. If neither is available than failure is always returned. It's intended to generate small random data good enough for session identifiers and keys. To generate long-term cryptographic keys it's better to use special crypto libraries (like GnuTLS for example) instead. As an example it's used to replace old insecure random number generator in osmo-auc-gen utility. Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Related: OS#1694
* Ensure __always_inline is defined on operating systems that don't have itHarald Welte2017-10-091-0/+6
| | | | | | | For example, Alpine Linux fails to build libosmocore without us locally defining __always_inline. Change-Id: I0c22aac410e668f8fb8d5de57281bcaeb343eeb1
* add osmo_imsi_str_valid() and osmo_msisdn_str_valid()Neels Hofmeyr2017-10-059-3/+253
| | | | | | | | | Add GSM23003_IMSI_MIN_DIGITS definition. Add regression test gsm23003_test.c to test the two new functions. Will be used by OsmoHLR to validate VTY and CTRL input. Change-Id: I1e94f5b0717b947d2a7a7d36bacdf04a75cb3522
* Fixup severe build performance issuesHarald Welte2017-10-044-37/+55
| | | | | | | | | | | | | | | | | | | | Make variable substitution calling bumpversion and other commands introduce by osmo-release.mk has severely slowed down builds. Inside the makefile we could use $(eval FOO:=$(shell...)) constructs to have variable substitution only happen once the 'release' target is executed. However, 'ifeq' and friends don't work with such late constructs. Let's shift all release action into a helper shell script that is called from the Makefile instead. This way we get the best of both worlds: No performance impact during normal builds, and the convenience of 'make release'. Modified-by: Max <msuraev@sysmocom.de> Related: OS#2524 Change-Id: I98b3b5fe3db39953cea969a9dfbb75889df2e1ea
* doxygen: adjust copyright to include 2017Neels Hofmeyr2017-09-281-1/+1
| | | | Change-Id: If7c09a676f67da15454aedcda99d0e9b301c9945
* CTRL: add unit tests for CTRL command parsingNeels Hofmeyr2017-09-272-0/+353
| | | | | | | | This uncovers some interesting behavior of the CTRL interface which we may want to guard against in subsequent patches: trailing whitespace, ignored tokens, special characters as cmd->id. Change-Id: If7af06d50ca71fd528b08cd70310774d5a53f0f7
* vty: install 'exit', 'end',... commands on *all* nodesNeels Hofmeyr2017-09-279-25/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In many callers of the VTY API, we are lacking the vty_install_default() step at certain node levels. This creates nodes that lack the 'exit' command, and hence the only way to exit such a node is to restart the telnet session. Historically, the VTY looked for missing commands on the immediate parent node, and hence possibly found the parent's 'exit' command when the local node was missing it. That is why we so far did not notice the missing default commands. Furthermore, some callers call install_default() instead of vty_install_default(). Only vty_install_default() also includes the 'exit' and 'end' commands. There is no reason why there are two sets of default commands. To end this confusion, to catch all missing 'exit' commands and to prevent this from re-appearing in the future, simply *always* install all default commands implicitly when calling install_node(). In cmd_init(), there are some top-level nodes that apparently do not want the default commands installed. Keep those the way they are, by changing the invocation to new install_node_bare() ({VIEW,AUTH,AUTH_ENABLE}_NODE). Make both install_default() and vty_install_default() no-ops so that users of the API may still call them without harm. Do not yet deprecate yet, which follows in Icf5d83f641e838cebcccc635a043e94ba352abff. Drop all invocations to these two functions found in libosmocore. Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b
* gb: drop special vty exit commands, use vty_install_default()Neels Hofmeyr2017-09-274-43/+2
| | | | | | | | | | | | | | | L_NS_NODE and L_BSSGP_NODE had specialized 'exit' and 'end' vty commands, but all they do is return to the CONFIG and ENABLE_NODEs like the default 'exit' and 'end' commands. Drop them and use the default 'exit' and 'end' cmds. Examining BSSGP and NS node behavior in osmo-sgsn exhibited identical list and exit/end behavior before and after this patch. Prepares for an upcoming commit incorporating vty_install_default() into install_node(), see I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b: this patch changes to the default commands, the upcoming change implies them. Change-Id: I5b0de066b4249d482c22620d5b1bcb03f381293c
* vty: fix style: bssgp node vty promptNeels Hofmeyr2017-09-271-1/+1
| | | | | | | Add trailing space and 'config-' prefix to match our common VTY node prompt style. Change-Id: I88db128cad9fcc6e53326b4aed5d06ea9102f328
* VTY: implement talloc context introspection commandVadim Yanitskiy2017-09-273-1/+282
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a new command, which could be used to inspect the application's talloc context directly from VTY. To enable this feature, an application need to provide it's context via the 'vty_app_info' struct, and register the VTY command by calling the osmo_talloc_vty_add_cmds(). The new command is a sub-command of 'show': show talloc-context <context> <depth> [filter] Currently the following contexts may be inspected: - application - a context provided by an application; - null - all contexts, if NULL-context tracking is enabled. A report depth is defined by the next parameter, and could be: - full - full tree report, as the talloc_report_full() does; - brief - brief tree report, as the talloc_report() does; - DEPTH - user defined maximal report depth. Also, there are two optional report filters: - regexp - print only contexts, matching a regular expression; - tree - print a specific context, pointed by specified address. The command output is formatted the same way as in case of calling the talloc_report() or talloc_report_full(). Change-Id: I43fc42880b22294d83c565ae600ac65e4f38b30d
* vty/vty.c: do not bind vty context to application's oneVadim Yanitskiy2017-09-271-1/+1
| | | | | | | | | | | | | | | The 'vty_app_info' struct could be used by some applications to provide its talloc context. In the future, it will facilitate the implementation of talloc context introspection via VTY. But the 'vty' talloc context, that contains lots of items (memory chunks), is being bound to an application's one, so it becomes hard to read the last. Let's do not bind the 'vty' context automatically, until some common talloc context export policy is implemented. Change-Id: I9cb6ce9f24dbae400029e2d9f9c933fbfb16248f
* Add time conversion helpersMax2017-09-251-0/+5
| | | | | | | Add macros to break down absolute time in seconds into days/hours/minutes passed. Change-Id: I46b9a405c18ed9da8f31b7d5b6dcece5468bafbf