Projects
osmocom:master
osmo-hlr
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 42
View file
commit_0451b13e0de5b4f41791e135490dfa3251775966.txt
Added
View file
commit_7c06eea5b2a5c35898f43de50888c890816c9aa3.txt
Deleted
View file
osmo-hlr_1.8.0.2.7c06.dsc -> osmo-hlr_1.8.0.5.0451.dsc
Changed
@@ -2,7 +2,7 @@ Source: osmo-hlr 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.8.0.2.7c06 +Version: 1.8.0.5.0451 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/osmo-hlr Standards-Version: 3.9.6 @@ -19,8 +19,8 @@ osmo-hlr-doc deb doc optional arch=all osmo-mslookup-utils deb utils optional arch=any Checksums-Sha1: - e0dd8774a0bc81595e04f7796f8dfd2febb3b0dc 176692 osmo-hlr_1.8.0.2.7c06.tar.xz + 57309a444dbf234acb2dbec65eabbbcce793df8a 177876 osmo-hlr_1.8.0.5.0451.tar.xz Checksums-Sha256: - 2d967e04d4159ee08e1137df09c722ab32f37f4abe0fec8ffcb60a26b85685d4 176692 osmo-hlr_1.8.0.2.7c06.tar.xz + fce7ada2afb2bf14183027899a72b3479493df8915d449f4d01d501838a9ffb6 177876 osmo-hlr_1.8.0.5.0451.tar.xz Files: - 7e146c5252804ff8b17aaaaf5b3b2225 176692 osmo-hlr_1.8.0.2.7c06.tar.xz + 38ed9555a613315a6f7ff8b5f3998ec6 177876 osmo-hlr_1.8.0.5.0451.tar.xz
View file
osmo-hlr_1.8.0.2.7c06.tar.xz/.tarball-version -> osmo-hlr_1.8.0.5.0451.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.8.0.2-7c06 +1.8.0.5-0451
View file
osmo-hlr_1.8.0.2.7c06.tar.xz/debian/changelog -> osmo-hlr_1.8.0.5.0451.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -osmo-hlr (1.8.0.2.7c06) unstable; urgency=medium +osmo-hlr (1.8.0.5.0451) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom master feed - -- Osmocom OBS scripts <info@osmocom.org> Fri, 23 Aug 2024 06:59:02 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Tue, 05 Nov 2024 10:42:38 +0000 osmo-hlr (1.8.0) unstable; urgency=medium
View file
osmo-hlr_1.8.0.2.7c06.tar.xz/debian/copyright -> osmo-hlr_1.8.0.5.0451.tar.xz/debian/copyright
Changed
@@ -6,6 +6,10 @@ Copyright: 2016-2022 Sysmocom s. f. m. c. GmbH <info@sysmocom.de> License: AGPL-3+ +Files: src/gsupclient/* +Copyright: 2014-2016,2019 by sysmocom s.f.m.c. GmbH <info@sysmocom.de> +License: GPL-2+ + License: AGPL-3+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by @@ -19,3 +23,17 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. + +License: GPL-2+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>.
View file
osmo-hlr_1.8.0.2.7c06.tar.xz/include/Makefile.am -> osmo-hlr_1.8.0.5.0451.tar.xz/include/Makefile.am
Changed
@@ -3,6 +3,7 @@ nobase_include_HEADERS = \ osmocom/gsupclient/cni_peer_id.h \ osmocom/gsupclient/gsup_client.h \ + osmocom/gsupclient/gsup_client_mux.h \ osmocom/gsupclient/gsup_req.h \ osmocom/mslookup/mdns.h \ osmocom/mslookup/mdns_sock.h \
View file
osmo-hlr_1.8.0.5.0451.tar.xz/include/osmocom/gsupclient/gsup_client_mux.h
Added
@@ -0,0 +1,56 @@ +/* + * (C) 2019 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de> + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#include <osmocom/gsm/gsup.h> + +struct gsup_client_mux; +struct ipaccess_unit; + +struct gsup_client_mux_rx_cb { + int (*func)(struct gsup_client_mux *gcm, void *data, const struct osmo_gsup_message *gsup_msg); + void *data; +}; + +/* A GSUP client shared between code paths for various GSUP Message Classes. + * The main task is to dispatch GSUP messages to code paths corresponding to the respective Message Class, i.e. + * subscriber management, SMS, SS/USSD and inter-MSC messaging. + * If a GSUP Message Class IE is present in the message, the received message is dispatched directly to the rx_cb entry + * for that Message Class. Otherwise, the Message Class is determined by a switch() on the Message Type.*/ +struct gsup_client_mux { + struct osmo_gsup_client *gsup_client; + + /* Target clients by enum osmo_gsup_message_class */ + struct gsup_client_mux_rx_cb rx_cbOSMO_GSUP_MESSAGE_CLASS_ARRAYSIZE; +}; + +struct gsup_client_mux *gsup_client_mux_alloc(void *talloc_ctx); +int gsup_client_mux_start(struct gsup_client_mux *gcm, const char *gsup_server_addr_str, uint16_t gsup_server_port, + struct ipaccess_unit *ipa_dev); + +int gsup_client_mux_tx(struct gsup_client_mux *gcm, const struct osmo_gsup_message *gsup_msg); +void gsup_client_mux_tx_set_source(const struct gsup_client_mux *gcm, struct osmo_gsup_message *gsup_msg); +void gsup_client_mux_tx_error_reply(struct gsup_client_mux *gcm, const struct osmo_gsup_message *gsup_orig, + enum gsm48_gmm_cause cause); + +int gsup_client_mux_rx(struct osmo_gsup_client *gsup_client, struct msgb *msg);
View file
osmo-hlr_1.8.0.2.7c06.tar.xz/src/gsupclient/Makefile.am -> osmo-hlr_1.8.0.5.0451.tar.xz/src/gsupclient/Makefile.am
Changed
@@ -11,6 +11,7 @@ libosmo_gsup_client_la_SOURCES = \ cni_peer_id.c \ gsup_client.c \ + gsup_client_mux.c \ gsup_req.c \ $(NULL)
View file
osmo-hlr_1.8.0.2.7c06.tar.xz/src/gsupclient/cni_peer_id.c -> osmo-hlr_1.8.0.5.0451.tar.xz/src/gsupclient/cni_peer_id.c
Changed
@@ -2,6 +2,8 @@ * * All Rights Reserved * + * SPDX-License-Identifier: GPL-2.0-or-later + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or
View file
osmo-hlr_1.8.0.2.7c06.tar.xz/src/gsupclient/gsup_client.c -> osmo-hlr_1.8.0.5.0451.tar.xz/src/gsupclient/gsup_client.c
Changed
@@ -6,6 +6,8 @@ * Author: Jacob Erlbeck * Author: Neels Hofmeyr * + * SPDX-License-Identifier: GPL-2.0-or-later + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or
View file
osmo-hlr_1.8.0.5.0451.tar.xz/src/gsupclient/gsup_client_mux.c
Added
@@ -0,0 +1,194 @@ +/* Directing individual GSUP messages to their respective handlers. */ +/* + * (C) 2019 by sysmocom - s.f.m.c. GmbH <info@sysmocom.de> + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include <errno.h> + +#include <osmocom/core/logging.h> + +#include <osmocom/gsupclient/gsup_client.h> +#include <osmocom/gsupclient/gsup_client_mux.h> + +static enum osmo_gsup_message_class gsup_client_mux_classify(struct gsup_client_mux *gcm, + const struct osmo_gsup_message *gsup_msg) +{ + if (gsup_msg->message_class) + return gsup_msg->message_class; + + LOGP(DLGSUP, LOGL_DEBUG, "No explicit GSUP Message Class, trying to guess from message type %s\n", + osmo_gsup_message_type_name(gsup_msg->message_type)); + + switch (gsup_msg->message_type) { + case OSMO_GSUP_MSGT_PROC_SS_REQUEST: + case OSMO_GSUP_MSGT_PROC_SS_RESULT: + case OSMO_GSUP_MSGT_PROC_SS_ERROR: + return OSMO_GSUP_MESSAGE_CLASS_USSD; + + /* GSM 04.11 code implementing MO SMS */ + case OSMO_GSUP_MSGT_MO_FORWARD_SM_ERROR: + case OSMO_GSUP_MSGT_MO_FORWARD_SM_RESULT: + case OSMO_GSUP_MSGT_READY_FOR_SM_ERROR: + case OSMO_GSUP_MSGT_READY_FOR_SM_RESULT: + case OSMO_GSUP_MSGT_MT_FORWARD_SM_REQUEST: + return OSMO_GSUP_MESSAGE_CLASS_SMS; + + default: + return OSMO_GSUP_MESSAGE_CLASS_SUBSCRIBER_MANAGEMENT; + } +} + +/* Non-static for unit tests */ +int gsup_client_mux_rx(struct osmo_gsup_client *gsup_client, struct msgb *msg) +{ + struct gsup_client_mux *gcm = gsup_client->data; + struct osmo_gsup_message gsup; + enum osmo_gsup_message_class message_class; + int rc; + + rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup); + if (rc < 0) { + LOGP(DLGSUP, LOGL_ERROR, "Failed to decode GSUP message: '%s' (%d) %s\n", + get_value_string(gsm48_gmm_cause_names, -rc), -rc, osmo_hexdump(msg->data, msg->len)); + goto msgb_free_and_return; + } + + if (!gsup.imsi0) { + LOGP(DLGSUP, LOGL_ERROR, "Failed to decode GSUP message: missing IMSI\n"); + if (OSMO_GSUP_IS_MSGT_REQUEST(gsup.message_type)) + gsup_client_mux_tx_error_reply(gcm, &gsup, GMM_CAUSE_INV_MAND_INFO); + rc = -GMM_CAUSE_INV_MAND_INFO; + goto msgb_free_and_return; + } + + message_class = gsup_client_mux_classify(gcm, &gsup); + + if (message_class <= OSMO_GSUP_MESSAGE_CLASS_UNSET || message_class >= ARRAY_SIZE(gcm->rx_cb)) { + LOGP(DLGSUP, LOGL_ERROR, "Failed to classify GSUP message target\n"); + rc = -EINVAL; + goto msgb_free_and_return; + } + + if (!gcm->rx_cbmessage_class.func) { + LOGP(DLGSUP, LOGL_ERROR, "No receiver set up for GSUP Message Class %s\n", osmo_gsup_message_class_name(message_class)); + rc = -ENOTSUP; + goto msgb_free_and_return; + } + + rc = gcm->rx_cbmessage_class.func(gcm, gcm->rx_cbmessage_class.data, &gsup); + +msgb_free_and_return: + msgb_free(msg); + return rc; +} + +/* Make it clear that struct gsup_client_mux should be talloc allocated, so that it can be used as talloc parent. */ +struct gsup_client_mux *gsup_client_mux_alloc(void *talloc_ctx) +{ + return talloc_zero(talloc_ctx, struct gsup_client_mux); +} + +/* Start a GSUP client to serve this gsup_client_mux. */ +int gsup_client_mux_start(struct gsup_client_mux *gcm, const char *gsup_server_addr_str, uint16_t gsup_server_port, + struct ipaccess_unit *ipa_dev) +{ + gcm->gsup_client = osmo_gsup_client_create2(gcm, ipa_dev, + gsup_server_addr_str, + gsup_server_port, + &gsup_client_mux_rx, NULL); + if (!gcm->gsup_client) + return -ENOMEM; + gcm->gsup_client->data = gcm; + return 0; +} + +int gsup_client_mux_tx(struct gsup_client_mux *gcm, const struct osmo_gsup_message *gsup_msg) +{ + struct msgb *msg; + int rc; + + if (!gcm || !gcm->gsup_client) { + LOGP(DLGSUP, LOGL_ERROR, "GSUP link is down, cannot send GSUP message\n"); + return -ENOTSUP; + } + + msg = osmo_gsup_client_msgb_alloc(); + rc = osmo_gsup_encode(msg, gsup_msg); + if (rc < 0) { + LOGP(DLGSUP, LOGL_ERROR, "Failed to encode GSUP message: '%s'\n", strerror(-rc)); + return rc; + } + + return osmo_gsup_client_send(gcm->gsup_client, msg); +} + +/* Set GSUP source_name to our local IPA name */ +void gsup_client_mux_tx_set_source(const struct gsup_client_mux *gcm, + struct osmo_gsup_message *gsup_msg) +{ + const char *local_msc_name; + + if (!gcm) + return; + if (!gcm->gsup_client) + return; + if (!gcm->gsup_client->ipa_dev) + return; + local_msc_name = gcm->gsup_client->ipa_dev->serno; + if (!local_msc_name) + return; + gsup_msg->source_name = (const uint8_t *) local_msc_name; + gsup_msg->source_name_len = strlen(local_msc_name) + 1; +} + +/* Transmit GSUP error in response to original message */ +void gsup_client_mux_tx_error_reply(struct gsup_client_mux *gcm, const struct osmo_gsup_message *gsup_orig, + enum gsm48_gmm_cause cause) +{ + struct osmo_gsup_message gsup_reply; + + /* No need to answer if we couldn't parse an ERROR message type, only REQUESTs need an error reply. */ + if (!OSMO_GSUP_IS_MSGT_REQUEST(gsup_orig->message_type)) + return; + + gsup_reply = (struct osmo_gsup_message){ + .cause = cause, + .message_type = OSMO_GSUP_TO_MSGT_ERROR(gsup_orig->message_type), + .message_class = gsup_orig->message_class, + .destination_name = gsup_orig->source_name, + .destination_name_len = gsup_orig->source_name_len, + + /* RP-Message-Reference is mandatory for SM Service */ + .sm_rp_mr = gsup_orig->sm_rp_mr, + }; + + OSMO_STRLCPY_ARRAY(gsup_reply.imsi, gsup_orig->imsi); + gsup_client_mux_tx_set_source(gcm, &gsup_reply); + + /* For SS/USSD, it's important to keep both session state and ID IEs */ + if (gsup_orig->session_state != OSMO_GSUP_SESSION_STATE_NONE) { + gsup_reply.session_state = OSMO_GSUP_SESSION_STATE_END; + gsup_reply.session_id = gsup_orig->session_id; + } + + if (osmo_gsup_client_enc_send(gcm->gsup_client, &gsup_reply)) + LOGP(DLGSUP, LOGL_ERROR, "Failed to send Error reply (imsi=%s)\n", + osmo_quote_str(gsup_orig->imsi, -1)); +}
View file
osmo-hlr_1.8.0.2.7c06.tar.xz/src/gsupclient/gsup_req.c -> osmo-hlr_1.8.0.5.0451.tar.xz/src/gsupclient/gsup_req.c
Changed
@@ -2,6 +2,8 @@ * * All Rights Reserved * + * SPDX-License-Identifier: GPL-2.0-or-later + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or
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
.