osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/38755?usp=email )
Change subject: lb: Avoid using osmo_ss7_instance private field
......................................................................
lb: Avoid using osmo_ss7_instance private field
We know the id because we just found/created it base don that id, so
simply use it instead of accessing the library object field.
Change-Id: Ib6d1f4898eb0a804ebda527fdd876d2ca4ec1e67
(cherry picked from commit d812fb1e98001f99e2f814ea52292ebdfe03a52f)
---
M src/osmo-bsc/lb.c
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
osmith: Verified
diff --git a/src/osmo-bsc/lb.c b/src/osmo-bsc/lb.c
index 9d5f78e..603b1e1 100644
--- a/src/osmo-bsc/lb.c
+++ b/src/osmo-bsc/lb.c
@@ -451,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);
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/38755?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-bsc
Gerrit-Branch: osmith/1.12.2
Gerrit-Change-Id: Ib6d1f4898eb0a804ebda527fdd876d2ca4ec1e67
Gerrit-Change-Number: 38755
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/38753?usp=email )
Change subject: Add osmo_ss7 APIs
......................................................................
Add osmo_ss7 APIs
Prepare OsmoBSC to work with newer versions of libosmo-sigtran, where
struct osmo_ss7_instance was made private. Ensure the APIs are always
present even if building with older libosmo-sigtran, so we can apply
patches that switches over to using these APIs instead of accessing the
struct directly.
Related: OS#6617
Change-Id: I327664775e94cf1bae203e98f3324d9ab63ee6d0
---
M configure.ac
M include/osmocom/bsc/Makefile.am
A include/osmocom/bsc/sigtran_compat.h
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/bsc_ctrl.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/lb.c
M src/osmo-bsc/osmo_bsc_sigtran.c
A src/osmo-bsc/sigtran_compat.c
9 files changed, 154 insertions(+), 0 deletions(-)
Approvals:
osmith: Verified
fixeria: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/configure.ac b/configure.ac
index ef43aa6..601134d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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)
diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index a560f23..d0f7c52 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -67,4 +67,5 @@
smscb.h \
power_control.h \
vgcs_fsm.h \
+ sigtran_compat.h \
$(NULL)
diff --git a/include/osmocom/bsc/sigtran_compat.h b/include/osmocom/bsc/sigtran_compat.h
new file mode 100644
index 0000000..95d4e33
--- /dev/null
+++ b/include/osmocom/bsc/sigtran_compat.h
@@ -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
diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am
index 1026523..2ac133f 100644
--- a/src/osmo-bsc/Makefile.am
+++ b/src/osmo-bsc/Makefile.am
@@ -117,6 +117,7 @@
cbch_scheduler.c \
cbsp_link.c \
power_control.c \
+ sigtran_compat.c \
$(NULL)
libbsc_la_LIBADD = \
diff --git a/src/osmo-bsc/bsc_ctrl.c b/src/osmo-bsc/bsc_ctrl.c
index aff1d83..caef66e 100644
--- a/src/osmo-bsc/bsc_ctrl.c
+++ b/src/osmo-bsc/bsc_ctrl.c
@@ -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)
{
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 8690a47..9558330 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -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>
diff --git a/src/osmo-bsc/lb.c b/src/osmo-bsc/lb.c
index 511a545..9d5f78e 100644
--- a/src/osmo-bsc/lb.c
+++ b/src/osmo-bsc/lb.c
@@ -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)
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index cdc5785..d1d4d18 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -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>
diff --git a/src/osmo-bsc/sigtran_compat.c b/src/osmo-bsc/sigtran_compat.c
new file mode 100644
index 0000000..190fbd8
--- /dev/null
+++ b/src/osmo-bsc/sigtran_compat.c
@@ -0,0 +1,104 @@
+/* (C) 2024 by sysmocom s.f.m.c. GmbH <info(a)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.asps[i];
+ 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.asps[i];
+ 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.asps[i];
+ 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
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/38753?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-bsc
Gerrit-Branch: osmith/1.12.2
Gerrit-Change-Id: I327664775e94cf1bae203e98f3324d9ab63ee6d0
Gerrit-Change-Number: 38753
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: pespin.
Hello Jenkins Builder, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/38765?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Code-Review+1 by pespin, Verified+1 by Jenkins Builder
Change subject: erab_fsm: rename erab_release_req/1 -> erab_release_cmd/1
......................................................................
erab_fsm: rename erab_release_req/1 -> erab_release_cmd/1
The respective S1AP PDU is COMMAND, not REQUEST.
Change-Id: I2f19d2c9bad52b89327f68f7dc6a2f6347a00ba0
---
M src/erab_fsm.erl
M src/s1ap_proxy.erl
M test/erab_fsm_test.erl
3 files changed, 8 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/65/38765/2
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/38765?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I2f19d2c9bad52b89327f68f7dc6a2f6347a00ba0
Gerrit-Change-Number: 38765
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Attention is currently required from: pespin.
Hello Jenkins Builder, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/38767?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Code-Review+1 by pespin, Verified+1 by Jenkins Builder
Change subject: s1ap_proxy: properly handle E-RAB RELEASE IND
......................................................................
s1ap_proxy: properly handle E-RAB RELEASE IND
Use the right release kind in the case of E-RAB RELEASE IND,
so that the E-RAB FSM can be terminated immediately.
Change-Id: Id1b77ef59818d6416326477a25e9866ab636b3ad
---
M src/s1ap_proxy.erl
M test/s1ap_proxy_test.erl
2 files changed, 9 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/67/38767/2
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/38767?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: Id1b77ef59818d6416326477a25e9866ab636b3ad
Gerrit-Change-Number: 38767
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Attention is currently required from: pespin.
fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/38767?usp=email )
Change subject: s1ap_proxy: properly handle E-RAB RELEASE IND
......................................................................
Patch Set 1:
(1 comment)
File src/s1ap_proxy.erl:
https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/38767/comment/0a082289_8ffb… :
PS1, Line 447: handle_ies(Content, ?'id-E-RABItem', S#proxy_state{rel_kind = cmd});
> it probably makes more sense to set this wherever we parse the message type "RELEASE COMMAND"? or th […]
Done
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/38767?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: Id1b77ef59818d6416326477a25e9866ab636b3ad
Gerrit-Change-Number: 38767
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 14 Nov 2024 12:02:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: pespin.
fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/38765?usp=email )
Change subject: erab_fsm: rename erab_release_req/1 -> erab_release_cmd/1
......................................................................
Patch Set 1:
(1 comment)
File src/erab_fsm.erl:
https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/38765/comment/bcf824eb_bc92… :
PS1, Line 291: ?LOG_DEBUG("Rx E-RAB RELEASE Req"),
> you need to fix this line too then.
Done
--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/38765?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: I2f19d2c9bad52b89327f68f7dc6a2f6347a00ba0
Gerrit-Change-Number: 38765
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 14 Nov 2024 12:01:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>