Commit Graph

649 Commits

Author SHA1 Message Date
Pau Espin df5fb9adf2 hnb-test: Fix memleak in hnb_read_cb
Change-Id: I6ecbce6aab11e1382ff9f71d901e1c6ac145f835
2021-11-02 13:33:56 +00:00
Pau Espin 1ddedcfa46 ranap: Use asn1c flag -fcompound-names to avoid name collisions with other libs
Change-Id: Iba106dcc18e3d429b4b9808610a44ac29b798172
2021-10-27 17:22:50 +02:00
Pau Espin 52eabf3a55 sabp: Use asn1c flag -fcompound-names to avoid name collisions with other libs
Change-Id: I10ce4a9414768cdcf850feeca4088296e339919f
2021-10-27 17:17:43 +02:00
Pau Espin c72d654cec rua: Use asn1c flag -fcompound-names to avoid name collisions with other libs
Change-Id: Id4e337cdc82c26922b7ca7f0fe8af523e9a0945c
2021-10-27 16:53:37 +02:00
Pau Espin 41fefdb12d hnbap: Use asn1c flag -fcompound-names to avoid name collisions with other libs
Change-Id: I1bcbe047d233684647d6ffe9febb14a12c579696
2021-10-27 16:51:18 +02:00
Pau Espin 02de780ceb hnbap: Drop no longer existing asn1c param -fnative-types
This is an option enabled by default and not existent as cmdline param
since asn1c 0.9.26.

For some reason, when dropping it, asn1c generates different description
comment section on related files. In any case, this makes hnbap look
like other libraries which already got this param removed and hence also
generateds code looks the same.

Change-Id: Iccf81539a5045416185e619d24c3d542204437e6
2021-10-27 16:32:58 +02:00
Pau Espin bc7c69d170 hnbap: Use specific prefix for HNBAP generated code
Other libraries already use ASN1C_PREFIX except the HNBAP one. Let's use
it here to avoid collisions.

All new include/osmocom/hnbap/HNBAP_*.h and src/hnbap/HNBAP_*.c are
generated using the updated src/hnbap/Makefile.am.
Files such as src/*.c, test/* and include/osmocom/hnbap/hnbap_common.h
are modified manually to update structs/enums to new prefix.

Related: SYS#5516
Change-Id: I6c062f631527ae42811bfec134933671c05ecba6
2021-10-26 16:42:07 +02:00
Pau Espin 651ff175d5 Update generated .c/.h after using asn1c -R param
Change-Id: Ib7a03973d43828f47ff59b561d9ddce43186f8af
2021-10-26 16:42:07 +02:00
Pau Espin b292db8923 src/*/Makefile.am: Use asn1c -R to avoid generating runtime code
Change-Id: I5666a6dc1ec9e56fe133642fb0054e913265c081
2021-10-26 16:42:07 +02:00
Pau Espin 861d9d2ebf src/*/Makefile.am: Copy back to srcdir the generated .c files from ASN
Change-Id: I203a25a8059218bb9fd6d10cbc028a296d347382
2021-10-26 16:41:31 +02:00
Pau Espin e395b75619 hnb-test: Fix rc var may be used uninitialized
Warning observed compiling with gcc 11.1.0.

Change-Id: I6ca53dd57572338f15971633441da895843a164d
2021-10-26 14:31:33 +02:00
Pau Espin 6334953f1c hnbgw_cn.c: Use proper type struct
Change-Id: Icc8b90866a8edce9d10c87f4ced7137edf1c46f0
2021-10-26 14:15:49 +02:00
Pau Espin 5310f5458e hnbgw_rua.c: Use proper type struct
Change-Id: I9e21b504e4fac072d8481d0a699bc58d1b94a12d
2021-10-26 13:50:36 +02:00
Oliver Smith 6a77d1ffa5 contrib/osmo-iuh.spec.in: fix header packaging
Fix the conflict from having %{_includedir}/* in multiple packages by
replacing it with the correct subdir path.

Fix for:
  found conflict of libosmo-hnbap-devel-0.7.0.11.b110.202110260026-1.1.armv7hl with libosmo-ranap-devel-0.7.0.11.b110.202110260026-1.1.armv7hl:
    - /usr/include/osmocom/hnbap/Access-stratum-release-indicator.h
    - /usr/include/osmocom/hnbap/AccessResult.h
    - /usr/include/osmocom/hnbap/AdditionalNeighbourInfoList.h
  ...

I've verified that it builds again in my own OBS namespace.

Related: SYS#5516
Fixes: 35f2bd ("Provide libosmo-hnbap as a public shared library")
Fixes: dba8b0 ("Provide libosmo-rua as a public shared library")
Change-Id: Ia401caf01fa9ea351f811d7c22a04ccff556d6bc
2021-10-26 09:21:02 +02:00
Pau Espin b1103fc8e3 README.md: Document how to re-generate code from ASN1 files
Change-Id: Ie3e5b7fb88caf2a795fccdcf214f559f9683070c
2021-10-22 23:19:06 +02:00
Pau Espin 44481e435e move-asn1-header-files.sh: Replace original asn file path in generated asn1 header files
This makes builds reproducible and keep the existing relative path.
This should have been done in a previous commit changing the paths being
passed to asn1c to be absolute (top_srcdir).

Fixes: f67803684f
Change-Id: I19537f136cbb654950172ee532027920d353a556
2021-10-22 23:15:31 +02:00
Pau Espin dba8b0c334 Provide libosmo-rua as a public shared library
It is needed by the new osmo-hnodeb project.

Related: SYS#5516
Change-Id: I8b800baacbfe3a3c424c51b418b5ac2e2848b3ba
2021-10-22 15:43:17 +02:00
Pau Espin 35f2bd60ae Provide libosmo-hnbap as a public shared library
It is needed by the new osmo-hnodeb project.

Related: SYS#5516
Change-Id: I0d0862e9d59d3b206f3f7dfae4b39ae4032bb762
2021-10-22 15:42:27 +02:00
Pau Espin 2127a71515 src/*/Makefile.am: Fix trailing whitespace
Change-Id: Ie22df146cfaf6aaf9c7cef884a964e6a3dfcc8ad
2021-10-22 15:42:05 +02:00
Pau Espin 40c1729c61 src/tests/Makefile.am: Drop reference to non-existent RANAP_FILES var
It was no longer needed since .la was used.

Change-Id: I3f196d5c2bb35826709bfc32d10e6b3683b552ee
2021-10-21 15:06:03 +02:00
Pau Espin 6f1de40430 cosmetic: src/ranap/Makefile.am: Drop trailing whitespace
Change-Id: I934b7be7ca1fac05410df6640428ee8e9c70c3e7
2021-10-21 14:57:37 +02:00
Pau Espin 1f6c117d07 hnb-test: Fix typo in vty cmd description
Change-Id: Id33e2e8caa37dc359d564188747cd4c1b8bc4064
2021-07-05 12:18:47 +02:00
Pau Espin 7fcd33df8c ranap_iu_tx_release_free(): always trigger RANAP_IU_EVENT_IU_RELEASE as a result
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
2021-04-14 17:45:12 +02:00
Pau Espin 68a796ebc5 iu_client: Log event sent to upper layer callback
Change-Id: I2233df2b09ae46f28dd99d7540d71fee8e47b6ff
2021-04-13 17:36:49 +02:00
Harald Welte 09d635ce9b hnbgw: Add missing break statement
We don't want to print usage information after the VTY reference XML.

Change-Id: Ia729134a8f18d53274bbc063aa39508c7dcc1f72
2021-02-24 09:00:01 +01:00
Pau Espin c1385f2986 Bump version: 0.6.0.49-356f-dirty → 0.7.0
Change-Id: I3b592c39646a77681efde5debb5ac2a844208949
2021-02-23 20:11:59 +01:00
Harald Welte 356f49e723 manuals: generate vty reference xml at build time
Remove hnbgw_vty_reference from the source tree.

In manuals/Makefile.am use the new BUILT_REFERENCE_XML feature recently added
to osmo-gsm-manuals, and add a build target to generate the XML using the new
osmo-hnbgw --vty-ref-xml cmdline switch.

Change-Id: Ia1e978ad9139c41368cd2720c339e1738d345c4a
Depends: I613d692328050a036d05b49a436ab495fc2087ba
Related: OS#5041
2021-02-23 19:55:03 +01:00
Pau Espin ff8c223440 Workaround ASan report memleak during call to --vty-ref-xml
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-23 19:55:03 +01:00
Pau Espin 79d001fcb6 hnbgw: Avoid re-defining same global variable twice
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-23 19:08:48 +01:00
Harald Welte d24839fea0 main: add --vty-ref-mode, use vty_dump_xml_ref_mode()
Change-Id: If07b00e928fbecc596a7f75fc55e811bd9199b72
Depends: Ie2022a7f9e167e5ceacf15350c037dd43768ff40
Relates: OS#5041
2021-02-23 17:44:47 +01:00
Pau Espin a94752e684 tests: Replace deprecated API log_set_print_filename
Change-Id: Ic53a0a9afb8038759bb3ab1d4c5970f23632e84e
2021-02-19 13:19:01 +01:00
Pau Espin 2c6aed38bd tests: Explicitly drop category from log
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-19 13:18:42 +01:00
Harald Welte e8299eb745 ranap_msg_factory: Fix LOGP statements
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-11 10:15:37 +01:00
Harald Welte e3f707b8c6 ranap_msg_factory: Allow detailed control over UEA/UIA algorithm encoded
Change-Id: I6d2d033b0427bdc84fee61e0f3cb7b29935214bf
Closes: OS#4143
2021-02-08 18:34:02 +01:00
Harald Welte f05c5bf6cd hnbgw: Use LOGHNB() to add log context information to log lines
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-02-03 08:45:04 +00:00
Oliver Smith dee13c345f configure.ac: set -std=gnu11
Change-Id: I4bf2f1cb724bc3e3c56d5a5c1270bb152b0e6e0a
2021-01-28 09:28:31 +00:00
Pau Espin e6342e1cab tests/hnb-test: Disable building unsued code
Change-Id: I17f20cea8aa63ed79168653292b99c90b8c03caf
2021-01-14 11:31:32 +01:00
Pau Espin 8653233b57 tests/hnb-test: Initialize logging with existing struct log_info
Change-Id: Ic92e60dda41a9e4d139294b1e851fff5c4f26143
2021-01-14 11:29:47 +01:00
Pau Espin 4c928485ba tests/hnb-test: Fix signedness of assigned pointer
Change-Id: I320ad86b83b0308b43489e8d95f63d6ed55821b5
2021-01-14 11:27:34 +01:00
Pau Espin 84c3e8649a tests/hnb-test: Fix uninitialized use of rc variable
Change-Id: I168e4f7cd48cbaa387e6b05868107250795a0f0c
2021-01-14 11:26:15 +01:00
Pau Espin 634fd81f3d tests/hnb-test-ranap: Fix missing include for ranap_bcd_decode
Change-Id: If8b799777598377048512c338f6384560b445ba3
2021-01-14 11:26:15 +01:00
Pau Espin 101fba211a tests/hnb-test-ranap: Fix incorrect signedness in pointer
Change-Id: I04b1c0446124d66dae1e8fb99d9b82782d12bde7
2021-01-14 11:26:15 +01:00
Pau Espin 96a94bc482 tests/hnb-test: check return code of hnbap_encode_ueregisterrequesties
gcc warns about set but not used variable otherwise.

Change-Id: Ia49b7e88a66a4a744c2b14db6331cc0de431f60b
2021-01-14 11:26:15 +01:00
Pau Espin b4ff1f42b8 tests/hnb-test: Fix signedness of imsi_buf
Change-Id: I3b0a6218ac6242d03642972d5b244815ce9d97a0
2021-01-14 11:26:15 +01:00
Pau Espin 89f4c80541 tests/hnb-test: Drop unused variables
Change-Id: I12870a1cf2462b7cc2868a54f58416e03a856084
2021-01-14 11:24:31 +01:00
Pau Espin 825a1e40a8 tests/hnb-test-ranap: Fix incorrect pointer type cast
osmo_hexdump expect it to be a const unsigned char*, and gcc warns about
incorrect signedness.

Change-Id: I7e0622f502a4442d700340b0f1c2f8cd01e90ecd
2021-01-14 11:10:08 +01:00
Oliver Smith 220f0e2d94 contrib/jenkins: don't build osmo-gsm-manuals
Related: OS#4912
Change-Id: I339cc37a259e30b131fadbdaebd413c54b04f0a0
2021-01-13 13:11:33 +01:00
Harald Welte d37d3c8181 configure.ac: Ensure netinet/sctp.h is present
we unconditionally depend on this header file, yet nothing
in configure.ac ensures its presence.  Building on a clean
Debian 10 with all existing dependencies installed passes
configure but fails at compilation time.

Change-Id: I0a4407ef6ee512ad5ea8775d90acfe1c4fa67cd0
2021-01-07 13:56:26 +01:00
Harald Welte 3f70fcd417 debian: Actually build manuals; add osmo-hnbgw-doc package
for some strange reason we didn't yet build the manual in the debian
package build.

Change-Id: Id53956494144b46e78fc25a176a9b8917788d86e
2021-01-07 13:56:26 +01:00
Harald Welte c6d93452b2 hnbgw: Introduce LOGHNB() macro for log context information
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-30 14:23:54 +01:00