Projects
osmocom:latest
osmo-hlr
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 4
View file
osmo-hlr.spec
Changed
@@ -15,13 +15,14 @@ Name: osmo-hlr Requires: osmocom-latest -Version: 1.5.0 +Version: 1.6.0 Release: 0 Summary: Osmocom Home Location Register for GSUP protocol towards OsmoSGSN and OsmoCSCN License: AGPL-3.0-or-later AND GPL-2.0-or-later Group: Productivity/Telephony/Servers URL: https://osmocom.org/projects/osmo-hlr -Source: osmo-hlr_1.5.0.tar.xz +Source: osmo-hlr_1.6.0.tar.xz +Source1: rpmlintrc BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool @@ -30,11 +31,11 @@ %if 0%{?suse_version} BuildRequires: systemd-rpm-macros %endif -BuildRequires: pkgconfig(libosmoabis) >= 1.3.0 -BuildRequires: pkgconfig(libosmocore) >= 1.7.0 -BuildRequires: pkgconfig(libosmoctrl) >= 1.7.0 -BuildRequires: pkgconfig(libosmogsm) >= 1.7.0 -BuildRequires: pkgconfig(libosmovty) >= 1.7.0 +BuildRequires: pkgconfig(libosmoabis) >= 1.4.0 +BuildRequires: pkgconfig(libosmocore) >= 1.8.0 +BuildRequires: pkgconfig(libosmoctrl) >= 1.8.0 +BuildRequires: pkgconfig(libosmogsm) >= 1.8.0 +BuildRequires: pkgconfig(libosmovty) >= 1.8.0 BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(talloc) >= 2.0.1 # only needed for populate_hlr_db.pl @@ -78,13 +79,13 @@ This subpackage contains libraries and header files for developing applications that want to make use of libosmo-gsup-client. -%package -n libosmo-mslookup0 +%package -n libosmo-mslookup1 Requires: osmocom-latest Summary: Osmocom MS lookup library License: GPL-2.0-or-later Group: System/Libraries -%description -n libosmo-mslookup0 +%description -n libosmo-mslookup1 This shared library contains routines for looking up mobile subscribers. %package -n libosmo-mslookup-devel @@ -92,7 +93,7 @@ Summary: Development files for the Osmocom MS lookup library License: GPL-2.0-or-later Group: Development/Libraries/C and C++ -Requires: libosmo-mslookup0 = %{version} +Requires: libosmo-mslookup1 = %{version} %description -n libosmo-mslookup-devel This shared library contains routines for looking up mobile subscribers. @@ -113,7 +114,7 @@ subscriber. %prep -%setup -q +%setup -n osmo-hlr -q %build echo "%{version}" >.tarball-version @@ -152,8 +153,8 @@ %post -n libosmo-gsup-client0 -p /sbin/ldconfig %postun -n libosmo-gsup-client0 -p /sbin/ldconfig -%post -n libosmo-mslookup0 -p /sbin/ldconfig -%postun -n libosmo-mslookup0 -p /sbin/ldconfig +%post -n libosmo-mslookup1 -p /sbin/ldconfig +%postun -n libosmo-mslookup1 -p /sbin/ldconfig %files %license COPYING @@ -185,8 +186,8 @@ %{_libdir}/libosmo-gsup-client.so %{_libdir}/pkgconfig/libosmo-gsup-client.pc -%files -n libosmo-mslookup0 -%{_libdir}/libosmo-mslookup.so.0* +%files -n libosmo-mslookup1 +%{_libdir}/libosmo-mslookup.so.1* %files -n libosmo-mslookup-devel %dir %{_includedir}/osmocom
View file
osmo-hlr_1.5.0.dsc -> osmo-hlr_1.6.0.dsc
Changed
@@ -1,26 +1,26 @@ Format: 3.0 (native) Source: osmo-hlr -Binary: osmo-hlr, osmo-hlr-dbg, libosmo-gsup-client0, libosmo-gsup-client-dev, libosmo-mslookup0, libosmo-mslookup-dev, osmo-mslookup-utils, osmo-hlr-doc +Binary: osmo-hlr, osmo-hlr-dbg, libosmo-gsup-client0, libosmo-gsup-client-dev, libosmo-mslookup1, libosmo-mslookup-dev, osmo-mslookup-utils, osmo-hlr-doc Architecture: any all -Version: 1.5.0 +Version: 1.6.0 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/osmo-hlr Standards-Version: 3.9.6 Vcs-Browser: https://gitea.osmocom.org/cellular-infrastructure/osmo-hlr Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/osmo-hlr -Build-Depends: debhelper (>= 9), pkg-config, dh-autoreconf, autotools-dev, python3-minimal, libosmocore-dev (>= 1.7.0), libosmo-abis-dev (>= 1.3.0), libosmo-netif-dev (>= 1.2.0), libsqlite3-dev, sqlite3, osmo-gsm-manuals-dev (>= 1.3.0) +Build-Depends: debhelper (>= 9), pkg-config, dh-autoreconf, autotools-dev, python3-minimal, libosmocore-dev (>= 1.8.0), libosmo-abis-dev (>= 1.4.0), libosmo-netif-dev (>= 1.3.0), libsqlite3-dev, sqlite3, osmo-gsm-manuals-dev (>= 1.4.0) Package-List: libosmo-gsup-client-dev deb net optional arch=any libosmo-gsup-client0 deb libs optional arch=any libosmo-mslookup-dev deb net optional arch=any - libosmo-mslookup0 deb libs optional arch=any + libosmo-mslookup1 deb libs optional arch=any osmo-hlr deb net optional arch=any osmo-hlr-dbg deb debug extra arch=any osmo-hlr-doc deb doc optional arch=all osmo-mslookup-utils deb utils optional arch=any Checksums-Sha1: - 0670110acba6b51b9e1f9f27cafb4cb0c7b1581a 171872 osmo-hlr_1.5.0.tar.xz + 962367515c78ae0f2098293f3ea9985ce7dd5eea 172096 osmo-hlr_1.6.0.tar.xz Checksums-Sha256: - 8cf694124d443619b05a12838e308b137a5b7a0c10766db01860cd8731c1dbb5 171872 osmo-hlr_1.5.0.tar.xz + 91eabd5b6343ea90cf12fc000ed6c959b854f10ceca4724b0cd6a1ab6d05028c 172096 osmo-hlr_1.6.0.tar.xz Files: - b80a9edb0732c6c5b4c9b315a729bd8e 171872 osmo-hlr_1.5.0.tar.xz + 5dfae2988995f37d795ee3b5d5942751 172096 osmo-hlr_1.6.0.tar.xz
View file
osmo-hlr_1.5.0.tar.xz/.tarball-version -> osmo-hlr_1.6.0.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.5.0 \ No newline at end of file +1.6.0
View file
osmo-hlr_1.5.0.tar.xz/configure.ac -> osmo-hlr_1.6.0.tar.xz/configure.ac
Changed
@@ -41,11 +41,11 @@ PKG_CHECK_MODULES(TALLOC, talloc >= 2.0.1) -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.7.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.7.0) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.7.0) -PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.7.0) -PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 1.3.0) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.8.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.8.0) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.8.0) +PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.8.0) +PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 1.4.0) PKG_CHECK_MODULES(SQLITE3, sqlite3) @@ -93,6 +93,7 @@ if test x"$werror" = x"yes" then WERROR_FLAGS="-Werror" + WERROR_FLAGS+=" -Werror=implicit-int -Werror=int-conversion -Werror=old-style-definition" WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations" WERROR_FLAGS+=" -Wno-error=cpp" # "#warning" CFLAGS="$CFLAGS $WERROR_FLAGS"
View file
osmo-hlr_1.5.0.tar.xz/contrib/osmo-hlr.spec.in -> osmo-hlr_1.6.0.tar.xz/contrib/osmo-hlr.spec.in
Changed
@@ -14,6 +14,7 @@ # published by the Open Source Initiative. Name: osmo-hlr +Requires: osmocom-latest Version: @VERSION@ Release: 0 Summary: Osmocom Home Location Register for GSUP protocol towards OsmoSGSN and OsmoCSCN @@ -29,11 +30,11 @@ %if 0%{?suse_version} BuildRequires: systemd-rpm-macros %endif -BuildRequires: pkgconfig(libosmoabis) >= 1.3.0 -BuildRequires: pkgconfig(libosmocore) >= 1.7.0 -BuildRequires: pkgconfig(libosmoctrl) >= 1.7.0 -BuildRequires: pkgconfig(libosmogsm) >= 1.7.0 -BuildRequires: pkgconfig(libosmovty) >= 1.7.0 +BuildRequires: pkgconfig(libosmoabis) >= 1.4.0 +BuildRequires: pkgconfig(libosmocore) >= 1.8.0 +BuildRequires: pkgconfig(libosmoctrl) >= 1.8.0 +BuildRequires: pkgconfig(libosmogsm) >= 1.8.0 +BuildRequires: pkgconfig(libosmovty) >= 1.8.0 BuildRequires: pkgconfig(sqlite3) BuildRequires: pkgconfig(talloc) >= 2.0.1 # only needed for populate_hlr_db.pl @@ -52,6 +53,7 @@ services (like supplementary services). %package -n libosmo-gsup-client0 +Requires: osmocom-latest Summary: Osmocom GSUP (General Subscriber Update Protocol) client library License: GPL-2.0-or-later Group: System/Libraries @@ -62,6 +64,7 @@ and External USSD Entities (EUSEs) using this library to implement clients. %package -n libosmo-gsup-client-devel +Requires: osmocom-latest Summary: Development files for the Osmocom GSUP client library License: GPL-2.0-or-later Group: Development/Libraries/C and C++ @@ -75,19 +78,21 @@ This subpackage contains libraries and header files for developing applications that want to make use of libosmo-gsup-client. -%package -n libosmo-mslookup0 +%package -n libosmo-mslookup1 +Requires: osmocom-latest Summary: Osmocom MS lookup library License: GPL-2.0-or-later Group: System/Libraries -%description -n libosmo-mslookup0 +%description -n libosmo-mslookup1 This shared library contains routines for looking up mobile subscribers. %package -n libosmo-mslookup-devel +Requires: osmocom-latest Summary: Development files for the Osmocom MS lookup library License: GPL-2.0-or-later Group: Development/Libraries/C and C++ -Requires: libosmo-mslookup0 = %{version} +Requires: libosmo-mslookup1 = %{version} %description -n libosmo-mslookup-devel This shared library contains routines for looking up mobile subscribers. @@ -97,6 +102,7 @@ %package -n osmo-mslookup-client +Requires: osmocom-latest Summary: Standalone program using libosmo-mslookup License: GPL-2.0-or-later Group: Development/Libraries/C and C++ @@ -146,8 +152,8 @@ %post -n libosmo-gsup-client0 -p /sbin/ldconfig %postun -n libosmo-gsup-client0 -p /sbin/ldconfig -%post -n libosmo-mslookup0 -p /sbin/ldconfig -%postun -n libosmo-mslookup0 -p /sbin/ldconfig +%post -n libosmo-mslookup1 -p /sbin/ldconfig +%postun -n libosmo-mslookup1 -p /sbin/ldconfig %files %license COPYING @@ -179,8 +185,8 @@ %{_libdir}/libosmo-gsup-client.so %{_libdir}/pkgconfig/libosmo-gsup-client.pc -%files -n libosmo-mslookup0 -%{_libdir}/libosmo-mslookup.so.0* +%files -n libosmo-mslookup1 +%{_libdir}/libosmo-mslookup.so.1* %files -n libosmo-mslookup-devel %dir %{_includedir}/osmocom
View file
osmo-hlr_1.5.0.tar.xz/contrib/systemd/osmo-hlr.service -> osmo-hlr_1.6.0.tar.xz/contrib/systemd/osmo-hlr.service
Changed
@@ -5,8 +5,11 @@ Service Type=simple Restart=always +StateDirectory=osmocom +WorkingDirectory=%S/osmocom ExecStart=/usr/bin/osmo-hlr -c /etc/osmocom/osmo-hlr.cfg -l /var/lib/osmocom/hlr.db RestartSec=2 +ProtectHome=true Install WantedBy=multi-user.target
View file
osmo-hlr_1.5.0.tar.xz/debian/changelog -> osmo-hlr_1.6.0.tar.xz/debian/changelog
Changed
@@ -1,3 +1,42 @@ +osmo-hlr (1.6.0) unstable; urgency=medium + + Vadim Yanitskiy + * db_auc: hexparse_stmt(): check value returned by osmo_hexparse() + + Max + * Set working directory in systemd service file + * Ignore .deb build byproducts + * Debian: bump copyright year to match current + * Debian: reformat package description + * systemd: enable basic hardening + * Debian: install osmo-hlr-dgsm.cfg as example config + * hlr_vty.c: fix typo + * ctrl: take both address and port from vty config + + Harald Welte + * Support building with -Werror=strict-prototypes / -Werror=old-style-definition + * Add -Werror=implicit-int -Werror=int-conversion -Werror=old-style-definition + + arehbein + * osmo-hlr: Transition to use of 'telnet_init_default' + + Oliver Smith + * osmo_mdns_rfc_record_decode: check ret of talloc + * osmo_mdns_rfc_record_decode: proper free on err + * mslookup: use apn functions from libosmocore + * osmo_mdns_rfc_record/question_encode: remove ctx + + Keith + * Vty: Fixup config shown/written from vty + + Neels Hofmeyr + * fix memleak of proxy_subscr_listentry + + Alexander Couzens + * Add vty `reject-cause` to set the reject cause + + -- Pau Espin Pedrol <pespin@sysmocom.de> Tue, 07 Feb 2023 16:49:14 +0100 + osmo-hlr (1.5.0) unstable; urgency=medium Oliver Smith
View file
osmo-hlr_1.5.0.tar.xz/debian/control -> osmo-hlr_1.6.0.tar.xz/debian/control
Changed
@@ -7,12 +7,12 @@ dh-autoreconf, autotools-dev, python3-minimal, - libosmocore-dev (>= 1.7.0), - libosmo-abis-dev (>= 1.3.0), - libosmo-netif-dev (>= 1.2.0), + libosmocore-dev (>= 1.8.0), + libosmo-abis-dev (>= 1.4.0), + libosmo-netif-dev (>= 1.3.0), libsqlite3-dev, sqlite3, - osmo-gsm-manuals-dev (>= 1.3.0) + osmo-gsm-manuals-dev (>= 1.4.0) Standards-Version: 3.9.6 Vcs-Browser: https://gitea.osmocom.org/cellular-infrastructure/osmo-hlr Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/osmo-hlr @@ -22,8 +22,9 @@ Architecture: any Depends: osmocom-latest, ${shlibs:Depends}, ${misc:Depends} Description: Osmocom Home Location Register - OsmoHLR is a Osmocom implementation of HLR (Home Location Registrar) which works over GSUP - protocol. The subscribers are store in sqlite DB. It supports both 2G and 3G authentication. + OsmoHLR is a Osmocom implementation of HLR (Home Location Registrar) which + works over GSUP protocol. The subscribers are store in sqlite DB. + It supports both 2G and 3G authentication. Package: osmo-hlr-dbg Architecture: any @@ -58,7 +59,7 @@ . This package contains the development headers. -Package: libosmo-mslookup0 +Package: libosmo-mslookup1 Section: libs Architecture: any Multi-Arch: same @@ -72,7 +73,7 @@ Architecture: any Multi-Arch: same Depends: osmocom-latest, ${misc:Depends}, - libosmo-mslookup0 (= ${binary:Version}), + libosmo-mslookup1 (= ${binary:Version}), libosmocore-dev Pre-Depends: ${misc:Pre-Depends} Description: Development headers of Osmocom MS lookup library @@ -84,7 +85,7 @@ Architecture: any Section: utils Depends: osmocom-latest, ${shlibs:Depends}, - libosmo-mslookup0 (= ${binary:Version}), + libosmo-mslookup1 (= ${binary:Version}), ${misc:Depends} Multi-Arch: same Description: Utilities for Osmocom MS lookup
View file
osmo-hlr_1.5.0.tar.xz/debian/copyright -> osmo-hlr_1.6.0.tar.xz/debian/copyright
Changed
@@ -3,7 +3,7 @@ Source: http://cgit.osmocom.org/osmo-hlr/ Files: * -Copyright: 2016-2017 Sysmocom s. f. m. c. GmbH <info@sysmocom.de> +Copyright: 2016-2022 Sysmocom s. f. m. c. GmbH <info@sysmocom.de> License: AGPL-3+ License: AGPL-3+
View file
osmo-hlr_1.6.0.tar.xz/debian/libosmo-mslookup1.install
Changed
(renamed from debian/libosmo-mslookup0.install)
View file
osmo-hlr_1.5.0.tar.xz/debian/osmo-hlr.install -> osmo-hlr_1.6.0.tar.xz/debian/osmo-hlr.install
Changed
@@ -5,5 +5,5 @@ /usr/share/doc/osmo-hlr/sql/hlr.sql /usr/share/doc/osmo-hlr/sql/hlr_data.sql /usr/share/doc/osmo-hlr/examples/osmo-hlr.cfg +/usr/share/doc/osmo-hlr/examples/osmo-hlr-dgsm.cfg /usr/share/osmocom/osmo-hlr-post-upgrade.sh -/var/lib/osmocom
View file
osmo-hlr_1.5.0.tar.xz/include/osmocom/hlr/dgsm.h -> osmo-hlr_1.6.0.tar.xz/include/osmocom/hlr/dgsm.h
Changed
@@ -25,6 +25,7 @@ #include <osmocom/gsupclient/cni_peer_id.h> #include <osmocom/gsupclient/gsup_req.h> +#define OSMO_DGSM_DEFAULT_RESULT_TIMEOUT_MS 2000 #define LOG_DGSM(imsi, level, fmt, args...) \ LOGP(DDGSM, level, "(IMSI-%s) " fmt, imsi, ##args)
View file
osmo-hlr_1.5.0.tar.xz/include/osmocom/hlr/hlr.h -> osmo-hlr_1.6.0.tar.xz/include/osmocom/hlr/hlr.h
Changed
@@ -23,6 +23,7 @@ #pragma once #include <stdbool.h> +#include <osmocom/gsm/protocol/gsm_04_08_gprs.h> #include <osmocom/core/linuxlist.h> #include <osmocom/gsm/ipa.h> #include <osmocom/core/tdef.h> @@ -48,7 +49,6 @@ /* Control Interface */ struct ctrl_handle *ctrl; - const char *ctrl_bind_addr; /* Local bind addr */ char *gsup_bind_addr; @@ -56,6 +56,8 @@ struct llist_head euse_list; struct hlr_euse *euse_default; + enum gsm48_gmm_cause reject_cause; + enum gsm48_gmm_cause no_proxy_reject_cause; /* NCSS (call independent) session guard timeout value */ int ncss_guard_timeout;
View file
osmo-hlr_1.5.0.tar.xz/include/osmocom/hlr/hlr_vty.h -> osmo-hlr_1.6.0.tar.xz/include/osmocom/hlr/hlr_vty.h
Changed
@@ -45,5 +45,5 @@ int hlr_vty_is_config_node(struct vty *vty, int node); int hlr_vty_go_parent(struct vty *vty); -void hlr_vty_init(void); +void hlr_vty_init(void *hlr_ctx); void dgsm_vty_init(void);
View file
osmo-hlr_1.5.0.tar.xz/include/osmocom/mslookup/mdns_rfc.h -> osmo-hlr_1.6.0.tar.xz/include/osmocom/mslookup/mdns_rfc.h
Changed
@@ -99,15 +99,12 @@ uint8_t *rdata; }; -char *osmo_mdns_rfc_qname_encode(void *ctx, const char *domain); -char *osmo_mdns_rfc_qname_decode(void *ctx, const char *qname, size_t qname_len); - void osmo_mdns_rfc_header_encode(struct msgb *msg, const struct osmo_mdns_rfc_header *hdr); int osmo_mdns_rfc_header_decode(const uint8_t *data, size_t data_len, struct osmo_mdns_rfc_header *hdr); -int osmo_mdns_rfc_question_encode(void *ctx, struct msgb *msg, const struct osmo_mdns_rfc_question *qst); +int osmo_mdns_rfc_question_encode(struct msgb *msg, const struct osmo_mdns_rfc_question *qst); struct osmo_mdns_rfc_question *osmo_mdns_rfc_question_decode(void *ctx, const uint8_t *data, size_t data_len); -int osmo_mdns_rfc_record_encode(void *ctx, struct msgb *msg, const struct osmo_mdns_rfc_record *rec); +int osmo_mdns_rfc_record_encode(struct msgb *msg, const struct osmo_mdns_rfc_record *rec); struct osmo_mdns_rfc_record *osmo_mdns_rfc_record_decode(void *ctx, const uint8_t *data, size_t data_len, size_t *record_len);
View file
osmo-hlr_1.5.0.tar.xz/src/ctrl.c -> osmo-hlr_1.6.0.tar.xz/src/ctrl.c
Changed
@@ -749,7 +749,7 @@ return 1; } -static int hlr_ctrl_cmds_install() +static int hlr_ctrl_cmds_install(void) { int rc = 0; @@ -771,11 +771,8 @@ struct ctrl_handle *hlr_controlif_setup(struct hlr *hlr) { int rc; - struct ctrl_handle *hdl = ctrl_interface_setup_dynip2(hlr, - hlr->ctrl_bind_addr, - OSMO_CTRL_PORT_HLR, - hlr_ctrl_node_lookup, - _LAST_CTRL_NODE_HLR); + struct ctrl_handle *hdl = ctrl_interface_setup2(hlr, OSMO_CTRL_PORT_HLR, hlr_ctrl_node_lookup, + _LAST_CTRL_NODE_HLR); if (!hdl) return NULL;
View file
osmo-hlr_1.5.0.tar.xz/src/db_auc.c -> osmo-hlr_1.6.0.tar.xz/src/db_auc.c
Changed
@@ -95,7 +95,10 @@ LOGAUC(imsi, LOGL_ERROR, "Error reading %s\n", col_name); return -EIO; } - osmo_hexparse((void *)text, dst, dst_len); + + if (osmo_hexparse((void *)text, dst, dst_len) != col_len) + return -EINVAL; + return 0; }
View file
osmo-hlr_1.5.0.tar.xz/src/dgsm.c -> osmo-hlr_1.6.0.tar.xz/src/dgsm.c
Changed
@@ -170,7 +170,7 @@ g_hlr->mslookup.server.local_attach_max_age = 60 * 60; - g_hlr->mslookup.client.result_timeout_milliseconds = 2000; + g_hlr->mslookup.client.result_timeout_milliseconds = OSMO_DGSM_DEFAULT_RESULT_TIMEOUT_MS; g_hlr->gsup_unit_name.unit_name = "HLR"; g_hlr->gsup_unit_name.serno = "unnamed-HLR"; @@ -191,7 +191,7 @@ dgsm_mdns_client_config_apply(); } -void dgsm_stop() +void dgsm_stop(void) { g_hlr->mslookup.allow_startup = false; mslookup_server_mdns_config_apply();
View file
osmo-hlr_1.5.0.tar.xz/src/dgsm_vty.c -> osmo-hlr_1.6.0.tar.xz/src/dgsm_vty.c
Changed
@@ -447,8 +447,8 @@ llist_for_each_entry(msc, &g_hlr->mslookup.server.local_site_services, entry) { if (!osmo_ipa_name_cmp(&mslookup_server_msc_wildcard, &msc->name)) continue; - vty_out(vty, " msc %s%s", osmo_ipa_name_to_str(&msc->name), VTY_NEWLINE); - config_write_msc_services(vty, " ", msc); + vty_out(vty, " msc ipa-name %s%s", osmo_ipa_name_to_str(&msc->name), VTY_NEWLINE); + config_write_msc_services(vty, " ", msc); } /* If the server is disabled, still output the above to not lose the service config. */ @@ -475,6 +475,10 @@ vty_out(vty, " mdns domain-suffix %s%s", g_hlr->mslookup.client.mdns.domain_suffix, VTY_NEWLINE); + if (g_hlr->mslookup.client.result_timeout_milliseconds != OSMO_DGSM_DEFAULT_RESULT_TIMEOUT_MS) + vty_out(vty, " timeout %u%s", + g_hlr->mslookup.client.result_timeout_milliseconds, + VTY_NEWLINE); } return CMD_SUCCESS;
View file
osmo-hlr_1.5.0.tar.xz/src/hlr.c -> osmo-hlr_1.6.0.tar.xz/src/hlr.c
Changed
@@ -324,7 +324,7 @@ " Returning slightly inaccurate cause 'IMSI Unknown' via GSUP"); return rc; case -ENOENT: - osmo_gsup_req_respond_err(req, GMM_CAUSE_IMSI_UNKNOWN, "IMSI unknown"); + osmo_gsup_req_respond_err(req, g_hlr->reject_cause, "IMSI unknown"); return rc; default: osmo_gsup_req_respond_err(req, GMM_CAUSE_NET_FAIL, "failure to look up IMSI in db"); @@ -568,12 +568,12 @@ return 0; } -static void print_usage() +static void print_usage(void) { printf("Usage: osmo-hlr\n"); } -static void print_help() +static void print_help(void) { printf(" -h --help This text.\n"); printf(" -c --config-file filename The config file to use.\n"); @@ -759,6 +759,8 @@ g_hlr->db_file_path = talloc_strdup(g_hlr, HLR_DEFAULT_DB_FILE_PATH); g_hlr->mslookup.server.mdns.domain_suffix = talloc_strdup(g_hlr, OSMO_MDNS_DOMAIN_SUFFIX_DEFAULT); g_hlr->mslookup.client.mdns.domain_suffix = talloc_strdup(g_hlr, OSMO_MDNS_DOMAIN_SUFFIX_DEFAULT); + g_hlr->reject_cause = GMM_CAUSE_IMSI_UNKNOWN; + g_hlr->no_proxy_reject_cause = GMM_CAUSE_IMSI_UNKNOWN; /* Init default (call independent) SS session guard timeout value */ g_hlr->ncss_guard_timeout = NCSS_GUARD_TIMEOUT_DEFAULT; @@ -775,7 +777,7 @@ osmo_stats_init(hlr_ctx); vty_init(&vty_info); ctrl_vty_init(hlr_ctx); - hlr_vty_init(); + hlr_vty_init(hlr_ctx); dgsm_vty_init(); osmo_cpu_sched_vty_init(hlr_ctx); handle_options(argc, argv); @@ -816,8 +818,7 @@ } /* start telnet after reading config for vty_get_bind_addr() */ - rc = telnet_init_dynif(hlr_ctx, NULL, vty_get_bind_addr(), - OSMO_VTY_PORT_HLR); + rc = telnet_init_default(hlr_ctx, NULL, OSMO_VTY_PORT_HLR); if (rc < 0) return rc; @@ -830,7 +831,6 @@ } proxy_init(g_hlr->gs); - g_hlr->ctrl_bind_addr = ctrl_vty_get_bind_addr(); g_hlr->ctrl = hlr_controlif_setup(g_hlr); dgsm_start(hlr_ctx);
View file
osmo-hlr_1.5.0.tar.xz/src/hlr_db_tool.c -> osmo-hlr_1.6.0.tar.xz/src/hlr_db_tool.c
Changed
@@ -51,7 +51,7 @@ .db_upgrade = false, }; -static void print_help() +static void print_help(void) { printf("\n"); printf("Usage: osmo-hlr-db-tool -l <hlr.db> create|import-nitb-db <nitb.db>\n");
View file
osmo-hlr_1.5.0.tar.xz/src/hlr_vty.c -> osmo-hlr_1.6.0.tar.xz/src/hlr_vty.c
Changed
@@ -25,7 +25,10 @@ * */ +#include <errno.h> + #include <osmocom/core/talloc.h> +#include <osmocom/gsm/protocol/gsm_04_08_gprs.h> #include <osmocom/vty/vty.h> #include <osmocom/vty/stats.h> #include <osmocom/vty/command.h> @@ -40,6 +43,36 @@ #include <osmocom/hlr/hlr_ussd.h> #include <osmocom/hlr/gsup_server.h> +static const struct value_string gsm48_gmm_cause_vty_names = { + { GMM_CAUSE_IMSI_UNKNOWN, "imsi-unknown" }, + { GMM_CAUSE_ILLEGAL_MS, "illegal-ms" }, + { GMM_CAUSE_PLMN_NOTALLOWED, "plmn-not-allowed" }, + { GMM_CAUSE_LA_NOTALLOWED, "la-not-allowed" }, + { GMM_CAUSE_ROAMING_NOTALLOWED, "roaming-not-allowed" }, + { GMM_CAUSE_NO_SUIT_CELL_IN_LA, "no-suitable-cell-in-la" }, + { GMM_CAUSE_NET_FAIL, "net-fail" }, + { GMM_CAUSE_CONGESTION, "congestion" }, + { GMM_CAUSE_GSM_AUTH_UNACCEPT, "auth-unacceptable" }, + { GMM_CAUSE_PROTO_ERR_UNSPEC, "proto-error-unspec" }, + { 0, NULL }, +}; + +/* TS 24.008 4.4.4.7 */ +static const struct value_string gsm48_gmm_cause_vty_descs = { + { GMM_CAUSE_IMSI_UNKNOWN, " #02: (IMSI unknown in HLR)" }, + { GMM_CAUSE_ILLEGAL_MS, " #03 (Illegal MS)" }, + { GMM_CAUSE_PLMN_NOTALLOWED, " #11: (PLMN not allowed)" }, + { GMM_CAUSE_LA_NOTALLOWED, " #12: (Location Area not allowed)" }, + { GMM_CAUSE_ROAMING_NOTALLOWED, " #13: (Roaming not allowed in this location area)" }, + { GMM_CAUSE_NO_SUIT_CELL_IN_LA, " #15: (No Suitable Cells In Location Area continue search in PLMN)." }, + { GMM_CAUSE_NET_FAIL, " #17: (Network Failure)" }, + { GMM_CAUSE_CONGESTION, " #22: (Congestion)" }, + { GMM_CAUSE_GSM_AUTH_UNACCEPT, " #23: (GSM authentication unacceptable UMTS)" }, + { GMM_CAUSE_PROTO_ERR_UNSPEC, "#111: (Protocol error, unspecified)" }, + { 0, NULL }, +}; + + struct cmd_node hlr_node = { HLR_NODE, "%s(config-hlr)# ", @@ -73,6 +106,15 @@ static int config_write_hlr(struct vty *vty) { vty_out(vty, "hlr%s", VTY_NEWLINE); + + if (g_hlr->reject_cause != GMM_CAUSE_IMSI_UNKNOWN) + vty_out(vty, " reject-cause not-found %s%s", + get_value_string_or_null(gsm48_gmm_cause_vty_names, + (uint32_t) g_hlr->reject_cause), VTY_NEWLINE); + if (g_hlr->no_proxy_reject_cause != GMM_CAUSE_IMSI_UNKNOWN) + vty_out(vty, " reject-cause no-proxy %s%s", + get_value_string_or_null(gsm48_gmm_cause_vty_names, + (uint32_t) g_hlr->no_proxy_reject_cause), VTY_NEWLINE); if (g_hlr->store_imei) vty_out(vty, " store-imei%s", VTY_NEWLINE); if (g_hlr->db_file_path && strcmp(g_hlr->db_file_path, HLR_DEFAULT_DB_FILE_PATH)) @@ -158,7 +200,7 @@ { if (vty->type != VTY_FILE) { vty_out(vty, "gsup/ipa-name: The GSUP IPA name cannot be changed at run-time; " - "It can only be set in the configuraton file.%s", VTY_NEWLINE); + "It can only be set in the configuration file.%s", VTY_NEWLINE); return CMD_WARNING; } @@ -358,6 +400,21 @@ return CMD_SUCCESS; } + +DEFUN(cfg_reject_cause, cfg_reject_cause_cmd, + "reject-cause TYPE CAUSE", "") /* Dynamically Generated */ +{ + int cause_code = get_string_value(gsm48_gmm_cause_vty_names, argv1); + OSMO_ASSERT(cause_code >= 0); + + if (strcmp(argv0, "not-found") == 0) + g_hlr->reject_cause = (enum gsm48_gmm_cause) cause_code; + if (strcmp(argv0, "no-proxy") == 0) + g_hlr->no_proxy_reject_cause = (enum gsm48_gmm_cause) cause_code; + + return CMD_SUCCESS; +} + DEFUN(cfg_store_imei, cfg_store_imei_cmd, "store-imei", "Save the IMEI in the database when receiving Check IMEI requests. Note that an MSC does not necessarily send" @@ -450,8 +507,22 @@ } } -void hlr_vty_init(void) +void hlr_vty_init(void *hlr_ctx) { + cfg_reject_cause_cmd.string = + vty_cmd_string_from_valstr(hlr_ctx, + gsm48_gmm_cause_vty_names, + "reject-cause (not-found|no-proxy) (", "|", ")", + VTY_DO_LOWER); + + cfg_reject_cause_cmd.doc = + vty_cmd_string_from_valstr(hlr_ctx, + gsm48_gmm_cause_vty_descs, + "GSUP/GMM cause to be sent\n" + "in the case the IMSI could not be found in the database\n" + "in the case no remote HLR reponded to mslookup GSUP request\n", + "\n", "", 0); + logging_vty_add_cmds(); osmo_talloc_vty_add_cmds(); osmo_stats_vty_add_cmds(); @@ -478,6 +549,7 @@ install_element(HLR_NODE, &cfg_ussd_defaultroute_cmd); install_element(HLR_NODE, &cfg_ussd_no_defaultroute_cmd); install_element(HLR_NODE, &cfg_ncss_guard_timeout_cmd); + install_element(HLR_NODE, &cfg_reject_cause_cmd); install_element(HLR_NODE, &cfg_store_imei_cmd); install_element(HLR_NODE, &cfg_no_store_imei_cmd); install_element(HLR_NODE, &cfg_subscr_create_on_demand_cmd);
View file
osmo-hlr_1.5.0.tar.xz/src/lu_fsm.c -> osmo-hlr_1.6.0.tar.xz/src/lu_fsm.c
Changed
@@ -136,7 +136,7 @@ } if (db_subscr_get_by_imsi(g_hlr->dbc, update_location_req->gsup.imsi, &lu->subscr) < 0) { - lu_failure(lu, GMM_CAUSE_IMSI_UNKNOWN, "Subscriber does not exist"); + lu_failure(lu, g_hlr->reject_cause, "Subscriber does not exist"); return; } @@ -314,7 +314,7 @@ .cleanup = lu_fsm_cleanup, }; -static __attribute__((constructor)) void lu_fsm_init() +static __attribute__((constructor)) void lu_fsm_init(void) { OSMO_ASSERT(osmo_fsm_register(&lu_fsm) == 0); }
View file
osmo-hlr_1.5.0.tar.xz/src/mslookup/Makefile.am -> osmo-hlr_1.6.0.tar.xz/src/mslookup/Makefile.am
Changed
@@ -1,7 +1,7 @@ # This is _NOT_ the library release version, it's an API version. # Please read chapter "Library interface versions" of the libtool documentation # before making any modifications: https://www.gnu.org/software/libtool/manual/html_node/Versioning.html -LIBVERSION=0:0:0 +LIBVERSION=1:0:0 AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -fPIC -Wall $(PCSC_CFLAGS) $(TALLOC_CFLAGS) $(LIBOSMOCORE_CFLAGS)
View file
osmo-hlr_1.5.0.tar.xz/src/mslookup/mdns_msg.c -> osmo-hlr_1.6.0.tar.xz/src/mslookup/mdns_msg.c
Changed
@@ -40,7 +40,7 @@ qst.domain = req->domain; qst.qtype = req->type; qst.qclass = OSMO_MDNS_RFC_CLASS_IN; - if (osmo_mdns_rfc_question_encode(ctx, msg, &qst) != 0) + if (osmo_mdns_rfc_question_encode(msg, &qst) != 0) return -EINVAL; return 0; @@ -106,7 +106,7 @@ rec.rdlength = ans_record->length; rec.rdata = ans_record->data; - if (osmo_mdns_rfc_record_encode(ctx, msg, &rec) != 0) + if (osmo_mdns_rfc_record_encode(msg, &rec) != 0) return -EINVAL; }
View file
osmo-hlr_1.5.0.tar.xz/src/mslookup/mdns_rfc.c -> osmo-hlr_1.6.0.tar.xz/src/mslookup/mdns_rfc.c
Changed
@@ -27,92 +27,10 @@ #include <osmocom/core/msgb.h> #include <osmocom/core/bitvec.h> #include <osmocom/core/logging.h> +#include <osmocom/gsm/apn.h> #include <osmocom/mslookup/mdns_rfc.h> /* - * Encode/decode IEs - */ - -/*! Encode a domain string as qname (RFC 1035 4.1.2). - * \paramin domain multiple labels separated by dots, e.g. "sip.voice.1234.msisdn". - * \returns allocated buffer with length-value pairs for each label (e.g. 0x03 "sip" 0x05 "voice" ...), NULL on error. - */ -char *osmo_mdns_rfc_qname_encode(void *ctx, const char *domain) -{ - char *domain_dup; - char *domain_iter; - char bufOSMO_MDNS_RFC_MAX_NAME_LEN + 2 = ""; /* len(qname) is len(domain) +1 */ - struct osmo_strbuf sb = { .buf = buf, .len = sizeof(buf) }; - char *label; - - if (strlen(domain) > OSMO_MDNS_RFC_MAX_NAME_LEN) - return NULL; - - domain_iter = domain_dup = talloc_strdup(ctx, domain); - while ((label = strsep(&domain_iter, "."))) { - size_t len = strlen(label); - - /* Empty domain, dot at start, two dots in a row, or ending with a dot */ - if (!len) - goto error; - - OSMO_STRBUF_PRINTF(sb, "%c%s", (char)len, label); - } - - talloc_free(domain_dup); - return talloc_strdup(ctx, buf); - -error: - talloc_free(domain_dup); - return NULL; -} - -/*! Decode a domain string from a qname (RFC 1035 4.1.2). - * \paramin qname buffer with length-value pairs for each label (e.g. 0x03 "sip" 0x05 "voice" ...) - * \paramin qname_max_len amount of bytes that can be read at most from the memory location that qname points to. - * \returns allocated buffer with domain string, multiple labels separated by dots (e.g. "sip.voice.1234.msisdn"), - * NULL on error. - */ -char *osmo_mdns_rfc_qname_decode(void *ctx, const char *qname, size_t qname_max_len) -{ - const char *next_label, *qname_end = qname + qname_max_len; - char bufOSMO_MDNS_RFC_MAX_NAME_LEN + 1; - int i = 0; - - if (qname_max_len < 1) - return NULL; - - while (*qname) { - size_t len; - - if (i >= qname_max_len) - return NULL; - - len = *qname; - next_label = qname + len + 1; - - if (next_label >= qname_end || i + len > OSMO_MDNS_RFC_MAX_NAME_LEN) - return NULL; - - if (i) { - /* Two dots in a row is not allowed */ - if (bufi - 1 == '.') - return NULL; - - bufi = '.'; - i++; - } - - memcpy(buf + i, qname + 1, len); - i += len; - qname = next_label; - } - bufi = '\0'; - - return talloc_strdup(ctx, buf); -} - -/* * Encode/decode message sections */ @@ -151,20 +69,17 @@ /*! Encode question section (RFC 1035 4.1.2). * \paramin msgb mesage buffer to which the encoded data will be appended. */ -int osmo_mdns_rfc_question_encode(void *ctx, struct msgb *msg, const struct osmo_mdns_rfc_question *qst) +int osmo_mdns_rfc_question_encode(struct msgb *msg, const struct osmo_mdns_rfc_question *qst) { - char *qname; - size_t qname_len; - uint8_t *qname_buf; + uint8_t *buf; + size_t buf_len; /* qname */ - qname = osmo_mdns_rfc_qname_encode(ctx, qst->domain); - if (!qname) + buf_len = strlen(qst->domain) + 1; + buf = msgb_put(msg, buf_len); + if (osmo_apn_from_str(buf, buf_len, qst->domain) < 0) return -EINVAL; - qname_len = strlen(qname) + 1; - qname_buf = msgb_put(msg, qname_len); - memcpy(qname_buf, qname, qname_len); - talloc_free(qname); + msgb_put_u8(msg, 0x00); /* qtype and qclass */ msgb_put_u16(msg, qst->qtype); @@ -182,21 +97,25 @@ if (data_len < 6) return NULL; - /* qname */ ret = talloc_zero(ctx, struct osmo_mdns_rfc_question); if (!ret) return NULL; - ret->domain = osmo_mdns_rfc_qname_decode(ret, (const char *)data, qname_len); - if (!ret->domain) { - talloc_free(ret); - return NULL; - } + + /* qname */ + ret->domain = talloc_size(ret, qname_len - 1); + if (!ret->domain) + goto error; + if (!osmo_apn_to_str(ret->domain, data, qname_len - 1)) + goto error; /* qtype and qclass */ ret->qtype = osmo_load16be(data + qname_len); ret->qclass = osmo_load16be(data + qname_len + 2); return ret; +error: + talloc_free(ret); + return NULL; } /* @@ -206,20 +125,17 @@ /*! Encode one resource record (RFC 1035 4.1.3). * \paramin msgb mesage buffer to which the encoded data will be appended. */ -int osmo_mdns_rfc_record_encode(void *ctx, struct msgb *msg, const struct osmo_mdns_rfc_record *rec) +int osmo_mdns_rfc_record_encode(struct msgb *msg, const struct osmo_mdns_rfc_record *rec) { - char *name; - size_t name_len; uint8_t *buf; + size_t buf_len; /* name */ - name = osmo_mdns_rfc_qname_encode(ctx, rec->domain); - if (!name) + buf_len = strlen(rec->domain) + 1; + buf = msgb_put(msg, buf_len); + if (osmo_apn_from_str(buf, buf_len, rec->domain) < 0) return -EINVAL; - name_len = strlen(name) + 1; - buf = msgb_put(msg, name_len); - memcpy(buf, name, name_len); - talloc_free(name); + msgb_put_u8(msg, 0x00); /* type, class, ttl, rdlength */ msgb_put_u16(msg, rec->type); @@ -237,15 +153,26 @@ struct osmo_mdns_rfc_record *osmo_mdns_rfc_record_decode(void *ctx, const uint8_t *data, size_t data_len, size_t *record_len) { - struct osmo_mdns_rfc_record *ret = talloc_zero(ctx, struct osmo_mdns_rfc_record); + struct osmo_mdns_rfc_record *ret; size_t name_len; - /* name */ - ret->domain = osmo_mdns_rfc_qname_decode(ret, (const char *)data, data_len - 10); + /* name length: represented as a series of labels, and terminated by a + * label with zero length (RFC 1035 3.3). A label with zero length is a + * NUL byte. */ + name_len = strnlen((const char *)data, data_len - 10) + 1; + if (dataname_len) + return NULL; + + /* allocate ret + ret->domain */ + ret = talloc_zero(ctx, struct osmo_mdns_rfc_record);
View file
osmo-hlr_1.5.0.tar.xz/src/mslookup/osmo-mslookup-client.c -> osmo-hlr_1.6.0.tar.xz/src/mslookup/osmo-mslookup-client.c
Changed
@@ -53,7 +53,7 @@ "\n"); } -static void print_help() +static void print_help(void) { print_version(); printf( @@ -555,7 +555,7 @@ return 0; } -void socket_close() +void socket_close(void) { struct socket_client *c, *n; llist_for_each_entry_safe(c, n, &globals.socket_clients, entry)
View file
osmo-hlr_1.5.0.tar.xz/src/mslookup_server.c -> osmo-hlr_1.6.0.tar.xz/src/mslookup_server.c
Changed
@@ -49,7 +49,7 @@ result->age = age; } -const struct mslookup_service_host *mslookup_server_get_local_gsup_addr() +const struct mslookup_service_host *mslookup_server_get_local_gsup_addr(void) { static struct mslookup_service_host gsup_bind = {}; struct mslookup_service_host *host;
View file
osmo-hlr_1.5.0.tar.xz/src/mslookup_server_mdns.c -> osmo-hlr_1.6.0.tar.xz/src/mslookup_server_mdns.c
Changed
@@ -121,7 +121,7 @@ talloc_free(server); } -void mslookup_server_mdns_config_apply() +void mslookup_server_mdns_config_apply(void) { /* Check whether to start/stop/restart mDNS server */ bool should_run;
View file
osmo-hlr_1.5.0.tar.xz/src/proxy.c -> osmo-hlr_1.6.0.tar.xz/src/proxy.c
Changed
@@ -29,6 +29,7 @@ #include <osmocom/gsupclient/gsup_client.h> #include <osmocom/gsupclient/gsup_req.h> +#include <osmocom/hlr/hlr.h> #include <osmocom/hlr/logging.h> #include <osmocom/hlr/proxy.h> #include <osmocom/hlr/remote_hlr.h> @@ -80,7 +81,19 @@ static void proxy_pending_req_remote_hlr_connect_result(struct osmo_gsup_req *req, struct remote_hlr *remote_hlr) { if (!remote_hlr || !remote_hlr_is_up(remote_hlr)) { - osmo_gsup_req_respond_err(req, GMM_CAUSE_IMSI_UNKNOWN, "Proxy: Failed to connect to home HLR"); + /* Do not respond with an error to a CHECK_IMEI_REQUEST as osmo-msc will send a LU Reject Cause #6 + * Just respond ACK and deal with the IMSI check that comes next. */ + if (req->gsup.message_type == OSMO_GSUP_MSGT_CHECK_IMEI_REQUEST) { + /* Accept all IMEIs */ + struct osmo_gsup_message gsup_reply = (struct osmo_gsup_message){ + .message_type = OSMO_GSUP_MSGT_CHECK_IMEI_RESULT, + .imei_result = OSMO_GSUP_IMEI_RESULT_ACK, + }; + osmo_gsup_req_respond(req, &gsup_reply, false, true); + return; + } + osmo_gsup_req_respond_err(req, g_hlr->no_proxy_reject_cause, + "Proxy: Failed to connect to home HLR"); return; } @@ -190,6 +203,7 @@ int _proxy_subscr_del(struct proxy_subscr_listentry *e) { llist_del(&e->entry); + talloc_free(e); return 0; }
View file
osmo-hlr_1.5.0.tar.xz/tests/auc/auc_test.c -> osmo-hlr_1.6.0.tar.xz/tests/auc/auc_test.c
Changed
@@ -509,7 +509,7 @@ } /* Test a variety of invalid authentication data combinations */ -void test_gen_vectors_bad_args() +void test_gen_vectors_bad_args(void) { struct osmo_auth_vector vec; uint8_t auts14;
View file
osmo-hlr_1.5.0.tar.xz/tests/auc/gen_ts_55_205_test_sets/main_template.c -> osmo-hlr_1.6.0.tar.xz/tests/auc/gen_ts_55_205_test_sets/main_template.c
Changed
@@ -100,7 +100,7 @@ FUNCTIONS -int main() +int main(int argc, char **argv) { printf("3GPP TS 55.205 Test Sets\n"); void *tall_ctx = talloc_named_const(NULL, 1, "test");
View file
osmo-hlr_1.5.0.tar.xz/tests/db/db_test.c -> osmo-hlr_1.6.0.tar.xz/tests/db/db_test.c
Changed
@@ -246,7 +246,7 @@ return db_subscr_lu(dbc, subscr_id, &vlr_nr, is_ps, NULL); } -static void test_subscr_create_update_sel_delete() +static void test_subscr_create_update_sel_delete(void) { int64_t id0, id1, id2, id_short; comment_start(); @@ -541,7 +541,7 @@ return &aud; } -static void test_subscr_aud() +static void test_subscr_aud(void) { int64_t id; @@ -783,7 +783,7 @@ /* Make each key too short in this test. Note that we can't set them longer than the allowed size without changing the * table structure. */ -static void test_subscr_aud_invalid_len() +static void test_subscr_aud_invalid_len(void) { int64_t id; @@ -845,7 +845,7 @@ comment_end(); } -static void test_subscr_sqn() +static void test_subscr_sqn(void) { int64_t id; @@ -918,7 +918,7 @@ comment_end(); } -static void test_ind() +static void test_ind(void) { comment_start();
View file
osmo-hlr_1.5.0.tar.xz/tests/mslookup/mdns_test.c -> osmo-hlr_1.6.0.tar.xz/tests/mslookup/mdns_test.c
Changed
@@ -32,148 +32,6 @@ size_t qname_max_len; /* default: strlen(qname) + 1 */ }; -static const struct qname_enc_dec_test qname_enc_dec_test_data = { - { - /* OK: typical mslookup domain */ - .domain = "hlr.1234567.imsi", - .qname = "\x03" "hlr" "\x07" "1234567" "\x04" "imsi", - }, - { - /* Wrong format: double dot */ - .domain = "hlr..imsi", - .qname = NULL, - }, - { - /* Wrong format: double dot */ - .domain = "hlr", - .qname = "\x03hlr\0\x03imsi", - }, - { - /* Wrong format: dot at end */ - .domain = "hlr.", - .qname = NULL, - }, - { - /* Wrong format: dot at start */ - .domain = ".hlr", - .qname = NULL, - }, - { - /* Wrong format: empty */ - .domain = "", - .qname = NULL, - }, - { - /* OK: maximum length */ - .domain = - "123456789." "123456789." "123456789." "123456789." "123456789." - "123456789." "123456789." "123456789." "123456789." "123456789." - "123456789." "123456789." "123456789." "123456789." "123456789." - "123456789." "123456789." "123456789." "123456789." "123456789." - "123456789." "123456789." "123456789." "123456789." "123456789." - "12345" - , - .qname = - "\t123456789\t123456789\t123456789\t123456789\t123456789" - "\t123456789\t123456789\t123456789\t123456789\t123456789" - "\t123456789\t123456789\t123456789\t123456789\t123456789" - "\t123456789\t123456789\t123456789\t123456789\t123456789" - "\t123456789\t123456789\t123456789\t123456789\t123456789" - "\x05" "12345" - }, - { - /* Error: too long domain */ - .domain = - "123456789." "123456789." "123456789." "123456789." "123456789." - "123456789." "123456789." "123456789." "123456789." "123456789." - "123456789." "123456789." "123456789." "123456789." "123456789." - "123456789." "123456789." "123456789." "123456789." "123456789." - "123456789." "123456789." "123456789." "123456789." "123456789." - "12345toolong" - , - .qname = NULL, - }, - { - /* Error: too long qname */ - .domain = NULL, - .qname = - "\t123456789\t123456789\t123456789\t123456789\t123456789" - "\t123456789\t123456789\t123456789\t123456789\t123456789" - "\t123456789\t123456789\t123456789\t123456789\t123456789" - "\t123456789\t123456789\t123456789\t123456789\t123456789" - "\t123456789\t123456789\t123456789\t123456789\t123456789" - "\t123456789\t123456789\t123456789\t123456789\t123456789" - }, - { - /* Error: wrong token length in qname */ - .domain = NULL, - .qname = "\x03" "hlr" "\x07" "1234567" "\x05" "imsi", - }, - { - /* Error: wrong token length in qname */ - .domain = NULL, - .qname = "\x02" "hlr" "\x07" "1234567" "\x04" "imsi", - }, - { - /* Wrong format: token length at end of qname */ - .domain = NULL, - .qname = "\x03hlr\x03", - }, - { - /* Error: overflow in label length */ - .domain = NULL, - .qname = "\x03" "hlr" "\x07" "1234567" "\x04" "imsi", - .qname_max_len = 17, - }, -}; - -void test_enc_dec_rfc_qname(void *ctx) -{ - char quote_buf300; - int i; - - fprintf(stderr, "-- %s --\n", __func__); - - for (i = 0; i < ARRAY_SIZE(qname_enc_dec_test_data); i++) { - const struct qname_enc_dec_test *t = &qname_enc_dec_test_datai; - char *res; - - if (t->domain) { - fprintf(stderr, "domain: %s\n", osmo_quote_str_buf2(quote_buf, sizeof(quote_buf), t->domain, -1)); - fprintf(stderr, "exp: %s\n", osmo_quote_str_buf2(quote_buf, sizeof(quote_buf), t->qname, -1)); - res = osmo_mdns_rfc_qname_encode(ctx, t->domain); - fprintf(stderr, "res: %s\n", osmo_quote_str_buf2(quote_buf, sizeof(quote_buf), res, -1)); - if (t->qname == res || (t->qname && res && strcmp(t->qname, res) == 0)) - fprintf(stderr, "=> OK\n"); - else - fprintf(stderr, "=> ERROR\n"); - if (res) - talloc_free(res); - fprintf(stderr, "\n"); - } - - if (t->qname) { - size_t qname_max_len = t->qname_max_len; - if (qname_max_len) - fprintf(stderr, "qname_max_len: %lu\n", qname_max_len); - else - qname_max_len = strlen(t->qname) + 1; - - fprintf(stderr, "qname: %s\n", osmo_quote_str_buf2(quote_buf, sizeof(quote_buf), t->qname, -1)); - fprintf(stderr, "exp: %s\n", osmo_quote_str_buf2(quote_buf, sizeof(quote_buf), t->domain, -1)); - res = osmo_mdns_rfc_qname_decode(ctx, t->qname, qname_max_len); - fprintf(stderr, "res: %s\n", osmo_quote_str_buf2(quote_buf, sizeof(quote_buf), res, -1)); - if (t->domain == res || (t->domain && res && strcmp(t->domain, res) == 0)) - fprintf(stderr, "=> OK\n"); - else - fprintf(stderr, "=> ERROR\n"); - if (res) - talloc_free(res); - fprintf(stderr, "\n"); - } - } -} - #define PRINT_HDR(hdr, name) \ fprintf(stderr, "header %s:\n" \ ".id = %i\n" \ @@ -216,7 +74,7 @@ }, }; -void test_enc_dec_rfc_header() +void test_enc_dec_rfc_header(void) { int i; @@ -241,7 +99,7 @@ } } -void test_enc_dec_rfc_header_einval() +void test_enc_dec_rfc_header_einval(void) { struct osmo_mdns_rfc_header out = {0}; struct msgb *msg = msgb_alloc(4096, "dns_test"); @@ -289,7 +147,7 @@ struct msgb *msg = msgb_alloc(4096, "dns_test"); PRINT_QST(&in, "in"); - assert(osmo_mdns_rfc_question_encode(ctx, msg, &in) == 0); + assert(osmo_mdns_rfc_question_encode(msg, &in) == 0); fprintf(stderr, "encoded: %s\n", osmo_hexdump(msgb_data(msg), msgb_length(msg))); out = osmo_mdns_rfc_question_decode(ctx, msgb_data(msg), msgb_length(msg)); assert(out); @@ -353,7 +211,7 @@ size_t record_len; PRINT_REC(&in, "in"); - assert(osmo_mdns_rfc_record_encode(ctx, msg, &in) == 0); + assert(osmo_mdns_rfc_record_encode(msg, &in) == 0); fprintf(stderr, "encoded: %s\n", osmo_hexdump(msgb_data(msg), msgb_length(msg))); out = osmo_mdns_rfc_record_decode(ctx, msgb_data(msg), msgb_length(msg), &record_len); fprintf(stderr, "record_len: %lu\n", record_len); @@ -578,7 +436,7 @@ } } -int main() +int main(int argc, char **argv) { void *ctx = talloc_named_const(NULL, 0, "main"); osmo_init_logging2(ctx, NULL); @@ -589,7 +447,6 @@ log_set_print_category_hex(osmo_stderr_target, 0); log_set_use_color(osmo_stderr_target, 0); - test_enc_dec_rfc_qname(ctx); test_enc_dec_rfc_header();
View file
osmo-hlr_1.5.0.tar.xz/tests/mslookup/mdns_test.err -> osmo-hlr_1.6.0.tar.xz/tests/mslookup/mdns_test.err
Changed
@@ -1,85 +1,3 @@ --- test_enc_dec_rfc_qname -- -domain: "hlr.1234567.imsi" -exp: "\3hlr\a1234567\4imsi" -res: "\3hlr\a1234567\4imsi" -=> OK - -qname: "\3hlr\a1234567\4imsi" -exp: "hlr.1234567.imsi" -res: "hlr.1234567.imsi" -=> OK - -domain: "hlr..imsi" -exp: NULL -res: NULL -=> OK - -domain: "hlr" -exp: "\3hlr" -res: "\3hlr" -=> OK - -qname: "\3hlr" -exp: "hlr" -res: "hlr" -=> OK - -domain: "hlr." -exp: NULL -res: NULL -=> OK - -domain: ".hlr" -exp: NULL -res: NULL -=> OK - -domain: "" -exp: NULL -res: NULL -=> OK - -domain: "123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.12345" -exp: "\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\512345" -res: "\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\512345" -=> OK - -qname: "\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\512345" -exp: "123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.12345" -res: "123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.12345" -=> OK - -domain: "123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.12345toolong" -exp: NULL -res: NULL -=> OK - -qname: "\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\t123456789\ -exp: NULL -res: NULL -=> OK - -qname: "\3hlr\a1234567\5imsi" -exp: NULL -res: NULL -=> OK - -qname: "\2hlr\a1234567\4imsi" -exp: NULL -res: NULL -=> OK - -qname: "\3hlr\3" -exp: NULL -res: NULL -=> OK - -qname_max_len: 17 -qname: "\3hlr\a1234567\4imsi" -exp: NULL -res: NULL -=> OK - -- test_enc_dec_rfc_header -- header in: .id = 1337
View file
osmo-hlr_1.5.0.tar.xz/tests/mslookup/mslookup_client_mdns_test.c -> osmo-hlr_1.6.0.tar.xz/tests/mslookup/mslookup_client_mdns_test.c
Changed
@@ -80,14 +80,14 @@ return n; } -static void server_init() +static void server_init(void) { fprintf(stderr, "%s\n", __func__); server_mc = osmo_mdns_sock_init(ctx, TEST_IP, TEST_PORT, server_recv, NULL, 0); OSMO_ASSERT(server_mc); } -static void server_stop() +static void server_stop(void) { fprintf(stderr, "%s\n", __func__); OSMO_ASSERT(server_mc); @@ -98,7 +98,7 @@ struct osmo_mslookup_client* client; struct osmo_mslookup_client_method* client_method; -static void client_init() +static void client_init(void) { fprintf(stderr, "%s\n", __func__); client = osmo_mslookup_client_new(ctx); @@ -117,7 +117,7 @@ osmo_mslookup_client_request_cancel(client, request_handle); } -static void client_query() +static void client_query(void) { struct osmo_mslookup_id id = {.type = OSMO_MSLOOKUP_ID_IMSI, .imsi = "123456789012345"}; @@ -134,7 +134,7 @@ osmo_mslookup_client_request(client, &query, &handling); } -static void client_stop() +static void client_stop(void) { fprintf(stderr, "%s\n", __func__); osmo_mslookup_client_free(client); @@ -154,7 +154,7 @@ osmo_timers_update(); \ } while (0) -static void fake_time_start() +static void fake_time_start(void) { struct timespec *clock_override; @@ -167,7 +167,7 @@ osmo_clock_override_enable(CLOCK_MONOTONIC, true); fake_time_passes(0, 0); } -static void test_server_client() +static void test_server_client(void) { fprintf(stderr, "-- %s --\n", __func__); server_init(); @@ -190,7 +190,7 @@ client_stop(); } -bool is_multicast_enabled() +bool is_multicast_enabled(void) { bool ret = true; struct addrinfo *ai; @@ -222,7 +222,7 @@ /* * Run all tests */ -int main() +int main(int argc, char **argv) { if (!is_multicast_enabled()) { fprintf(stderr, "ERROR: multicast is disabled! (OS#4361)");
View file
osmo-hlr_1.5.0.tar.xz/tests/mslookup/mslookup_client_test.c -> osmo-hlr_1.6.0.tar.xz/tests/mslookup/mslookup_client_test.c
Changed
@@ -147,7 +147,7 @@ osmo_timers_update(); \ } while (0) -static void fake_time_start() +static void fake_time_start(void) { struct timespec *clock_override; @@ -169,7 +169,7 @@ LOGP(DMSLOOKUP, LOGL_DEBUG, "result_cb(): %s\n", osmo_mslookup_result_name_c(ctx, query, result)); } -int main() +int main(int argc, char **argv) { ctx = talloc_named_const(NULL, 0, "main"); osmo_init_logging2(ctx, NULL);
View file
osmo-hlr_1.5.0.tar.xz/tests/mslookup/mslookup_test.c -> osmo-hlr_1.6.0.tar.xz/tests/mslookup/mslookup_test.c
Changed
@@ -50,7 +50,7 @@ "qwerty.1.qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmm", }; -void test_osmo_mslookup_query_init_from_domain_str() +void test_osmo_mslookup_query_init_from_domain_str(void) { int i; for (i = 0; i < ARRAY_SIZE(domains); i++) { @@ -68,7 +68,7 @@ } } -int main() +int main(int argc, char **argv) { ctx = talloc_named_const(NULL, 0, "main"); osmo_init_logging2(ctx, NULL);
View file
osmo-hlr_1.5.0.tar.xz/tests/test_nodes.vty -> osmo-hlr_1.6.0.tar.xz/tests/test_nodes.vty
Changed
@@ -47,6 +47,7 @@ no Negate a command or set its defaults ussd USSD Configuration ncss-guard-timeout Set guard timer for NCSS (call independent SS) session activity + reject-cause GSUP/GMM cause to be sent store-imei Save the IMEI in the database when receiving Check IMEI requests. Note that an MSC does not necessarily send Check IMEI requests (for OsmoMSC, you may want to set 'check-imei-rqd 1'). subscriber-create-on-demand Make a new record when a subscriber is first seen. OsmoHLR(config-hlr)# list @@ -61,6 +62,7 @@ ussd default-route external EUSE no ussd default-route ncss-guard-timeout <0-255> + reject-cause (not-found|no-proxy) (imsi-unknown|illegal-ms|plmn-not-allowed|la-not-allowed|roaming-not-allowed|no-suitable-cell-in-la|net-fail|congestion|auth-unacceptable|proto-error-unspec) store-imei no store-imei subscriber-create-on-demand (no-msisdn|<3-15>) (none|cs|ps|cs+ps) @@ -349,15 +351,15 @@ service foo.bar at 123.45.67.89 1011 service baz.bar at 121.31.41.5 1617 service baz.bar at a:b:c::d 1819 - msc MSC-1 - msc msc-901-70-23 - service foo.bar at 76.54.32.10 1234 - service baz.bar at 12.11.10.98 7654 - service baz.bar at dd:cc:bb::a 3210 - msc msc-901-70-42 - service foo.bar at 1.1.1.1 1111 - service baz.bar at 2.2.2.2 2222 - service baz.bar at 2222:2222:2222::2 2222 + msc ipa-name MSC-1 + msc ipa-name msc-901-70-23 + service foo.bar at 76.54.32.10 1234 + service baz.bar at 12.11.10.98 7654 + service baz.bar at dd:cc:bb::a 3210 + msc ipa-name msc-901-70-42 + service foo.bar at 1.1.1.1 1111 + service baz.bar at 2.2.2.2 2222 + service baz.bar at 2222:2222:2222::2 2222 client gateway-proxy 1.2.3.4 4222 mdns bind 239.192.23.42 4266 @@ -404,12 +406,12 @@ mdns bind 239.192.23.42 4266 service foo.bar at 123.45.67.89 1011 service baz.bar at 121.31.41.5 1617 - msc MSC-1 - msc msc-901-70-23 - service foo.bar at 76.54.32.10 1234 - service baz.bar at 12.11.10.98 7654 - msc msc-901-70-42 - service foo.bar at 1.1.1.1 1111 + msc ipa-name MSC-1 + msc ipa-name msc-901-70-23 + service foo.bar at 76.54.32.10 1234 + service baz.bar at 12.11.10.98 7654 + msc ipa-name msc-901-70-42 + service foo.bar at 1.1.1.1 1111 client mdns bind 239.192.23.42 4266 ... @@ -437,12 +439,12 @@ service foo.bar at 123.45.67.89 1011 service baz.bar at 121.31.41.5 1617 service gsup.hlr at 23.42.17.11 4223 - msc MSC-1 - msc msc-901-70-23 - service foo.bar at 76.54.32.10 1234 - service baz.bar at 12.11.10.98 7654 - msc msc-901-70-42 - service foo.bar at 1.1.1.1 1111 + msc ipa-name MSC-1 + msc ipa-name msc-901-70-23 + service foo.bar at 76.54.32.10 1234 + service baz.bar at 12.11.10.98 7654 + msc ipa-name msc-901-70-42 + service foo.bar at 1.1.1.1 1111 client mdns bind 239.192.23.42 4266 ...
View file
rpmlintrc
Added
@@ -0,0 +1,5 @@ +# Don't abort the build when finding a library that depends on a package with +# a specific version. This is intentional for nightly builds, we don't want +# libraries from different build dates to be mixed as they might have ABI +# incompatibilities. +setBadness('shlib-fixed-dependency', 0)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.