549 Commits

Author SHA1 Message Date
Oliver Smith
d4b4548589 Generate version.h files
Related: OS#6626
Change-Id: I716821b2426c28fc2500fa8cdf44b7b8cb339d65
2025-06-23 14:16:06 +02:00
Oliver Smith
bb7d5b2a61 Bump version: 1.9.0.2-1a71e → 1.9.1
Change-Id: Ib8bdcee7a6fa4ae9821d9748a8a7ea4aecbea62e
1.9.1
2025-04-02 15:12:36 +02:00
Oliver Smith
1a71e73fdc db: flush after changing schema version
Flush the cache after changing the version, to make the scenario less
likely that after an unclean shutdown the DB gets restored with the
right table layout but wrong version.

When that happens, osmo-hlr tries to upgrade the database layout again
and fails with errors like "duplicate column name".

Related: SYS#7394
Change-Id: I5943a1cb3447c038c6e7972f68f9656b73a9248b
2025-03-17 14:43:12 +01:00
Pau Espin Pedrol
bb8591dfab Drop use of deprecated vty is_config_node() cb
This callback was drepecated and is not ever called since
libosmocore.git 70ce871532ab21955e0955d7e230eae65438f047 (release 1.3.0).

See also libosmocore.git d31de237582f6fe3315d61bb9a488d4cda92654e.

Change-Id: I0a77ff4c0a880230116a361651c78c77328db989
2025-03-04 18:21:43 +01:00
Oliver Smith
521fe02d41 Bump version: 1.8.0.15-74e4-dirty → 1.9.0
Change-Id: I1acb428ed42dd2217a734bedd286bbc60d0cc526
1.9.0
2025-02-12 12:17:53 +01:00
Pau Espin Pedrol
74e413c014 jenkins.sh: Use --disable-doxygen configure param
Change-Id: If5213e1080e22ad1fe87c61582a9cc4c2c164174
2024-12-10 22:32:01 +00:00
Pau Espin Pedrol
b08796d279 Drop unneeded use of abis/ipa.h header
Direct include of abis/ipa.h is not needed there, remove it to ease
later deprecation of such header.

Change-Id: I72d0787d4f5641a6a2fbe51427ac490120cbc616
2024-12-10 14:45:45 +01:00
Pau Espin Pedrol
35d4c5b376 gsup_client: Avoid double memset 0
Memory is already zeroed during talloc_zero, no need to reset it to
zero.

Change-Id: I66515fc893ffc64a36abedc01a75b57aed7e932d
2024-12-04 14:39:29 +01:00
Pau Espin Pedrol
558160be4b gsup_client: Add new APIs to avoid users accessing struct fields
This is a first step towards changing gsup_client implementation to use
an osmo_stream_cli instead of libosmo-abis' ipa_client_conn.
The libosmo-abis' ipa_client_conn will eventually be deprecated together
with all IPA related code in libosmo-abis.

In order to be able to make the implementation change, we first need to
make sure no users are using the struct fields of gsup_client (this
patch); 2nd step will be making the struct private by moving it to a
private header; 3rd step will be changing the implementation to use
osmo_stream.

Related: OS#5896
Change-Id: I401af83232022f1c141eef1f428cbe206a8aaaa2
2024-12-04 14:32:19 +01:00
Pau Espin Pedrol
e9dc7eaeda Drop use of libosmo-abis osmocom/abis/ipaccess.h
That header is only really used to provide an old hack for
ipaccess-proxy tool in openbsc.h/osmo-bsc.h, and will be deprecated
soon.

Take the chance to organize a bit better the includes based on dependency
chain.

Change-Id: I393cd23a09af6d1eefa68dc955415f4fe334d71b
2024-11-29 18:52:06 +01:00
Pau Espin Pedrol
19929d873b jenkins.sh: libosmo-netif no longer depends on libosmo-abis
Change-Id: I98b233e2ebb209803be5b6523bb1154ca694041c
Depends: libosmo-abis.git Change-Id I079dc3999de508301dd37ed03e399356a58d3cab
Depends: libosmo-netif.git Change-Id I13d6e88158f6d9ce017986283183ee9c2cc68cae
2024-11-21 14:49:03 +01:00
Mychaela N. Falconia
ada985a0ea change default no-proxy reject cause to net-fail
If LU has to be rejected because DGSM mechanism cannot reach the
needed HLR, then returning reject cause #17 (Network Failure)
is the most accurate and truthful description of what is actually
happening.

Reject cause #2 (IMSI unknown in HLR) is unlikely to be a good
choice: in areas where regular commercial cell services are present
alongside with experimental/adventurous Osmocom-based GSM networks,
this reject cause is acutely dangerous as described in the previous
commit, and even in areas where no regular commercial cell services
are present (the presumed intended use case for DGSM), the behavior
of commanding LU-failing phones "please don't ever again try to
connect to ANY network until the user power-cycles you" is unlikely
to be correct/desirable.  If that behavior _is_ desired, it should
be configured explicitly, not by default.

Change-Id: I557ae1d3291066a87228b5db4f2e207ea721329c
2024-11-21 03:33:38 +00:00
Mychaela N. Falconia
6b5616fd36 change default reject cause to plmn-not-allowed
Unless the Osmocom-based network operator has very carefully
considered what they are doing, returning MM/GMM reject cause #2
(IMSI unknown in HLR) to LU requests from bystander phones is a
very bad idea.  Here is what typically happens when someone sets
up an Osmocom-based GSM network for development, testing or
research, without roaming interconnection with any commercial
operators:

* Even when the private network operates its BTS at very low power
  levels, bystander phones in close proximity (e.g., in directly
  adjacent neighbor apartments or office suites) will receive a much
  stronger signal from the private/test network BTS than from any
  commercial operator, i.e., the private/test network will be
  the strongest signal.

* Many phones will attempt to "jump ship" to this strongest signal
  even if it broadcasts a completely unknown PLMN ID that is not in
  the preferred operator list, and even when they were previously
  not roaming at all, registered to their most preferred home operator
  with perfectly good reception quality.

* If these wayward phones receive reject cause #2 in response to their
  LU attempt, the spec effectively requires them to go into a "black
  hole" where they no longer attempt to register to any operator,
  including their own legitimate one.

Returning reject cause #11 instead (PLMN not allowed) solves this
problem: wayward phones that erroneously attempted to register to the
private/test network go back to their own legitimate commercial
operator, and everyone is happy.

This bug should be considered critical: when the reject cause is set
to #2 by default, any private Osmocom-based network, no matter how
low-power, will effectively cause service disruption to all nearby
commercially-served phones even when there is no clash in terms of
used radio frequencies.

Change-Id: Icff1d19670c398b119ec68b1d5f0fad87b605702
2024-11-21 03:33:38 +00:00
Mychaela N. Falconia
96dab5f886 vty: always emit reject-cause lines in saved config
When reject-cause (not-found|no-proxy) setting was added, it was
implemented such that the new setting is not written into saved
config files if it equals the default of 'imsi-unknown'.  Change
this behavior to always write out the current setting for each of
not-found and no-proxy, whether or not they match compiled-in
defaults.

Change-Id: I18708fc1c08a85e98582c97ec59dd3822a0767fb
2024-11-21 03:33:38 +00:00
Pau Espin Pedrol
db2f1f65da gsup: Replace deprecated ipa_msg_push_header()
Use the libosmocore API, which does the same except setting the l2h
pointer, which we don't really need here.

Change-Id: I7a4d05a0b09032d8133d8775fb4707a4da8f0cf3
2024-11-19 14:47:44 +01:00
Alexander Couzens
0451b13e0d debian/copyright: add gsup_client under GPLv2+
Change-Id: Idddcd6356af76987bf57ecd21096299cb2ba896f
2024-10-13 23:43:57 +02:00
Alexander Couzens
26c82ba2be gsupclient: add missing SPDX line
SPDX is a spec to describe the license of a file
in a machine readable format.

Change-Id: Iaded691cc0eb2f5dd85efd1915ddef1a747fe518
2024-10-13 23:39:26 +02:00
Alexander Couzens
e1aed27178 gsupclient: Introduce gsup_client_mux
GSUP supports different message classes (e.g. SMS, USSD, Subscriber management),
within a daemon, the messages are usually handled in different parts of it.
The gsup client mux allow to place callbacks for the different message class.

This code original comes from the osmo-msc code and is here
re-licensed under the GPLv2.

Change-Id: I916c1bb6cfc48f92fc5db2b5c914eb1b4e25fa7f
2024-10-13 23:31:45 +02:00
Vadim Yanitskiy
7c06eea5b2 subscriber-create-on-demand: add mode for MSISDN=IMSI
In may be desirable for some users to assign deterministic MSISDNs
when subscriber-create-on-demand is enabled.  This can be achieved
by assigning MSISDN=IMSI.  This commit adds a new mode for that.

Change-Id: I3470492f5e46de7246d9a74e80c37f80f455d851
2024-08-22 02:32:07 +07:00
Vadim Yanitskiy
d4693f652a subscriber-create-on-demand: rework configuration
This commit prepares for adding a new subscriber-create-on-demand
mode (MSISDN=IMSI), which is implemented in a follow-up patch.

* add an enumerated type for subscriber-create-on-demand mode;
* store the related parameters in an anonymous structure.

Change-Id: Ib553172655f83dad1ac0e0254615c8c207d79ca9
2024-08-07 16:20:14 +07:00
Oliver Smith
c819234a42 Bump version: 1.7.0.17-bae13 → 1.8.0
Change-Id: I3b05d5ac5417f5c995e7057474adba72326ebf11
1.8.0
2024-07-24 16:22:50 +02:00
Oliver Smith
bae137d9eb mslookup: don't ignore return value of write()
Fix GCC 13.2.0 refuses to build this with -Werror:

src/mslookup/osmo-mslookup-client.c: In function 'socket_client_respond_result':
src/osmo-hlr/src/mslookup/osmo-mslookup-client.c:432:9: error: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  432 |         write(c->ofd.fd, response, strlen(response));
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/mslookup/osmo-mslookup-client.c: In function 'socket_accept':
src/osmo-hlr/src/mslookup/osmo-mslookup-client.c:530:17: error: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Werror=unused-result]
  530 |                 write(c->ofd.fd, CSV_HEADERS, strlen(CSV_HEADERS));
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: I4b2e5cabe5306a999197f7c98362d872a3739078
2024-07-03 10:45:25 +02:00
Vadim Yanitskiy
413f5e3670 README.md: cosmetic: fix a typo
Change-Id: Idd4270a74c2a9921943606c1157343f4756b1643
2024-06-05 18:34:07 +07:00
Oliver Smith
6b771e34bd debian/postinst: add checks, be verbose
Do not attempt to change permissions/ownership if the package gets
upgraded from a version higher than the next release.

Do not fail if the user deleted the config file.

Be verbose when changing permissions.

Related: OS#4107
Change-Id: I1bcbe414fd18101e4d875a16539deab7baf9cb5f
2024-05-15 11:47:40 +00:00
Oliver Smith
a005ad6495 contrib: remove rpm spec file
Related: https://osmocom.org/news/255
Related: OS#6446
Change-Id: Idd67d52ca736c4e145387ea8d4030f9cf4b9596d
2024-05-08 14:40:58 +02:00
Oliver Smith
e391c4c58d .deb/.rpm: various fixes related to non-root
* Explicitly chown /var/lib/osmocom to osmocom:osmocom, instead of
  relying on systemd to do it when the service starts up. This does not
  work with the systemd versions in debian 10 and almalinux 8.
* deb: Use "useradd" instead of the interactive "adduser" perl script
  from Debian. This makes it consistent with how we do it in rpm, and
  avoids the dependency on "adduser".
* deb: Remove support for the "dpkg-statoverride --list" logic. This
  seems to be a rather obscure feature to override permissions for
  certain files or directories. Let's rather remove this complexity to
  make the postinst script more maintainable and more similar to the
  rpm spec file. If users need this, they can achieve something similar
  by using their own Osmocom config file in a different path with
  different permissions.
* deb: Consistently use tabs throughout postinst, instead of mixing
  tabs and spaces.

Related: OS#4107
Change-Id: Ib20406dd253f5e8720552e92e9002e45591218fa
2024-04-26 15:07:32 +02:00
Max
a26abc6aa8 .deb/.rpm: add osmocom user during package install
Created osmocom user & group during package installation.
Fix the configuration dir/files permission to match.

Related: OS#4107
Tweaked-By: Oliver Smith <osmith@sysmocom.de>
Change-Id: I625c993ab03dfe32976c651acca9c35c33a768e7
2024-04-24 11:52:09 +02:00
Harald Welte
da4fc0eab9 README.md: Add Forum and Issue Tracker sections
Change-Id: Ic88d30fc8952762565af6115c8bb7d67fa7d7866
2024-03-23 17:28:12 +01:00
Harald Welte
507315eed8 README.md: Improve mark-down formatting
Change-Id: Ib608ec568572af672934d1e2960e1dabc3a2a45c
2024-03-23 17:26:19 +01:00
Harald Welte
72f92e28c9 Add funding link to github mirror
see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository

Change-Id: I935ec923362fd8d3f03a8db8e93e033f86f0a5ac
2024-03-23 17:22:45 +01:00
Vadim Yanitskiy
ac1365fddf build: include {README.md,git-version-gen} into the release tarball
Change-Id: I072b5899ac77326f619d351f17aa78490946f452
2024-01-26 23:33:48 +07:00
Mychaela N. Falconia
be8bcd30eb ctrl: add subscriber.by-*.imsi GET-able variable
There may be a need in various OsmoCNI-attached entities (for example,
external SMSC implementations) to perform a mapping from known MSISDN
to unknown IMSI, querying OsmoHLR subscriber db for it.  Querying for
subscriber.by-msisdn-*.imsi will be much more efficient (and easier on
client-side implementors) than querying for subscriber.by-msisdn-*.info
and fishing the IMSI out of the long multiline response, discarding all
other irrelevant info.

Related: OS#6312
Change-Id: Icea1a74d0c664047f46758ab4ad75508782f3d12
2023-12-17 21:47:21 +00:00
Andreas Eversberg
947e137918 Use uniform log format for default config files
Related: OS#6272
Change-Id: I4319b688286845d2ffbd944e51e9cc2e5159563c
2023-12-01 12:41:19 +01:00
Mychaela N. Falconia
e513c43857 SMS over GSUP: handle READY-FOR-SM.req from MSCs
When an MS indicates that it is ready to receive MT SMS, the MSC will
send us a READY-FOR-SM.req message.  Handle it by sending copies of
the same message to all connected SMSCs and returning OK result
to the MS that indicates its ready status.

Related: OS#6135
Change-Id: I731545a3a0d0804289e24a7769e13bfd3f645132
2023-09-21 02:06:58 +00:00
Mychaela N. Falconia
f6a303c669 SMS over GSUP: implement forwarding of MT SMS
When an SMSC tries to deliver an SM to a subscriber, it will send us
an MT-forwardSM.req GSUP message.  We look up the subscriber by IMSI
and see if they are attached to a VLR.  If the subscriber is attached,
we forward the message to the MSC/VLR, otherwise return an error
to the SMSC.

Related: OS#6135
Change-Id: Ib3551bf7839690606c677461758c5cfef5f0aa7b
2023-09-21 02:06:49 +00:00
Mychaela N. Falconia
786ec5b91c SMS over GSUP: implement forwarding of MO SMS
MO-forwardSM.req messages are now forwarded to a connected SMSC
based on the SMSC address (SM-RP-DA) in the MO SM and the vty-defined
mapping from SMSC numeric addresses to IPA names.

Related: OS#6135
Depends: Iea5c29909c5be80f81dbbc2873656ff5cf590a5d (libosmocore)
Change-Id: Iaad4531922c41583d261c79f42561a1bdbe03521
2023-09-21 02:05:15 +00:00
Mychaela N. Falconia
ff7c7ea085 SMS over GSUP: implement vty config of SMSC routing
At the user-visible level (advanced settings menus on phones,
GSM 07.05 AT commands, SIM programming) each SMSC is identified
by a numeric address that looks like a phone number, originally
meant to be a Global Title.  OsmoMSC passes these SMSC addresses
through as-is to MO-forwardSM.req GSUP message - however, SMSCs
that connect to OsmoHLR via GSUP identify themselves by their
IPA names instead.  Hence we need a mapping mechanism in OsmoHLR
config.

To accommodate different styles of network design ranging from
strict recreation of classic GSM architecture to guest roaming
arrangements, a two-level configuration is implemented, modeled
after EUSE/USSD configuration: first one defines which SMSCs exist
as entities, identified only by their IPA names, and then one
defines which numeric SMSC address (in SM-RP-DA) should go to which
configured SMSC, with the additional possibility of a default route.

Related: OS#6135
Change-Id: I1624dcd9d22b4efca965ccdd1c74f0063a94a33c
2023-09-21 01:56:21 +00:00
Vadim Yanitskiy
fa6af8872f hlr_vty.c: drop redundant include of hlr_ussd.h
Change-Id: Ia873c3ea7fb76cb83628811f159e9d5f2de8dcbd
2023-09-17 02:04:05 +00:00
Pau Espin Pedrol
d052f076e3 Bump version: 1.6.0.20-37f0-dirty → 1.7.0
Change-Id: I3f169ff8f9b10a4d4b5c50286951d326fa713245
1.7.0
2023-09-12 14:41:34 +02:00
Alexander Couzens
37f0b3a8f3 Add support for multiple APN profiles for subscriber data
Previously the HLR sent in the Insert Subscriber Data call only the
wildcard APN as a single entry.
This violates the spec because the first entry (with the lowest context_id) is
always the default APN, but it is forbidden to have a wildcard APN as default apn.

Introduce a default template/profile which can contain multiple APNs.
This profile is always sent out to the SGSN/MME as part of Insert-Subscriber-Data.
In the future a subscriber might have a profile template name written into the
database which will resolve to a "pdp-profile premium" in the configuration.

To be backward compatible, if the pdp-profile default section is missing,
the HLR will send out only a wildcard APN.

Config example:

hlr
 ps
  pdp-profile default
   profile 1
    apn internet
   profile 2
    apn *

Changes to the apn list will be only handed out to subscribers
when the subscriber do a location update.

Related: SYS#6391
Change-Id: I540132ee5dcfd09f4816e02e702927e1074ca50f
2023-09-12 09:48:02 +00:00
Harald Welte
7a763aa012 Add VTY support for TUAK algorithm
Change-Id: If2611658f7cb990b484d7429ab2f944f56fd2eb6
Depends: libosmocore.git Ib905b8d8bdf248e8299bf50666ee1bca8298433d
2023-08-29 13:42:41 +00:00
Harald Welte
626f5eb740 db: extend database schema to support 256bit K and/or OP[c] values
Other UMTS AKA algorithms than MILENAGE (notably TUAK) support K sizes
of up to 256bit, or mandate a OP/OPc size of 256 bit.

Let's extend our database schema to accommodate such larger sizes.

Change-Id: Ibbde68484c904507a15c35cbfdf88cd47d0c7039
2023-08-29 13:42:41 +00:00
Vadim Yanitskiy
5800f3add5 USSD: fix handling of ussd-DataCodingScheme != 0x0f
The usual Data Coding Scheme value in the mobile-originated USSD
request (processUnstructuredSS-Request) is 0x0f, which means:

  0000 .... = Coding Group: Coding Group 0 (Language using the GSM 7 bit default alphabet)
  .... 1111 = Language: unspecified

However some modems are known to use a different default value, if
not specified explicitly (AT+CUSD has optional DCS parameter):

  0000 .... = Coding Group: Coding Group 0 (Language using the GSM 7 bit default alphabet)
  .... 0000 = Language: German (0)

In function rx_proc_ss_req(), we should not be using req.ussd_text,
because this field has been deprecated and may contain unexpected
data.  For example, in the abovementioned case it would contain the
7 bit encoded ussd-String 'aa510c061b01'O and osmo-hlr would indeed
fail to find a matching route for a non-ASCII string.

Instead of relaying on gsm0480_parse_facility_ie(), let's check the
Data Coding Scheme value and decode the request string ourselves.
Expect the Coding Group 0, but be more tolerant to the indicated
language: print a warning and treat it as '1111'B (unspecified).

Change-Id: Ib7bac660b1a7942adcfbe7b14f162c95061a25db
Related: OS#6075
2023-07-21 12:49:20 +00:00
Vadim Yanitskiy
f8b73f0682 gsup_server: fix msgb memleak in osmo_gsup_server_read_cb()
I noticed that inability to send IPA PONG in response to IPA PING
from osmo-{msc,sgsn} results in an "IPA Multiplex" chunk being leaked.

No matter what's returned from ipa_server_conn_ccm(), we need to free
the msgb containing the incoming IPA message.

Change-Id: I5c5acbffc2913f78db4894ae3633b5eca9c2e8d6
2023-07-05 01:10:43 +07:00
Vadim Yanitskiy
f4223f5b53 ussd: fix GSUP memleaks in rx_proc_ss_{req,error}()
Also take a chance to use a more suitable error cause value.

Change-Id: I22ba5ad470989b7e8ba8fe2be170eac4adcb48c5
2023-07-05 00:24:19 +07:00
Vadim Yanitskiy
1c23f304d1 lu_fsm: fix memleak in lu_fsm_wait_insert_data_result()
Currently osmo-hlr leaks memory (msgb holding 1203 bytes of data and
a struct osmo_gsup_req) on receipt of OSMO_GSUP_MSGT_INSERT_DATA_ERROR.

Change-Id: I4c70a06169158c869360707a7a62436dbf13b9b3
2023-07-05 00:15:17 +07:00
Harald Welte
f4159bd54c src/db.c: Switch from "const char *statements" to "const char * const"
This is primarily to make the linter happy, which spews "static const
char * array should probably be static const char * const" errors in
gerrit when adding similar new code to this existing file.  So let's
first convert the old code and then add new code that makes the linter
happy.  I guess it does have a point, as both the individual string
pointers as well as the array of the pointers are constant.

Change-Id: I39e9fb6bd8052f4878cfc95061775bf940631ae5
2023-06-14 14:53:07 +02:00
Harald Welte
a854b48762 Port to new libosmogsm 'struct osmo_sub_auth_data2'
libosmogsm has recently introdcued a 'struct osmo_sub_auth_data2' as
successor to 'struct osmo_sub_auth_data', together with updated
osmo_auth_gen_vec2/osmo_auth_gen_vec_auts2 API.

The rationale of this new API is to enable
* support for AKA algorithms which use K and/or OP[c] values of 256bit
  (instead of the classic 128bit)
* support for RES length sizes of 4 and 16 bytes (instead of the classic
  8 bytes)

This commit just jumps over to the new API without adding any related
functionality to osmo-hlr.  The latter is left for subsequent commits.

Change-Id: I3207c7bfb73e9ff5471e5c26b66639549e4d48a2
Depends: libosmocore.git Ie775fedba4a3fa12314c0f7c8a369662ef6a40df
2023-06-14 14:53:04 +02:00
Harald Welte
91150802f8 cosmetic: gen_ts_55_205_test_sets/main_template tabs istead of spaces
Let's consistently use our normal tab indent style

Change-Id: I4172b59131ac4166174c1860fcb07b7bee3df728
2023-06-03 19:32:44 +02:00
Harald Welte
8f3fa656e7 cosmetic: gen_ts_55_205_test_sets/func_template.c: Use tab-indent
This templates is used for generating C code, so it should use our
normal tab-based code indenting.

Change-Id: I0be7eb2d7b551d7eaaee15994ef37262694819f6
2023-06-03 19:29:46 +02:00