Projects
osmocom:latest
osmo-bsc
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 9
View file
osmo-bsc_1.12.1.dsc -> osmo-bsc_1.12.2.dsc
Changed
@@ -2,7 +2,7 @@ Source: osmo-bsc Binary: osmo-bsc, osmo-bsc-dbg, abisip-find, osmo-bsc-ipaccess-utils, osmo-bsc-bs11-utils, osmo-bsc-meas-utils, osmo-bsc-doc Architecture: any all -Version: 1.12.1 +Version: 1.12.2 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/osmo-bsc Standards-Version: 3.9.8 @@ -18,8 +18,8 @@ osmo-bsc-ipaccess-utils deb net extra arch=any osmo-bsc-meas-utils deb net extra arch=any Checksums-Sha1: - dd3ffe5b60b2d08a4b5025793ba912689d290177 625272 osmo-bsc_1.12.1.tar.xz + 986a8eb13fdb0edc168668fef151b19a8a91ef7f 626208 osmo-bsc_1.12.2.tar.xz Checksums-Sha256: - 76a5611100bf41a94b292b1f85c04a56c78c70d185089697a7f19f0e6b0f7bf1 625272 osmo-bsc_1.12.1.tar.xz + 02ed70bdd6836202028f5cba3b65d4b415490401d96b444203d8837e8e157e97 626208 osmo-bsc_1.12.2.tar.xz Files: - d884caf0c2e05f1b7cfd650a488416db 625272 osmo-bsc_1.12.1.tar.xz + 783275f46f330ae2ac0f458cc28caa34 626208 osmo-bsc_1.12.2.tar.xz
View file
osmo-bsc_1.12.1.tar.xz/.tarball-version -> osmo-bsc_1.12.2.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.12.1 +1.12.2
View file
osmo-bsc_1.12.1.tar.xz/configure.ac -> osmo-bsc_1.12.2.tar.xz/configure.ac
Changed
@@ -224,6 +224,18 @@ AC_MSG_RESULT(CFLAGS="$CFLAGS") AC_MSG_RESULT(CPPFLAGS="$CPPFLAGS") +# OS#6617: check if libosmo-sigtran has private structs +# We need to use grep here, can't set the includedir with AC_CHECK_DECL. +m="OS#6617: checking whether libosmo-sigtran has private structs..." +h="$($PKG_CONFIG --variable=includedir libosmo-sigtran)/osmocom/sigtran/osmo_ss7.h" +f=osmo_ss7_as_select_asp +if grep -q "$f" "$h"; then + echo "$m yes ($f in $h)" + AC_DEFINE(SIGTRAN_PRIVATE_STRUCTS, 1, "OS#6617") +else + echo "$m no ($f not in $h)" +fi + dnl Generate the output AM_CONFIG_HEADER(bscconfig.h)
View file
osmo-bsc_1.12.1.tar.xz/debian/changelog -> osmo-bsc_1.12.2.tar.xz/debian/changelog
Changed
@@ -1,3 +1,19 @@ +osmo-bsc (1.12.2) unstable; urgency=medium + + Oliver Smith + * Add osmo_ss7 APIs + + Pau Espin Pedrol + * bsc_ctrl: Use new libosmo-sigtran API osmo_ss7_route_get_dest_as() + * lb: Avoid using osmo_ss7_instance private field + * Use new libosmo-sigtran API osmo_ss7_instance_get_id() + * Use new libosmo-sigtran API osmo_ss7_instances_llist_entry() + * bsc_sccplite_msc_send(): Fix msgb leak + * Use new libosmo-sigtran API osmo_ss7_as_get_asp_protocol() + * Use new libosmo-sigtran API osmo_ss7_as_select_asp() + + -- Oliver Smith <osmith@sysmocom.de> Wed, 13 Nov 2024 14:42:07 +0100 + osmo-bsc (1.12.1) unstable; urgency=medium Vadim Yanitskiy
View file
osmo-bsc_1.12.1.tar.xz/include/osmocom/bsc/Makefile.am -> osmo-bsc_1.12.2.tar.xz/include/osmocom/bsc/Makefile.am
Changed
@@ -67,4 +67,5 @@ smscb.h \ power_control.h \ vgcs_fsm.h \ + sigtran_compat.h \ $(NULL)
View file
osmo-bsc_1.12.2.tar.xz/include/osmocom/bsc/sigtran_compat.h
Added
@@ -0,0 +1,32 @@ +#pragma once +#include "../../bscconfig.h" + +#include <osmocom/sigtran/osmo_ss7.h> + +#ifndef SIGTRAN_PRIVATE_STRUCTS + +static inline struct osmo_ss7_as *osmo_ss7_route_get_dest_as(struct osmo_ss7_route *rt) +{ + return rt->dest.as; +} + +static inline uint32_t osmo_ss7_instance_get_id(const struct osmo_ss7_instance *inst) +{ + return inst->cfg.id; +} + +static inline struct osmo_ss7_instance *osmo_ss7_instances_llist_entry(struct llist_head *list) +{ + struct osmo_ss7_instance *pos; + pos = llist_entry(list, struct osmo_ss7_instance, list); + return pos; +} + +static inline enum osmo_ss7_asp_protocol osmo_ss7_as_get_asp_protocol(const struct osmo_ss7_as *as) +{ + return as->cfg.proto; +} + +struct osmo_ss7_asp *osmo_ss7_as_select_asp(struct osmo_ss7_as *as); + +#endif
View file
osmo-bsc_1.12.1.tar.xz/src/osmo-bsc/Makefile.am -> osmo-bsc_1.12.2.tar.xz/src/osmo-bsc/Makefile.am
Changed
@@ -117,6 +117,7 @@ cbch_scheduler.c \ cbsp_link.c \ power_control.c \ + sigtran_compat.c \ $(NULL) libbsc_la_LIBADD = \
View file
osmo-bsc_1.12.1.tar.xz/src/osmo-bsc/bsc_ctrl.c -> osmo-bsc_1.12.2.tar.xz/src/osmo-bsc/bsc_ctrl.c
Changed
@@ -44,6 +44,7 @@ #include <osmocom/bsc/ctrl.h> #include <osmocom/bsc/handover_ctrl.h> #include <osmocom/bsc/neighbor_ident.h> +#include <osmocom/bsc/sigtran_compat.h> static int verify_net_apply_config_file(struct ctrl_cmd *cmd, const char *value, void *_data) { @@ -632,33 +633,21 @@ static struct osmo_ss7_as *msc_get_ss7_as(struct bsc_msc_data *msc) { struct osmo_ss7_route *rt; + struct osmo_ss7_as *as; struct osmo_ss7_instance *ss7 = osmo_sccp_get_ss7(msc->a.sccp); rt = osmo_ss7_route_lookup(ss7, msc->a.msc_addr.pc); if (!rt) return NULL; - return rt->dest.as; -} - -static int _ss7_as_send(struct osmo_ss7_as *as, struct msgb *msg) -{ - struct osmo_ss7_asp *asp; - unsigned int i; - - /* FIXME: unify with xua_as_transmit_msg() and perform proper ASP lookup */ - for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) { - asp = as->cfg.aspsi; - if (!asp) - continue; - /* FIXME: deal with multiple ASPs per AS */ - return osmo_ss7_asp_send(asp, msg); - } - msgb_free(msg); - return -1; + as = osmo_ss7_route_get_dest_as(rt); + if (!as) + return NULL; + return as; } int bsc_sccplite_msc_send(struct bsc_msc_data *msc, struct msgb *msg) { struct osmo_ss7_as *as; + struct osmo_ss7_asp *asp; as = msc_get_ss7_as(msc); if (!as) { @@ -667,10 +656,18 @@ } /* don't attempt to send CTRL on a non-SCCPlite AS */ - if (as->cfg.proto != OSMO_SS7_ASP_PROT_IPA) + if (osmo_ss7_as_get_asp_protocol(as) != OSMO_SS7_ASP_PROT_IPA) { + msgb_free(msg); return 0; + } - return _ss7_as_send(as, msg); + asp = osmo_ss7_as_select_asp(as); + if (!asp) { + LOGP(DCTRL, LOGL_NOTICE, "No ASP found for AS, dropping message\n"); + msgb_free(msg); + return -1; + } + return osmo_ss7_asp_send(asp, msg); } /* Encode a CTRL command and send it to the given ASP
View file
osmo-bsc_1.12.1.tar.xz/src/osmo-bsc/bsc_vty.c -> osmo-bsc_1.12.2.tar.xz/src/osmo-bsc/bsc_vty.c
Changed
@@ -68,6 +68,7 @@ #include <osmocom/bsc/bsc_msc_data.h> #include <osmocom/bsc/lchan.h> #include <osmocom/bsc/pcu_if.h> +#include <osmocom/bsc/sigtran_compat.h> #include <inttypes.h> @@ -2973,16 +2974,18 @@ struct bsc_msc_data *msc = bsc_msc_data(vty); const char *bsc_addr_name = argv0; struct osmo_ss7_instance *ss7; + uint32_t ss7_id; ss7 = osmo_sccp_addr_by_name(&msc->a.bsc_addr, bsc_addr_name); if (!ss7) { vty_out(vty, "Error: No such SCCP addressbook entry: '%s'%s", bsc_addr_name, VTY_NEWLINE); return CMD_ERR_INCOMPLETE; } + ss7_id = osmo_ss7_instance_get_id(ss7); /* Prevent mixing addresses from different CS7/SS7 instances */ if (msc->a.cs7_instance_valid) { - if (msc->a.cs7_instance != ss7->cfg.id) { + if (msc->a.cs7_instance != ss7_id) { vty_out(vty, "Error: SCCP addressbook entry from mismatching CS7 instance: '%s'%s", bsc_addr_name, VTY_NEWLINE); @@ -2990,7 +2993,7 @@ } } - msc->a.cs7_instance = ss7->cfg.id; + msc->a.cs7_instance = ss7_id; msc->a.cs7_instance_valid = true; enforce_standard_ssn(vty, &msc->a.bsc_addr); msc->a.bsc_addr_name = talloc_strdup(msc, bsc_addr_name); @@ -3005,16 +3008,18 @@ struct bsc_msc_data *msc = bsc_msc_data(vty); const char *msc_addr_name = argv0; struct osmo_ss7_instance *ss7; + uint32_t ss7_id; ss7 = osmo_sccp_addr_by_name(&msc->a.msc_addr, msc_addr_name); if (!ss7) { vty_out(vty, "Error: No such SCCP addressbook entry: '%s'%s", msc_addr_name, VTY_NEWLINE); return CMD_ERR_INCOMPLETE; } + ss7_id = osmo_ss7_instance_get_id(ss7); /* Prevent mixing addresses from different CS7/SS7 instances */ if (msc->a.cs7_instance_valid) { - if (msc->a.cs7_instance != ss7->cfg.id) { + if (msc->a.cs7_instance != ss7_id) { vty_out(vty, "Error: SCCP addressbook entry from mismatching CS7 instance: '%s'%s", msc_addr_name, VTY_NEWLINE); @@ -3022,7 +3027,7 @@ } } - msc->a.cs7_instance = ss7->cfg.id; + msc->a.cs7_instance = ss7_id; msc->a.cs7_instance_valid = true; enforce_standard_ssn(vty, &msc->a.msc_addr); msc->a.msc_addr_name = talloc_strdup(msc, msc_addr_name);
View file
osmo-bsc_1.12.1.tar.xz/src/osmo-bsc/lb.c -> osmo-bsc_1.12.2.tar.xz/src/osmo-bsc/lb.c
Changed
@@ -32,6 +32,7 @@ #include <osmocom/bsc/lcs_loc_req.h> #include <osmocom/bsc/bssmap_reset.h> #include <osmocom/bsc/gsm_data.h> +#include <osmocom/bsc/sigtran_compat.h> /* Send reset to SMLC */ int bssmap_le_tx_reset(void) @@ -450,13 +451,13 @@ OSMO_SCCP_SSN_SMLC_BSSAP_LE); /* Set up SCCP user and one ASP+AS */ - snprintf(inst_name, sizeof(inst_name), "Lb-%u-%s", cs7_inst->cfg.id, osmo_ss7_asp_protocol_name(used_proto)); + snprintf(inst_name, sizeof(inst_name), "Lb-%u-%s", bsc_gsmnet->smlc->cs7_instance, osmo_ss7_asp_protocol_name(used_proto)); LOGP(DLCS, LOGL_NOTICE, "Initializing SCCP connection for Lb/%s on cs7 instance %u\n", - osmo_ss7_asp_protocol_name(used_proto), cs7_inst->cfg.id); + osmo_ss7_asp_protocol_name(used_proto), bsc_gsmnet->smlc->cs7_instance); /* SS7 Protocol stack */ default_pc = osmo_ss7_pointcode_parse(NULL, BSC_DEFAULT_PC); - sccp = osmo_sccp_simple_client_on_ss7_id(tall_bsc_ctx, cs7_inst->cfg.id, inst_name, + sccp = osmo_sccp_simple_client_on_ss7_id(tall_bsc_ctx, bsc_gsmnet->smlc->cs7_instance, inst_name, default_pc, used_proto, 0, DEFAULT_ASP_LOCAL_IP, 0, DEFAULT_ASP_REMOTE_IP); @@ -618,18 +619,20 @@ bool smlc_set_cs7_instance(struct vty *vty, const char *from_vty_cmd, const char *from_addr, struct osmo_ss7_instance *ss7) { + uint32_t ss7_id = osmo_ss7_instance_get_id(ss7); + if (bsc_gsmnet->smlc->cs7_instance_valid) { - if (bsc_gsmnet->smlc->cs7_instance != ss7->cfg.id) { + if (bsc_gsmnet->smlc->cs7_instance != ss7_id) { LOGP(DLCS, LOGL_ERROR, "%s: expecting address from cs7 instance %u, but '%s' is from %u\n", - from_vty_cmd, bsc_gsmnet->smlc->cs7_instance, from_addr, ss7->cfg.id); + from_vty_cmd, bsc_gsmnet->smlc->cs7_instance, from_addr, ss7_id); vty_out(vty, "Error:" " %s: expecting address from cs7 instance %u, but '%s' is from %u%s", - from_vty_cmd, bsc_gsmnet->smlc->cs7_instance, from_addr, ss7->cfg.id, VTY_NEWLINE); + from_vty_cmd, bsc_gsmnet->smlc->cs7_instance, from_addr, ss7_id, VTY_NEWLINE); return false; } } else { - bsc_gsmnet->smlc->cs7_instance = ss7->cfg.id; + bsc_gsmnet->smlc->cs7_instance = ss7_id; bsc_gsmnet->smlc->cs7_instance_valid = true; LOGP(DLCS, LOGL_NOTICE, "Lb interface is using cs7 instance %u\n", bsc_gsmnet->smlc->cs7_instance); }
View file
osmo-bsc_1.12.1.tar.xz/src/osmo-bsc/osmo_bsc_sigtran.c -> osmo-bsc_1.12.2.tar.xz/src/osmo-bsc/osmo_bsc_sigtran.c
Changed
@@ -37,6 +37,7 @@ #include <osmocom/bsc/bts.h> #include <osmocom/bsc/paging.h> #include <osmocom/bsc/bssmap_reset.h> +#include <osmocom/bsc/sigtran_compat.h> #include <osmocom/mgcp_client/mgcp_common.h> #include <osmocom/netif/ipa.h> @@ -113,8 +114,9 @@ static struct bsc_msc_data *get_msc_by_pc(struct osmo_ss7_instance *cs7, uint32_t pc) { struct bsc_msc_data *msc; + uint32_t cs7_id = osmo_ss7_instance_get_id(cs7); llist_for_each_entry(msc, msc_list, entry) { - if (msc->a.cs7_instance != cs7->cfg.id) + if (msc->a.cs7_instance != cs7_id) continue; if ((msc->a.msc_addr.presence & OSMO_SCCP_ADDR_T_PC) == 0) continue; @@ -558,7 +560,7 @@ { struct bsc_msc_data *msc; uint32_t default_pc; - struct osmo_ss7_instance *inst; + struct llist_head *ll_it; int create_instance_0_for_msc_nr = -1; osmo_ss7_register_rx_unknown_cb(&asp_rx_unknown); @@ -614,18 +616,20 @@ * Iterate cs7 instance indexes and see for each one whether an MSC is configured for it. * The 'msc' / 'msc-addr' command selects the cs7 instance used for an MSC. */ - llist_for_each_entry(inst, &osmo_ss7_instances, list) { + llist_for_each(ll_it, &osmo_ss7_instances) { + struct osmo_ss7_instance *inst = osmo_ss7_instances_llist_entry(ll_it); char inst_name32; enum osmo_ss7_asp_protocol used_proto = OSMO_SS7_ASP_PROT_NONE; int prev_msc_nr; + uint32_t inst_id = osmo_ss7_instance_get_id(inst); struct osmo_sccp_instance *sccp; struct bsc_sccp_inst *bsc_sccp; llist_for_each_entry(msc, msc_list, entry) { /* An MSC with invalid cs7 instance id defaults to cs7 instance 0 */ - if ((inst->cfg.id != msc->a.cs7_instance) - && !(inst->cfg.id == 0 && !msc->a.cs7_instance_valid)) + if ((inst_id != msc->a.cs7_instance) + && !(inst_id == 0 && !msc->a.cs7_instance_valid)) continue; /* This msc runs on this cs7 inst. Check the asp_proto. */ @@ -636,7 +640,7 @@ prev_msc_nr, msc->nr, osmo_ss7_asp_protocol_name(used_proto), osmo_ss7_asp_protocol_name(msc->a.asp_proto), - inst->cfg.id); + inst_id); return -EINVAL; } @@ -647,17 +651,17 @@ if (used_proto == OSMO_SS7_ASP_PROT_NONE) { /* This instance has no MSC associated with it */ - LOGP(DMSC, LOGL_ERROR, "cs7 instance %u has no MSCs configured to run on it\n", inst->cfg.id); + LOGP(DMSC, LOGL_ERROR, "cs7 instance %u has no MSCs configured to run on it\n", inst_id); continue; } - snprintf(inst_name, sizeof(inst_name), "A-%u-%s", inst->cfg.id, osmo_ss7_asp_protocol_name(used_proto)); + snprintf(inst_name, sizeof(inst_name), "A-%u-%s", inst_id, osmo_ss7_asp_protocol_name(used_proto)); LOGP(DMSC, LOGL_NOTICE, "Initializing SCCP connection for A/%s on cs7 instance %u\n", - osmo_ss7_asp_protocol_name(used_proto), inst->cfg.id); + osmo_ss7_asp_protocol_name(used_proto), inst_id); /* SS7 Protocol stack */ default_pc = osmo_ss7_pointcode_parse(NULL, BSC_DEFAULT_PC); - sccp = osmo_sccp_simple_client_on_ss7_id(tall_bsc_ctx, inst->cfg.id, inst_name, + sccp = osmo_sccp_simple_client_on_ss7_id(tall_bsc_ctx, inst_id, inst_name, default_pc, used_proto, 0, DEFAULT_ASP_LOCAL_IP, 0, DEFAULT_ASP_REMOTE_IP); @@ -673,8 +677,8 @@ char msc_name32; /* Skip MSCs that don't run on this cs7 instance */ - if ((inst->cfg.id != msc->a.cs7_instance) - && !(inst->cfg.id == 0 && !msc->a.cs7_instance_valid)) + if ((inst_id != msc->a.cs7_instance) + && !(inst_id == 0 && !msc->a.cs7_instance_valid)) continue; snprintf(msc_name, sizeof(msc_name), "msc-%d", msc->nr);
View file
osmo-bsc_1.12.2.tar.xz/src/osmo-bsc/sigtran_compat.c
Added
@@ -0,0 +1,104 @@ +/* (C) 2024 by sysmocom s.f.m.c. GmbH <info@sysmocom.de> + * All Rights Reserved + * + * SPDX-License-Identifier: GPL-2.0+ + * + * 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 "../../bscconfig.h" + +#include <osmocom/bsc/sigtran_compat.h> + +#ifndef SIGTRAN_PRIVATE_STRUCTS + +static struct osmo_ss7_asp *ss7_as_select_asp_override(struct osmo_ss7_as *as) +{ + struct osmo_ss7_asp *asp; + unsigned int i; + + /* FIXME: proper selection of the ASP based on the SLS! */ + for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) { + asp = as->cfg.aspsi; + if (asp && osmo_ss7_asp_active(asp)) + break; + } + return asp; +} + +static struct osmo_ss7_asp *ss7_as_select_asp_roundrobin(struct osmo_ss7_as *as) +{ + struct osmo_ss7_asp *asp; + unsigned int i; + unsigned int first_idx; + + first_idx = (as->cfg.last_asp_idx_sent + 1) % ARRAY_SIZE(as->cfg.asps); + i = first_idx; + do { + asp = as->cfg.aspsi; + if (asp && osmo_ss7_asp_active(asp)) + break; + i = (i + 1) % ARRAY_SIZE(as->cfg.asps); + } while (i != first_idx); + as->cfg.last_asp_idx_sent = i; + + return asp; +} + +/* returns NULL if multiple ASPs would need to be selected. */ +static struct osmo_ss7_asp *ss7_as_select_asp_broadcast(struct osmo_ss7_as *as) +{ + struct osmo_ss7_asp *asp; + struct osmo_ss7_asp *asp_found = NULL; + + for (unsigned int i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) { + asp = as->cfg.aspsi; + if (!asp || !osmo_ss7_asp_active(asp)) + continue; + if (asp_found) /* >1 ASPs selected, early return */ + return NULL; + asp_found = asp; + } + return asp_found; +} + +struct osmo_ss7_asp *osmo_ss7_as_select_asp(struct osmo_ss7_as *as) +{ + struct osmo_ss7_asp *asp = NULL; + + switch (as->cfg.mode) { + case OSMO_SS7_AS_TMOD_OVERRIDE: + asp = ss7_as_select_asp_override(as); + break; + case OSMO_SS7_AS_TMOD_LOADSHARE: + /* TODO: actually use the SLS value to ensure same SLS goes + * through same ASP. Not strictly required by M3UA RFC, but + * would fit the overall principle. */ + case OSMO_SS7_AS_TMOD_ROUNDROBIN: + asp = ss7_as_select_asp_roundrobin(as); + break; + case OSMO_SS7_AS_TMOD_BCAST: + return ss7_as_select_asp_broadcast(as); + case _NUM_OSMO_SS7_ASP_TMOD: + OSMO_ASSERT(false); + } + + if (!asp) { + LOGPFSM(as->fi, "No selectable ASP in AS\n"); + return NULL; + } + return asp; +} + +#endif
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
.