Commit Graph

447 Commits

Author SHA1 Message Date
Oliver Smith 4de6dad64d Bump version: 1.3.0.1-9fee → 1.3.1
Change-Id: I1d11caf44d9054e1be3b463ee36e22a4518a7f2a
2021-09-06 15:48:52 +02:00
Oliver Smith 9feec727ae debian/control: remove dh-systemd build-depend
Related: OS#5223
Change-Id: Ieb8669a9a43ea1acc6b2d8d2e363f2466c51697a
2021-09-06 15:46:22 +02: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
Neels Hofmeyr 1bd3ec49b1 gsup_server.c: properly handle negative rc from osmo_gsup_conn_ccm_get()
Related: coverity CID#210171
Change-Id: I5b56fe33cbc75679a3fffc034a53f06cd0e4043b
2020-05-04 17:53:52 +02:00
Neels Hofmeyr dfe6f41c81 osmo_gsup_req_new(): require from_peer != NULL
In practice, from_peer is always non-NULL, yet some conditions checked against
NULL, looking like a possible NULL deref. Require non-NULL.

Related: coverity CID#210172
Change-Id: I3cb73ec0d31f84d4b613ecb026169c944d240e4c
2020-05-04 17:37:15 +02:00
Neels Hofmeyr 3e79a38440 make osmo_cni_peer_id_cmp() NULL safe
Related: coverity CID#210172
Change-Id: I400b23ac3f0eb68d5e4c757ea02d130fbe12f80b
2020-05-04 17:33:36 +02:00
Neels Hofmeyr a450a85956 auc3g: officially wrap IND around IND_bitlen space
To determine distinct IND pools for each connected VLR, we need to pick ever
increasing values for any new peer showing up. Each subscriber's individual
IND_bitlen is then required to modulo the least significant N of bits that fit
in its IND_bitlen to effectively round-robin in the available IND pool space.
So far we did that but issued a warning message. This is actually exactly what
we want and it doesn't need to be treated like it weren't so.

Change-Id: I716d8a8a249235c8093d7a6a78b3535d893d867e
2020-04-30 19:22:24 +02:00
Neels Hofmeyr 26b4905e7f vty: show subscriber: show lu d,h,m,s ago, not just seconds
Change-Id: I0fe34e0f065160ef959b2b7b4dd040f3f2985f43
2020-04-30 19:22:24 +02:00
Neels Hofmeyr d9b3606234 vty: show subscriber: change format of 'last LU seen'
So far, the time string format comes from ctime_r, and we manually add "UTC" to it.

The ctime_r format is wildly chaotic IMHO, mixing weekday, day-of-month and
hour and year in very unsorted ways.

Adding "UTC" to it is non-standard.

Instead use an ISO-8601 standardized time string via strftime().

Change-Id: I6731968f05050399f4dd43b241290186e0c59e1a
2020-04-30 19:22:24 +02:00
Neels Hofmeyr 0d82a87c0d drop error log for when a subscriber does not exist
Checking for existence of a subscriber and seeing that there is none is not
inherently an error. However, osmo-hlr currently logs on all occasions:

  DAUC ERROR Cannot read subscriber from db: MSISDN='1001': No such subscriber

This spams the ERROR log level. Particularly when a D-GSM setup does subscriber
existence checks for every incoming mslookup request, that potentially creates
constant ERROR logging.

The "No such subscriber" part comes from db_sel(), which might also return an
sqlite3_errmsg(). We still want those sqlite3_errmsg()es in the ERROR log.

Hence print an ERROR log only if db_sel() returns an rc != -ENOENT.

Change-Id: I5044e9b4519b948edc4e451cef0f7830d315619b
2020-04-30 19:22:24 +02:00
Neels Hofmeyr 9489a9ce4b adoc: add D-GSM chapter to osmohlr-usermanual
Change-Id: I392b5523870c2ef3267179160028d26f3f761b77
2020-04-30 19:22:24 +02:00
Oliver Smith edc27ef390 hlr_vty_subscr: prettier output for last LU seen
Extend the "last LU seen on ..." line with the amount of seconds that
passed since now, or "(invalid timestamp)".

Patch split from Id7fc50567211a0870ac0524f6dee94d4513781ba, because it
depends on timestamp_age which was just added in
Ife4a61d71926d08f310a1aeed9d9f1974f64178b.

Change-Id: I24f9e86c1aa0b1576290094e024562f41b988f37
2020-04-30 19:22:24 +02:00
Neels Hofmeyr af748923bd gsup_server: send routing error back to the correct peer
If a peer attempts to add a route to an ipa-name that we already have in the
routing system, don't send the routing error to the peer that already has the
name, but to the peer that attempts to re-use it and would cause the collision.

This is fixing a situation where for example a locally attached MSC has name
'MSC-1', and a remote site is proxying GSUP here for a remote MSC that also has
the name 'MSC-1'. Send the routing error back to the proxy, not local 'MSC-1'.

Change-Id: Icafaedc11b5925149d338bdcb987ae985a7323d6
2020-04-30 19:22:24 +02:00
Neels Hofmeyr 76328bdc91 D-GSM 3/n: implement roaming by mslookup in osmo-hlr
Add mslookup client to find remote home HLRs of unknown IMSIs, and
proxy/forward GSUP for those to the right remote HLR instances.

Add remote_hlr.c to manage one GSUP client per remote HLR GSUP address.

Add proxy.c to keep state about remotely handled IMSIs (remote GSUP address,
MSISDN, and probably more in future patches).  The mslookup_server that
determines whether a given MSISDN is attached locally now also needs to look in
the proxy record: it is always the osmo-hlr immediately peering for the MSC
that should respond to mslookup service address queries like SIP and SMPP.
(Only gsup.hlr service is always answered by the home HLR.)

Add dgsm.c to set up an mdns mslookup client, ask for IMSI homes, and to decide
which GSUP is handled locally and which needs to go to a remote HLR.

Add full VTY config and VTY tests.

For a detailed overview of the D-GSM and mslookup related files, please see the
elaborate comment at the top of mslookup.c (already added in an earlier patch).

Change-Id: I2fe453553c90e6ee527ed13a13089900efd488aa
2020-04-30 19:22:24 +02:00
Neels Hofmeyr 407925dcab D-GSM 2/n: implement mDNS method of mslookup server
Implement the mslookup server's mDNS responder, to actually service remote
mslookup requests:
- VTY mslookup/server config with service names,
- the mslookup_mdns_server listening for mslookup requests,

For a detailed overview of the D-GSM and mslookup related files, please see the
elaborate comment at the top of mslookup.c (already added in an earlier patch).

Change-Id: I5cae6459090588b4dd292be90a5e8903432669d2
2020-04-30 19:22:24 +02:00
Neels Hofmeyr ab7dc40f16 D-GSM 1/n: add mslookup server in osmo-hlr
Implement the mslookup server to service remote mslookup requests.

This patch merely adds the logic to answer incoming mslookup requests, an
actual method to receive requests (mDNS) follows in a subsequent patch.

- API to configure service names and addresses for the local site (per MSC).
- determine whether a subscriber is on a local MSC
  (checking the local proxy will be added in subsequent patch that adds proxy
  capability).
- VTY config follows in a subsequent patch.

For a detailed overview of the D-GSM and mslookup related files, please see the
elaborate comment at the top of mslookup.c (already added in an earlier patch).

Change-Id: Ife4a61d71926d08f310a1aeed9d9f1974f64178b
2020-04-30 19:22:24 +02:00