Commit Graph

460 Commits

Author SHA1 Message Date
Pau Espin c772e525ef tests/ctrl: Move ERROR test scenario to proper file
Change-Id: I26ba561c22c40877d99f2aed27be2df9faaa4bec
2022-06-17 17:07:56 +02:00
Pau Espin 83a41471da tests: Allow specyfing specific ctrl test to run
Similar to what's already available for vty tests.

Change-Id: I3b01edfb22197f4d46bd24e15bdcd37ea0382e4a
2022-06-17 17:03:25 +02:00
Pau Espin b4f25a0d1a ctrl: Mark function as static
Also move it more towards the end, where it is more expected as usually
done in ctrl/vty code.

Change-Id: Ieb956fb855752cfbe83d11aa0326685229a115e3
2022-06-17 15:56:27 +02:00
Vadim Yanitskiy b246580900 tests: use 'check_PROGRAMS' instead of 'noinst_PROGRAMS'
When using 'check_PROGRAMS', autoconf/automake generates smarter
Makefiles, so that the test programs are not being compiled during
the normal 'make all', but only during 'make check'.

Change-Id: I70cf75b3cb6ae59c92248cc529546750fb0da07b
2022-04-14 02:22:14 +03:00
Vadim Yanitskiy 0c13953ed0 debian: add new 'osmo-mslookup-utils' package
Change-Id: I9dbe00187678a5032fb4ae32b496892fdc86ddb7
Related: OS#4706
2022-02-08 13:51:31 +06:00
Vadim Yanitskiy 77a1bf66e6 fixup: debian: remove unneeded dependency libdbd-sqlite3
Change-Id: I3ece7c32151f6f334d0595fdbf9099c930b22bb9
Fixes: I5bfe9c71740c1ced5bad0a41dfca568b9e00070c
2022-02-05 22:52:22 +06:00
Oliver Smith 37a5b70195 treewide: remove FSF address
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.

Change-Id: I4b20c685b6370bf5dc472a42664e2665eb0d8f8c
2021-12-14 12:15:54 +01:00
Pau Espin 4d7cbfcc9a Bump version: 1.3.0.7-bfee → 1.4.0
Change-Id: I39bbc42009bf6291884f652618bfdf94b329a295
2021-11-16 14:56:41 +01:00
Oliver Smith bfeea69cab debian/control: remove dh-systemd build-depend
Related: OS#5223
Change-Id: Ieb8669a9a43ea1acc6b2d8d2e363f2466c51697a
2021-09-01 16:07:06 +02:00
Neels Hofmeyr 3f9d1977df db v6: determine 3G AUC IND from VLR name
Each VLR requesting auth tuples should use a distinct IND pool for 3G
auth.  So far we tied the IND to the GSUP peer connection; MSC and SGSN
were always distinct GSUP peers, they ended up using distinct INDs.

However, we have implemented a GSUP proxy, so that, in a distributed
setup, a remotely roaming subscriber has only one direct GSUP peer
proxying for both remote MSC and SGSN. That means as soon as a
subscriber roams to a different site, we would use the GSUP proxy name
to determine the IND instead of the separate MSC and SGSN. The site's
MSC and SGSN appear as the same client, get the same IND bucket, waste
SQNs rapidly and cause auth tuple generation load.

So instead of using the local client as IND, persistently keep a list of
VLR names and assign a different IND to each. Use the
gsup_req->source_name as indicator, which reflects the actual remote
VLR's name (remote MSC or SGSN).

Persist the site <-> IND assignments in the database.

Add an IND test to db_test.c

There was an earlier patch version that separated the IND pools by
cn_domain, but it turned out to add complex semantics, while only
solving one aspect of the "adjacent VLR" problem. We need a solution not
only for CS vs PS, but also for 2,3G vs 4G, and for sites that are
physically adjacent to each other. This patch version does not offer any
automatic solution for that -- as soon as more than 2^IND_bitlen
(usually 32) VLRs show up, it is the responsibility of the admin to
ensure the 'ind' table in the hlr.db does not have unfortunate IND
assignments. So far no VTY commands exist for that, they may be added in
the future.

Related: OS#4319
Change-Id: I6f0a6bbef3a27507605c3b4a0e1a89bdfd468374
2021-07-19 09:01:06 +00:00
Pau Espin 608e2e483f db: Avoid use uninitialized rc if running 0 statements
Caught by new gcc 11.1.0:
/git/osmo-hlr/src/db.c:257:16: error: ‘rc’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  257 |         return rc;
      |                ^~

Change-Id: I45e1fede234cd4446a7061fb908bf344eee72f5a
2021-07-15 13:33:16 +02:00
Oliver Smith 60673e7f77 Add post-upgrade script for automatic db upgrade
Closes: OS#5138
Change-Id: I34e943e5020285f63a2162010eb42675af1520bf
2021-06-01 09:29:00 +02:00
Keith Whyte ca8e6efca6 vty: enable show subscribers filtered by IMEI
In 89fda3024a I added a
vty command to show a summary of filtered subscribers by imsi
or msisdn. In practice there is a also need to be able to
filter on IMEI.

The idea here is not to replace every operation that could be
done directly on the sql database in the vty, but this one
is useful.

Change-Id: Ic4a11d3ebcf8909c68e9f4617e94dc822491e008
2021-05-13 18:00:43 +00:00
Harald Welte ed2e36316b add README.md file as customary for cgit, github, gitlab, etc.
Change-Id: Ide03584aae21d5972e96e7862feb86e1265c29b3
2021-03-21 22:46:07 +01:00
Keith Whyte 649c335602 Correct configuration written from vty
osmo-hlr would not read back written configuration due to
bad indentation in the mslookup->server->service section.

Also ipa-name was missing.

Change-Id: Ied4b9504f06a51c3895054a8b9d07a67eda3aeeb
2021-02-26 01:21:41 +01:00
Pau Espin 6240465503 Bump version: 1.2.0.78-8c90-dirty → 1.3.0
Change-Id: Iffdee17c1f70f472fb9cfe722b77967c2634ea37
2021-02-23 18:13:54 +01:00
Harald Welte 8c9087dd16 manuals: generate vty reference xml at build time
Move 'doc' subdir further down to "make sure" the osmo-hlr binary is built
before the docs

Remove hlr_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-hlr --vty-ref-xml cmdline switch.

Change-Id: I02c9862ced48ce4271b328a0963d5f09086b295c
Depends: I613d692328050a036d05b49a436ab495fc2087ba
Related: OS#5041
2021-02-23 16:48:36 +00:00
Harald Welte 2bd1a45553 main: add --vty-ref-mode, use vty_dump_xml_ref_mode()
Change-Id: I939f75d6c03145dbe185d849b95b2dd99782f35c
Depends: Ie2022a7f9e167e5ceacf15350c037dd43768ff40
Related: OS#5041
2021-02-23 16:48:36 +00:00
Pau Espin d6993ea4b5 tests: Replace deprecated API log_set_print_filename
log_set_print_category_hex(0) is added in some places since the old API
used to set that internally to keep backward compatiblity.

Change-Id: I3cf46b7c24452254319d5c3eacceff418211bcf7
2021-02-19 13:31:13 +01:00
Pau Espin f551ccf9fb .gitignore: Ignore new autofoo tmp files
Change-Id: I155e9fd644263a8b47301f6b0986b9beb5a45d0f
2021-02-04 12:46:34 +01:00
Keith Whyte b5a5676cff Fix Coverity Warnings
Explicitly check filter_type is not NULL even though the current code
never passed a NULL filter_type unless filter was also NULL.

Remove unreachable code.

Change-Id: Ib2bd9b2d6e9e559e61a895a25235669dae05fdf6
Related: coverity CID#216865
Related: coverity CID#216867
2021-01-30 07:35:26 +01:00
Keith Whyte 89fda3024a Add vty command to show summary of all or filtered subscribers
Adds the following commands:

show subscribers all - Display summary of all entries in HLR
show subscribers (imsi|msisdn|cs|ps) ... As above but filter on search field/string
show subscribers last seen - Display only subscribers with data in
Last LU update field, and sorts by Last LU.

Change-Id: I7f0573381a6d0d13841ac6d42d50f0e8389decf4
2021-01-29 21:26:08 +00:00
Oliver Smith dd746949d0 configure.ac: set -std=gnu11
Change-Id: I5ea5365338248e29591a40ec1e19db95f8ae6877
2021-01-28 09:28:12 +00:00
Keith Whyte cc90bfd0f4 Correct vty inline help for show subscriber
Change-Id: I035435859b60ce6d54da307c0d6397d4bd515439
2021-01-19 07:18:50 +00:00
Oliver Smith f4d64cb98b contrib/jenkins: don't build osmo-gsm-manuals
Related: OS#4912
Change-Id: I22246f3ff105183a7a7a0279fd6c5cde9cd19952
2021-01-13 13:15:54 +01:00
Harald Welte bd94b41fa8 auc_test.c: Add some comments on what the test cases actually do
Change-Id: Id2b9cf12823e05aeadc6f15df396f8a46ae1639d
2021-01-04 14:03:25 +01:00
Harald Welte 6e237d3a90 support the XOR algorithm for UMTS AKA
Test USIMs as specified by 3GPP use the XOR algorithm not only for 2G
but also for 3G.  libosmocore includes the XOR-3G support since v1.3.0,
but osmo-hlr somehow never made use of it.

Change-Id: I3a452af9c18cd90d00ab4766d6bd1679456bc1a2
Closes: OS#4924
2020-12-28 22:40:09 +01:00
Vadim Yanitskiy dac855e5c8 USSD: add special 'idle' handler to IUSE for testing
Change-Id: I0d566a60e95ce2da951f22ad47c6155c5b6a338c
2020-11-17 18:50:27 +07:00
Vadim Yanitskiy 6a6c7f87ca USSD: fix handle_ussd(): do not free() unconditionally
An internal handler may want to continue session, e.g. to request
more information from the MS.  Let's make the handlers responsible
for session state management, and check that state before calling
ss_session_free(), so a session can remain alive.

Before this patch ss->state was not set/used at all...

Change-Id: I49262e7fe26f29dedbf126087cfb8f3bb3c548dc
2020-11-17 18:47:58 +07:00
Vadim Yanitskiy 6cfef3ac26 doc/manuals: re-organize description of internal USSD handlers
Change-Id: Ieddde02f3f41e0eb05b7223026da4252c17c3712
2020-11-17 18:47:58 +07:00
Vadim Yanitskiy 66f0b5fbea doc/manuals: fix s/There/The/ in 'USSD Configuration'
Change-Id: Idbff93b6be5f546f18642ee330746e8734378b39
2020-11-17 18:47:58 +07:00
Vadim Yanitskiy c47d5c0d77 cosmetic: fix spelling in logging message: existAnt -> existEnt
Change-Id: Id803d0c71f3762b8353289853918ea78859780b4
2020-10-29 18:05:22 +07:00
Harald Welte dfbc2cbbc2 Use OSMO_FD_* instead of deprecated BSC_FD_*
Change-Id: I24a9a81382ea723ad20b8caa61fb5c2abcdd86d0
2020-10-18 22:39:01 +02:00
Pau Espin 89649ea997 contrib/jenkins: Enable parallel make in make distcheck
Change-Id: I1973e7a2a3be07b2db1db1cf5f05fd29101ee06a
Related: OS#4421
2020-10-12 19:29:36 +02:00
Pau Espin 23ac586522 Set TCP NODELAY sockopt to GSUP cli and srv connections
GSUP is message based on top of IPA, and hence TCP. We don't want to
have Nagle algorithm enabled, since we are interested in having messages
sent as quickly as possible and there's no need for lower layers to wait
for more data (because we send all the message data at once).

Related: OS#4499
Change-Id: I4653b95ef0d4e1184f81f28408e9eb5d665206ec
2020-10-12 16:39:58 +02:00
Keith Whyte de50b20116 osmo-hlr-db-tool: Make import from osmo-nitb less "lossy"
Include the IMEI and the last seen time in an import from
an osmo-nitb database.

Change-Id: Ic47e549be3551ae43ab6a84228d47ae03e9652a6
2020-09-23 19:41:27 +02:00
Pau Espin ed18fa908c Support setting rt-prio and cpu-affinity mask through VTY
Change-Id: I33101aae3e2851febc335f6fbf96228eab7cf6df
Depends: libosmocore.git Change-Id If76a4bd2cc7b3c7adf5d84790a944d78be70e10a
Depends: osmo-gsm-masnuals.git Change-Id Icd75769ef630c3fa985fc5e2154d5521689cdd3c
Related: SYS#4986
2020-08-18 13:25:34 +02:00
Pau Espin f464fff173 doc: Update VTY reference xml file
Change-Id: Ifdefba331ae2542b1cdc5860d0f9e53ef9f703c4
2020-08-18 12:50:21 +02:00
Pau Espin e893eeb1b3 configure.ac: Fix trailing whitespace
Change-Id: If0569167922695bb88c8f168f89fa300dd181c72
2020-08-18 12:49:05 +02:00
Vadim Yanitskiy b77d568196 debian/control: change maintainer to the Osmocom team / mailing list
Change-Id: I6b38640b57480c6950be491eeb3c5167be1c6aab
2020-08-13 16:09:02 +07:00
Neels Hofmeyr 80cb6c93b9 manual: describe subscriber import by SQL
It seems a bad idea to cement the internal SQL structure in the user manual,
but since we currently lack a safe and portable import mechanism (like CSV
import in osmo-hlr-db-tool), this is currently valuable info to users.

Change-Id: I3246e6d5364215a71c33b5aca876deab7b6cfd70
2020-06-29 17:12:06 +02:00
Neels Hofmeyr 565cf83a42 osmo-mslookup-client: fix segfault for respond_error() caller
respond_error() passes r == 0. On error, consider it the last response for that
request.

Change-Id: I1acb0b8aa00c098d1f1f1cc17035daa38ce29fd3
2020-06-03 18:38:56 +02:00
Vadim Yanitskiy fa20702e67 gsup_server: fix typo: s/omso_gsup_message/osmo_gsup_message/
Change-Id: I77eac6df9836f2361d87df7ba5ab6fc14ba06b1d
2020-05-31 18:52:38 +00:00
Oliver Smith 949a53cdf0 Makefile.am: EXTRA_DIST: debian, contrib/*.spec.in
Change-Id: I401a4849ae186bddd667446ff7247976090e1db7
2020-05-22 13:40:09 +02:00
Oliver Smith 102e362943 contrib: integrate RPM spec
Remove OpenSUSE bug report link, set version to @VERSION@, make it build
with CentOS 8 etc.

Related: OS#4550
Change-Id: I38f80d0f867a2bbaa09b5a42cad5028f23a8effa
2020-05-19 17:08:28 +02:00
Oliver Smith 2f7fb2e36b contrib: import RPM spec
Copy the RPM spec file from:
https://build.opensuse.org/project/show/home:mnhauke:osmocom:nightly

Related: OS#4550
Change-Id: Icb6f4335d5157f058b39701e9fcb332264911ba3
2020-05-19 17:08:28 +02:00
Philipp Maier 377fe5a645 doc: do not use loglevel info for log category ss
The log category ss uses info as loglevel vor ss, this is to verbose,
lets use notice instead.

Change-Id: I192a5f07cb7f45adb6f3af1c511b706738bdadf4
2020-05-12 13:34:13 +02:00
Neels Hofmeyr c7ea21357a esme_dgsm.py: add --always-fail option for debugging SMPP
Change-Id: Ibacf2676cae40712c89b57ced34085311d9a416d
2020-05-09 21:07:53 +00:00
Neels Hofmeyr 9b8e7b4e39 hlr_subscr_nam(): fix condition to fix nam=false notifications
Firstly, vlr_number[] is an array and we need to check the first char for nul
instead of the pointer.

Also, osmo_ipa_name_set_str() returns zero on success, so the condition is
reversed.

hlr_subscr_nam() was rewritten in I3a8dff3d4a1cbe10d6ab08257a0138d6b2a082d9
ad868e29ba and this likely fixes a bug introduced
there.

Related: coverity CID#210169
Change-Id: I3a0e9ed4b865c88aa4a6341a3bf1a96c10d20ed9
2020-05-04 19:24:26 +02:00
Neels Hofmeyr 010ceb8206 osmo_mslookup_server_mdns_rx(): handle read() rc == 0
Coverity says "tainted buffer", I hope it means the case of read() returning
zero.

Related: coverity CID#210170
Change-Id: Ia2d57cb8bbacc6f54dc410047da69a983aedd24d
2020-05-04 19:15:29 +02:00