path: root/src
AgeCommit message (Collapse)AuthorFilesLines
8 daysranap_iu_tx_release_free(): always trigger RANAP_IU_EVENT_IU_RELEASE as a resultHEADmasterPau Espin Pedrol1-5/+10
This allows the SGSN always having feedback on the resolution of the release, hence being able to stay in PMM CONNECTED state until the resolution is received, then moving to PMM IDLE. Related: SYS#5389 Change-Id: Iac822c74e56750dc40e94573eae0e20853ff68c0
9 daysiu_client: Log event sent to upper layer callbackPau Espin Pedrol1-0/+2
Change-Id: I2233df2b09ae46f28dd99d7540d71fee8e47b6ff
2021-02-24hnbgw: Add missing break statementHarald Welte1-0/+1
We don't want to print usage information after the VTY reference XML. Change-Id: Ia729134a8f18d53274bbc063aa39508c7dcc1f72
2021-02-23Bump version: → Espin Pedrol1-2/+2
Change-Id: I3b592c39646a77681efde5debb5ac2a844208949
2021-02-23Workaround ASan report memleak during call to --vty-ref-xmlPau Espin Pedrol1-1/+1
For some unknown reason, using size=0 instead of 1 makes LeakSanitizer report a leak when calling osmo-hnbgw --vty-ref-xml: """ ==19857==ERROR: LeakSanitizer: detected memory leaks Direct leak of 96 byte(s) in 1 object(s) allocated from: #0 0x7f083b4d0d28 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc1d28) #1 0x7f083a8e5661 in talloc_named_const (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0x6661) """ It seems iu_client.c is already using size=1. Change-Id: I383653c981e68a053babd33dee1f0df8731752b0
2021-02-23hnbgw: Avoid re-defining same global variable twicePau Espin Pedrol1-1/+0
This global variable is already defined in iu_client.c provided by libosmo-ranap (and used by libasn1c). Fixes ASan warning at starutp. Change-Id: I7dbae83ce0dc4ac25dc10879e223280414f7b561
2021-02-23main: add --vty-ref-mode, use vty_dump_xml_ref_mode()Harald Welte1-0/+34
Change-Id: If07b00e928fbecc596a7f75fc55e811bd9199b72 Depends: Ie2022a7f9e167e5ceacf15350c037dd43768ff40 Relates: OS#5041
2021-02-19tests: Replace deprecated API log_set_print_filenamePau Espin Pedrol1-1/+1
Change-Id: Ic53a0a9afb8038759bb3ab1d4c5970f23632e84e
2021-02-19tests: Explicitly drop category from logPau Espin Pedrol1-0/+2
Let's disable category here since we don't care about its formatting here. In any case, every test relying on logging output validation should always explicitly state the config to avoid issues in the future if default values change. Change-Id: Ia633cae0a26f294e276b431a82256abb1b57ebba Related: OS#5034
2021-02-11ranap_msg_factory: Fix LOGP statementsHarald Welte1-2/+2
The related compiler warnings were overlooked as due to the asn1c-generated code there always are tons of warnings printed compiling this project :( Change-Id: I40b1265ba696501cc72e674f3ef4146c47aacf1b
2021-02-08ranap_msg_factory: Allow detailed control over UEA/UIA algorithm encodedHarald Welte1-16/+48
Change-Id: I6d2d033b0427bdc84fee61e0f3cb7b29935214bf Closes: OS#4143
2021-02-03hnbgw: Use LOGHNB() to add log context information to log linesHarald Welte5-137/+106
So far we don't really have any way of matching a given log message to a specific hNB. Let's use the newly-introduced LOGHNB() macro. Change-Id: Ia16eed4ca5e9ef231259e94c65105f7586f366bc
2021-01-14tests/hnb-test: Disable building unsued codePau Espin Pedrol1-0/+2
Change-Id: I17f20cea8aa63ed79168653292b99c90b8c03caf
2021-01-14tests/hnb-test: Initialize logging with existing struct log_infoPau Espin Pedrol1-0/+2
Change-Id: Ic92e60dda41a9e4d139294b1e851fff5c4f26143
2021-01-14tests/hnb-test: Fix signedness of assigned pointerPau Espin Pedrol1-1/+1
Change-Id: I320ad86b83b0308b43489e8d95f63d6ed55821b5
2021-01-14tests/hnb-test: Fix uninitialized use of rc variablePau Espin Pedrol1-4/+3
Change-Id: I168e4f7cd48cbaa387e6b05868107250795a0f0c
2021-01-14tests/hnb-test-ranap: Fix missing include for ranap_bcd_decodePau Espin Pedrol1-0/+1
Change-Id: If8b799777598377048512c338f6384560b445ba3
2021-01-14tests/hnb-test-ranap: Fix incorrect signedness in pointerPau Espin Pedrol1-1/+1
Change-Id: I04b1c0446124d66dae1e8fb99d9b82782d12bde7
2021-01-14tests/hnb-test: check return code of hnbap_encode_ueregisterrequestiesPau Espin Pedrol1-0/+2
gcc warns about set but not used variable otherwise. Change-Id: Ia49b7e88a66a4a744c2b14db6331cc0de431f60b
2021-01-14tests/hnb-test: Fix signedness of imsi_bufPau Espin Pedrol1-2/+2
Change-Id: I3b0a6218ac6242d03642972d5b244815ce9d97a0
2021-01-14tests/hnb-test: Drop unused variablesPau Espin Pedrol1-3/+2
Change-Id: I12870a1cf2462b7cc2868a54f58416e03a856084
2021-01-14tests/hnb-test-ranap: Fix incorrect pointer type castPau Espin Pedrol1-1/+1
osmo_hexdump expect it to be a const unsigned char*, and gcc warns about incorrect signedness. Change-Id: I7e0622f502a4442d700340b0f1c2f8cd01e90ecd
2020-12-30hnbgw: Introduce LOGHNB() macro for log context informationHarald Welte2-0/+36
So far we don't really have any way of matching a given log message to a specific hNB. Let's introduce a new log macro, together with a configuration directive to select whether the hNB-ID or the UMTS CellID shall be used. Change-Id: I6113925216c6f88add2c6d27bdf47ccbb017f293
2020-12-30hnbgw: use OSMO_STRLCPY_ARRAY() instead of open coding itHarald Welte1-4/+3
Change-Id: I4c539168597187408c31b906fd57844e0f165c9b
2020-10-12hnbgw: Mark SCTP conn as NODELAYPau Espin Pedrol1-0/+1
We don't want messages to be sent being delayed. Related: OS#4499 Change-Id: I333e7f868e426f7d7ebb328ea2a441d769ea8ebd
2020-10-04vty: use install_lib_element() and install_lib_element_ve()Vadim Yanitskiy1-3/+3
See https://lists.osmocom.org/pipermail/openbsc/2020-October/013278.html. Change-Id: I5c0a1efc21a5cc085b701be24dbcca1aaae15ee6 Depends: I8baf31ace93c536421893c2aa4e3d9d298dcbcc6 Related: SYS#4937
2020-08-21Change default SCTP conn NULL-> to localhost->localhostPau Espin Pedrol1-1/+1
"" is changed to "localhost" to let local NSS decide whether to use IPv4 or IPv6. In newish systems, IPv6 ::1 will be selected since IPv6 takes precedence over IPv4. Similarly, the default source addr needs to be changed from NULL to "localhost" since for some yet unknwon reason, getaddrinfo(AF_UNSPEC, NULL) returns first IPv4 "" and later "::", which is inconsistent with getaddrinfo("localhost") result, resulting in src=IPv4( and dst=IPv6(::1), which is incompatible and will fail. In any case, since the default remote address is a local one and it's the client side, there's no real logical change since the kernel would anyway should have taken a local address anyway. Change-Id: I3c07e6aa0c87b752c9ea22eb4936f6993de6571f
2020-07-29Provide more context when logging "Error in ANY_fromType_aper"Harald Welte3-15/+15
Let's add the type name whose encoding failed to give us some kind of a clue what's happening in those situations. Change-Id: I802677ba7164a4d3382d4bc00f5e1c7ab7067d89
2020-05-19Fix OneDefinitionRule Asan violation in tests and osmo-hnbgwPau Espin Pedrol5-10/+6
With new gcc 10.1.0, tests failed at runtime when built with ASAN enabled, since some global variables where defined multiple times. See OS#4556 for a sample Asan error. Fixes: OS#4556 Change-Id: I12a667ea8a9f16404c13c9218b246d2e3acfe3e8
2020-05-19tests: Fix trailing whitespacePau Espin Pedrol2-2/+2
Change-Id: I3ef7a3f1c3247615619a0d01c92d8f80572b0dfe
2020-04-20Fix compilation with gcc-10Harald Welte1-1/+1
/usr/bin/ld: test_common.o:(.bss+0x0): multiple definition of `talloc_asn1_ctx'; test-helpers.o:(.bss+0x0): first defined here See also https://alioth-lists.debian.net/pipermail/debian-mobcom-maintainers/Week-of-Mon-20200413/000652.html Change-Id: I4ce41158bb27e6b9242613106f226fc86995c53c
2020-04-14hnbgw: do not use LOGL_DEBUG as default loglevelPhilipp Maier1-4/+4
The hnbgw application uses LOGL_DEBUG for all its log categories. This is way to verbose, lets set LOGL_NOTICE as default loglevel instead. Change-Id: If3dbed88307814764bab9e7f1821e1dc0d8be43b Related: OS#2577
2020-04-07tests/test-ranap: cosmetic: remove unused variable 'rc'Vadim Yanitskiy1-1/+1
Change-Id: Ie931d11efd7bb083558852a7f329c984c17fec62
2020-04-07tests/test-helpers: fix endianness: do not print uint32_t as raw bytesVadim Yanitskiy2-3/+2
This unit test would not pass on big-endian machines. Change-Id: I60dbcaa89b031c9a81c35e1dd0d9c963d486014c
2020-04-07tests/test-helpers: fix some -Wpointer-sign warnings reported by GCCVadim Yanitskiy1-10/+10
Change-Id: I7ebc99fe919fe7ba515c9d8ba601dceb820bf11f
2020-03-20hnbgw_vty.c: Drop unusued variablesPau Espin Pedrol1-3/+1
Change-Id: Ic7f730c9f51384006e471b5e8452f5821b458bbf
2020-03-20Fix compiler warning on signedness of char ptr using OCTET_STRING_fromBuf()Pau Espin Pedrol2-14/+14
rua_msg_factory.c:19:48: warning: pointer targets in passing argument 2 of ‘OCTET_STRING_fromBuf’ differ in signedness [-Wpointer-sign] Change-Id: Ie0a2e8e11902dc56720ff8121edde0e148fa587a
2020-03-20tests/test-ranap.c: Fix wrong printf formatPau Espin Pedrol1-2/+2
Caught by compiler: test-ranap.c:54:30: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘RANAP_MaxBitrate_t’ {aka ‘long int’} [-Wformat=] test-ranap.c:78:30: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘RANAP_CauseMisc_t’ {aka ‘long int’} [-Wformat=] Change-Id: Icc4e81beaa35e13aea3adfed983016c78b730061
2020-03-20tests/hnb-test-ranap.c: Fix wrong printf formatPau Espin Pedrol1-1/+1
Catched by compiler: hnb-test-ranap.c:76:44: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘RANAP_CN_DomainIndicator_t’ {aka ‘long int’} [-Wformat=] Change-Id: Ie4cd6a36fd0e9a871a1815d600e8a321a3d2a208
2020-02-15tests: Missing return statementMartin Hauke2-1/+2
Change-Id: I4fae9f84a83af280846b07eaa139ff4a05784a2e
2020-01-03Bump version: → Espin Pedrol1-1/+1
Change-Id: I5f42c0ad1a930004415f097d984e1fd1b2d277e6
2020-01-01osmo-hnbgw: make sure osmo_ss7_init() executed successfullyVadim Yanitskiy1-1/+5
Change-Id: Ia9ecf903e79b282aa4fa88a291424681d0fe9d89 Fixes: CID#206089
2019-12-03exit(2) on unsupported positional arguments on command lineHarald Welte1-0/+5
Change-Id: Id33caf93325074f9e5b2b322ac497b1c21c3f406
2019-10-08iu_client: ranap_iu_tx_release() change default cause code to SuccessAlexander Couzens1-3/+3
The cause code no remaining rab should be only used when closing the Iu connection on this specific reason. Change default to NAS Success Release which is a usual release. Change-Id: Icf3f06b0de7dcda9f967ae29863054ef813c75e5
2019-10-03iu_client: pass return value of osmo_sccp_user_sap_down() towards the callerAlexander Couzens1-7/+3
osmo_sccp_user_sap_down return 0 on success, negative values on failure Change-Id: I3b7c2296eb8b26f0881cee643b834336daab86ea
2019-09-23sabp: Generate C/H files for SABP; create libosmo-sabpHarald Welte65-6/+8871
This uses the (modified) Osmocom asn1c on the (modified) SABP ASN.1 syntax to generate C code + header files for SABP parsing/encoding. It also adds some helper code for message encoding and decoding as well as a new libosmo-sabp shared library which can be used by programs to implement SABP related functionality. Change-Id: Ib9580d1af96354398da4c9f97b28a0e23d56e275
2019-09-20hnbgw: Add libosmoctrl's VTY CTRL command initializationPau Espin Pedrol1-0/+1
Otherwise, the "ctrl" VTY node is not available and CTRL ip address cannot be set. Change-Id: I73f64b951690ec23f829c4855b2caeefa66ad35d
2019-09-16iu_client: introduce UE field free_on_releaseAlexander Couzens1-0/+9
Allow to free UE ctx when receiving a Iu Release Complete. In preparation of ranap_iu_tx_release_free() it requires a field to free the Iu ctx on it's own without depending on the upstream user. Change-Id: Iac41cd3cce3232d01b2f7ede0cc46226c2cfb6c0
2019-09-15iu_client: introduce ranap_iu_tx_release_free()Alexander Couzens1-0/+18
ranap_iu_tx_release_free is a fire and forget function to release gracefully if possible. It first sends a Iu Release Command. After a certain timeout the connection will be released. Change-Id: I349e2c61ba0131e233b7ab927dfced0bd461dd8f
2019-09-12iu_client: allow to control the notificationsAlexander Couzens1-0/+4
The iu_client is informing the library user about global event. In prepration to the tx_iu_release_free() call allow to disable upstream notificatiosn Change-Id: Ic93ef6fd54c995405e9c37a5e0c53f81a89850b7