Attention is currently required from: pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/27568 )
Change subject: pco.h: Fix typo in reference to spec
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/27568
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: Ic428892161123b62d25a7619128ef7325bf85500
Gerrit-Change-Number: 27568
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 24 Mar 2022 14:14:31 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: neels.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27567 )
Change subject: library/BSSMAP_Templates: add missing LCS {Priority,QoS} IEs
......................................................................
Patch Set 1:
(1 comment)
File library/BSSMAP_Templates.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27567/comment/54842a15_e0c1…
PS1, Line 1908: rTC := '00'B /* Response Time is not specified */
> so many magic numbers... […]
Same here, BSSMAP_IE_LCSQOS comes from Ericsson's protocol modules (see my comment to I5c8d6962e957d587dc4b65d08bf56bd4ef2f0d6e).
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27567
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If2bd6e636d3ee695abab9ed40417dc53ec68fd12
Gerrit-Change-Number: 27567
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 23 Mar 2022 15:35:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: neels.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27566 )
Change subject: library/BSSMAP_Templates: add missing LCS Client Type IE
......................................................................
Patch Set 1:
(1 comment)
File library/BSSMAP_Templates.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27566/comment/e1c1b0c9_9e5f…
PS1, Line 1877: template (value) BIT4 subtype := '0000'B) := {
> would it make sense to define enums for these?
Indeed it would make sense. The problem is that BSSMAP_IE_LCSClientType comes from Ericsson's protocol modules (external deps), and somehow they prefer using BITs and OCTs over the enumerated types. So not in this case, unfortunately :/
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27566
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I5c8d6962e957d587dc4b65d08bf56bd4ef2f0d6e
Gerrit-Change-Number: 27566
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 23 Mar 2022 15:34:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: fixeria.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27567 )
Change subject: library/BSSMAP_Templates: add missing LCS {Priority,QoS} IEs
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
File library/BSSMAP_Templates.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27567/comment/730a157f_30a2…
PS1, Line 1908: rTC := '00'B /* Response Time is not specified */
so many magic numbers... i guess it would be quite some effort to define these values in enums?
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27567
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If2bd6e636d3ee695abab9ed40417dc53ec68fd12
Gerrit-Change-Number: 27567
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 23 Mar 2022 15:29:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27477 )
Change subject: bsc_nat_fsm: tweak get_peer_addr
......................................................................
bsc_nat_fsm: tweak get_peer_addr
Rename the function from sccp_sap_get_peer_addr_in to get_peer_addr to
make the code using it slightly more readable. The _in at the end of
the function is not needed anymore, this was used to differentiate from
peer_addr_out which was used in the caller code before the connection
mapping was implemented in I1556aa665fbb0a97507f98794e74820731fa6935.
Now instead of peer_addr_out, subscr_conn->bsc->addr or
subscr_conn->msc->addr are used.
Rename variable arguments to sccp_inst and addr to be consistent with
the variable names in the callers.
Related: SYS#5560
Change-Id: Ie023360724254be54cbaac4490b0341dfe68399f
---
M src/osmo-bsc-nat/bsc_nat_fsm.c
1 file changed, 10 insertions(+), 13 deletions(-)
Approvals:
osmith: Looks good to me, approved; Verified
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/src/osmo-bsc-nat/bsc_nat_fsm.c b/src/osmo-bsc-nat/bsc_nat_fsm.c
index 090c38f..d3a3b01 100644
--- a/src/osmo-bsc-nat/bsc_nat_fsm.c
+++ b/src/osmo-bsc-nat/bsc_nat_fsm.c
@@ -52,14 +52,14 @@
/* For connection-oriented messages, figure out which side is not the BSCNAT,
* either the called_addr or calling_addr. */
-static int sccp_sap_get_peer_addr_in(struct bsc_nat_sccp_inst *src, struct osmo_sccp_addr **peer_addr_in,
- struct osmo_sccp_addr *called_addr, struct osmo_sccp_addr *calling_addr)
+static int get_peer_addr(struct bsc_nat_sccp_inst *sccp_inst, struct osmo_sccp_addr **addr,
+ struct osmo_sccp_addr *called_addr, struct osmo_sccp_addr *calling_addr)
{
- if (osmo_sccp_addr_ri_cmp(&src->addr, called_addr) != 0) {
- *peer_addr_in = called_addr;
+ if (osmo_sccp_addr_ri_cmp(&sccp_inst->addr, called_addr) != 0) {
+ *addr = called_addr;
return 0;
- } else if (osmo_sccp_addr_ri_cmp(&src->addr, calling_addr) != 0) {
- *peer_addr_in = calling_addr;
+ } else if (osmo_sccp_addr_ri_cmp(&sccp_inst->addr, calling_addr) != 0) {
+ *addr = calling_addr;
return 0;
}
@@ -71,7 +71,7 @@
LOGP(DMAIN, LOGL_ERROR, "Invalid connection oriented message, locally configured address %s"
" is neither called address %s nor calling address %s!\n",
- osmo_sccp_inst_addr_name(NULL, &src->addr), buf_called, buf_calling);
+ osmo_sccp_inst_addr_name(NULL, &sccp_inst->addr), buf_called, buf_calling);
return -1;
}
@@ -96,8 +96,7 @@
case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM):
/* indication of connection confirm */
- if (sccp_sap_get_peer_addr_in(sccp_inst, &addr, &prim->u.connect.called_addr,
- &prim->u.connect.calling_addr) < 0)
+ if (get_peer_addr(sccp_inst, &addr, &prim->u.connect.called_addr, &prim->u.connect.calling_addr) < 0)
goto error;
subscr_conn = subscr_conn_get_by_id(prim->u.connect.conn_id, BSC_NAT_NET_CN);
@@ -195,8 +194,7 @@
switch (OSMO_PRIM_HDR(oph)) {
case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_INDICATION):
/* indication of new inbound connection request */
- if (sccp_sap_get_peer_addr_in(sccp_inst, &addr, &prim->u.connect.called_addr,
- &prim->u.connect.calling_addr) < 0)
+ if (get_peer_addr(sccp_inst, &addr, &prim->u.connect.called_addr, &prim->u.connect.calling_addr) < 0)
goto error;
bsc = bsc_get_by_pc(addr->pc);
@@ -225,8 +223,7 @@
case OSMO_PRIM(OSMO_SCU_PRIM_N_CONNECT, PRIM_OP_CONFIRM):
/* indication of connection confirm */
- if (sccp_sap_get_peer_addr_in(sccp_inst, &addr, &prim->u.connect.called_addr,
- &prim->u.connect.calling_addr) < 0)
+ if (get_peer_addr(sccp_inst, &addr, &prim->u.connect.called_addr, &prim->u.connect.calling_addr) < 0)
goto error;
subscr_conn = subscr_conn_get_by_id(prim->u.connect.conn_id, BSC_NAT_NET_RAN);
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27477
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc-nat
Gerrit-Branch: master
Gerrit-Change-Id: Ie023360724254be54cbaac4490b0341dfe68399f
Gerrit-Change-Number: 27477
Gerrit-PatchSet: 5
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27478 )
Change subject: README: add Manual Testing With osmo-dev
......................................................................
README: add Manual Testing With osmo-dev
Describe the manual testing that can be done with osmo-dev with the
changes up to I78ef36c72ff9a7b801e922eccc89dc44fbba7f23.
Related: SYS#5560
Change-Id: I3c3369b6d1a50ec3af19ee826cf2f94530d5d7fd
---
M README.md
1 file changed, 23 insertions(+), 0 deletions(-)
Approvals:
osmith: Looks good to me, approved; Verified
laforge: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
diff --git a/README.md b/README.md
index 8ed9954..ca367a2 100644
--- a/README.md
+++ b/README.md
@@ -42,6 +42,29 @@
[Osmocom Mailing List Rules](https://osmocom.org/projects/cellular-infrastructure/wiki/Mailing_Li…
when posting.
+Manual Testing With osmo-dev
+----------
+
+With [osmo-dev](https://git.osmocom.org/osmo-dev/) it is possible to
+build all Osmocom components for a full test network with OsmoBSCNAT,
+and run the network on your PC. Set up the make directory as described
+in osmo-dev's README, then build components with:
+
+```
+$ make cn-bsc-nat
+```
+
+Set up a network as described in osmo-dev's net/README, then put the
+following in your configuration to let it run osmo-bsc-nat with one
+virtual BSC, BTS and MS (can be used next to a real BSC/BTS/MS):
+
+```
+BSC_COUNT=2
+BTS1_RUN_IN_OSMO_DEV=1
+STP_RAN_IP="127.0.0.2"
+MS_RUN_IN_OSMO_DEV=1
+```
+
Contributing
------------
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27478
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc-nat
Gerrit-Branch: master
Gerrit-Change-Id: I3c3369b6d1a50ec3af19ee826cf2f94530d5d7fd
Gerrit-Change-Number: 27478
Gerrit-PatchSet: 5
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27472 )
Change subject: Store BSCs
......................................................................
Store BSCs
Once a BSC has sent a RESET to BSCNAT, store it. This will be used in
future patches to build connection mappings between MSC and BSCs, and to
block messages from BSCs that did not send a RESET.
I've considered using a FSM, but at least right now there doesn't seem
to be multiple states worth storing. We only have the BSC before it has
done the RESET (and then it's simply not in our list) and after it did
the RESET (in the list).
Don't use the stored BSCs in the forwarding logic just yet, a future
commit will replace the current forwarding code with proper connection
mappings.
Related: SYS#5560
Change-Id: Icd7316c49ef26fb45ad45a2ccc1a7916bfb0a387
---
M include/osmocom/bsc_nat/Makefile.am
A include/osmocom/bsc_nat/bsc.h
M include/osmocom/bsc_nat/bsc_nat.h
M src/osmo-bsc-nat/Makefile.am
A src/osmo-bsc-nat/bsc.c
M src/osmo-bsc-nat/bsc_nat.c
M src/osmo-bsc-nat/bssap.c
7 files changed, 110 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/include/osmocom/bsc_nat/Makefile.am b/include/osmocom/bsc_nat/Makefile.am
index 76aada0..398b0aa 100644
--- a/include/osmocom/bsc_nat/Makefile.am
+++ b/include/osmocom/bsc_nat/Makefile.am
@@ -1,4 +1,5 @@
noinst_HEADERS = \
+ bsc.h \
bsc_nat.h \
bsc_nat_fsm.h \
bssap.h \
diff --git a/include/osmocom/bsc_nat/bsc.h b/include/osmocom/bsc_nat/bsc.h
new file mode 100644
index 0000000..34590b9
--- /dev/null
+++ b/include/osmocom/bsc_nat/bsc.h
@@ -0,0 +1,31 @@
+/* (C) 2021 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>
+ * Author: Oliver Smith <osmith(a)sysmocom.de>
+ * All Rights Reserved
+ *
+ * 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
+ * the Free Software Foundation; either version 3 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/lienses/>.
+ *
+ */
+
+#pragma once
+
+#include <osmocom/sigtran/sccp_sap.h>
+
+struct bsc {
+ struct llist_head list;
+ struct osmo_sccp_addr addr;
+};
+
+struct bsc *bsc_alloc(struct osmo_sccp_addr *addr);
+struct bsc *bsc_get_by_pc(uint32_t pointcode);
+void bsc_free(struct bsc *bsc);
diff --git a/include/osmocom/bsc_nat/bsc_nat.h b/include/osmocom/bsc_nat/bsc_nat.h
index 3d863f1..aac06ab 100644
--- a/include/osmocom/bsc_nat/bsc_nat.h
+++ b/include/osmocom/bsc_nat/bsc_nat.h
@@ -44,6 +44,7 @@
struct {
struct bsc_nat_sccp_inst *sccp_inst;
+ struct llist_head bscs; /* list of struct bsc */
} ran;
};
diff --git a/src/osmo-bsc-nat/Makefile.am b/src/osmo-bsc-nat/Makefile.am
index 445c098..bb8e990 100644
--- a/src/osmo-bsc-nat/Makefile.am
+++ b/src/osmo-bsc-nat/Makefile.am
@@ -25,6 +25,7 @@
$(NULL)
osmo_bsc_nat_SOURCES = \
+ bsc.c \
bsc_nat.c \
bsc_nat_fsm.c \
bssap.c \
diff --git a/src/osmo-bsc-nat/bsc.c b/src/osmo-bsc-nat/bsc.c
new file mode 100644
index 0000000..2ad6e0e
--- /dev/null
+++ b/src/osmo-bsc-nat/bsc.c
@@ -0,0 +1,59 @@
+/* (C) 2021 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>
+ * Author: Oliver Smith <osmith(a)sysmocom.de>
+ * All Rights Reserved
+ *
+ * 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
+ * the Free Software Foundation; either version 3 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/lienses/>.
+ *
+ */
+
+#include "config.h"
+#include <osmocom/bsc_nat/bsc.h>
+#include <osmocom/bsc_nat/bsc_nat.h>
+#include <osmocom/bsc_nat/logging.h>
+
+struct bsc *bsc_alloc(struct osmo_sccp_addr *addr)
+{
+ struct bsc *bsc = talloc_zero(g_bsc_nat, struct bsc);
+
+ OSMO_ASSERT(bsc);
+ talloc_set_name(bsc, "BSC(PC=%s)", osmo_ss7_pointcode_print(NULL, addr->pc));
+
+ LOGP(DMAIN, LOGL_DEBUG, "Add %s\n", talloc_get_name(bsc));
+
+ bsc->addr = *addr;
+
+ INIT_LLIST_HEAD(&bsc->list);
+ llist_add(&bsc->list, &g_bsc_nat->ran.bscs);
+
+ return bsc;
+}
+
+struct bsc *bsc_get_by_pc(uint32_t pointcode)
+{
+ struct bsc *bsc;
+
+ llist_for_each_entry(bsc, &g_bsc_nat->ran.bscs, list) {
+ if (bsc->addr.pc == pointcode)
+ return bsc;
+ }
+
+ return NULL;
+}
+
+void bsc_free(struct bsc *bsc)
+{
+ LOGP(DMAIN, LOGL_DEBUG, "Del %s\n", talloc_get_name(bsc));
+ llist_del(&bsc->list);
+ talloc_free(bsc);
+}
diff --git a/src/osmo-bsc-nat/bsc_nat.c b/src/osmo-bsc-nat/bsc_nat.c
index 409bf74..8baa096 100644
--- a/src/osmo-bsc-nat/bsc_nat.c
+++ b/src/osmo-bsc-nat/bsc_nat.c
@@ -20,8 +20,10 @@
#include "config.h"
#include <osmocom/core/talloc.h>
#include <osmocom/core/utils.h>
+#include <osmocom/bsc_nat/bsc.h>
#include <osmocom/bsc_nat/bsc_nat.h>
#include <osmocom/bsc_nat/bsc_nat_fsm.h>
+#include <osmocom/bsc_nat/logging.h>
struct bsc_nat *bsc_nat_alloc(void *tall_ctx)
{
@@ -38,6 +40,8 @@
OSMO_ASSERT(bsc_nat->ran.sccp_inst);
talloc_set_name_const(bsc_nat->ran.sccp_inst, "struct bsc_nat_sccp_inst (RAN)");
+ INIT_LLIST_HEAD(&bsc_nat->ran.bscs);
+
bsc_nat_fsm_alloc(bsc_nat);
return bsc_nat;
@@ -45,11 +49,17 @@
void bsc_nat_free(struct bsc_nat *bsc_nat)
{
+ struct bsc *bsc, *b;
+
if (bsc_nat->fi) {
osmo_fsm_inst_free(bsc_nat->fi);
bsc_nat->fi = NULL;
}
+ llist_for_each_entry_safe(bsc, b, &bsc_nat->ran.bscs, list) {
+ bsc_free(bsc);
+ }
+
talloc_free(bsc_nat);
}
diff --git a/src/osmo-bsc-nat/bssap.c b/src/osmo-bsc-nat/bssap.c
index e5c8ca2..83eec99 100644
--- a/src/osmo-bsc-nat/bssap.c
+++ b/src/osmo-bsc-nat/bssap.c
@@ -22,12 +22,19 @@
#include <osmocom/gsm/gsm0808.h>
#include <osmocom/sigtran/sccp_helpers.h>
#include <osmocom/sigtran/sccp_sap.h>
+#include <osmocom/bsc_nat/bsc.h>
#include <osmocom/bsc_nat/bsc_nat.h>
#include <osmocom/bsc_nat/logging.h>
static int bssap_ran_handle_reset(struct osmo_sccp_addr *addr, struct msgb *msg, unsigned int length)
{
struct bsc_nat_sccp_inst *sccp_inst = g_bsc_nat->ran.sccp_inst;
+ struct bsc *bsc;
+
+ /* Store the BSC, since RESET was done the BSCNAT should accept its messages */
+ bsc = bsc_get_by_pc(addr->pc);
+ if (!bsc)
+ bsc = bsc_alloc(addr);
LOGP(DMAIN, LOGL_NOTICE, "Rx RESET from %s\n", bsc_nat_print_addr_ran(addr));
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27472
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc-nat
Gerrit-Branch: master
Gerrit-Change-Id: Icd7316c49ef26fb45ad45a2ccc1a7916bfb0a387
Gerrit-Change-Number: 27472
Gerrit-PatchSet: 4
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27473 )
Change subject: Store MSC
......................................................................
Store MSC
Expect one MSC to be configured in the address book (part of the cs7
section in the config, see doc/examples/osmo-bsc-nat/osmo-bsc-nat.cfg)
and store it on start up.
Store the MSC in a list, as we may potentially support multiple MSCs in
the future. Also that makes it symmetric to the BSC list.
Don't use the stored MSCs in the forwarding logic just yet, a future
commit will replace the current forwarding code with proper connection
mappings.
Related: SYS#5560
Change-Id: I711df0c649728f1007857fbfda500ed5ef69287b
---
M include/osmocom/bsc_nat/Makefile.am
M include/osmocom/bsc_nat/bsc_nat.h
A include/osmocom/bsc_nat/msc.h
M src/osmo-bsc-nat/Makefile.am
M src/osmo-bsc-nat/bsc_nat.c
M src/osmo-bsc-nat/bsc_nat_fsm.c
M src/osmo-bsc-nat/main.c
A src/osmo-bsc-nat/msc.c
8 files changed, 120 insertions(+), 16 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/include/osmocom/bsc_nat/Makefile.am b/include/osmocom/bsc_nat/Makefile.am
index 398b0aa..1c675f7 100644
--- a/include/osmocom/bsc_nat/Makefile.am
+++ b/include/osmocom/bsc_nat/Makefile.am
@@ -4,5 +4,6 @@
bsc_nat_fsm.h \
bssap.h \
logging.h \
+ msc.h \
vty.h \
$(NULL)
diff --git a/include/osmocom/bsc_nat/bsc_nat.h b/include/osmocom/bsc_nat/bsc_nat.h
index aac06ab..9e58a79 100644
--- a/include/osmocom/bsc_nat/bsc_nat.h
+++ b/include/osmocom/bsc_nat/bsc_nat.h
@@ -40,6 +40,7 @@
struct {
struct bsc_nat_sccp_inst *sccp_inst;
+ struct llist_head mscs; /* list of struct msc */
} cn;
struct {
diff --git a/include/osmocom/bsc_nat/msc.h b/include/osmocom/bsc_nat/msc.h
new file mode 100644
index 0000000..1f91de0
--- /dev/null
+++ b/include/osmocom/bsc_nat/msc.h
@@ -0,0 +1,34 @@
+/* (C) 2021 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>
+ * Author: Oliver Smith <osmith(a)sysmocom.de>
+ * All Rights Reserved
+ *
+ * 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
+ * the Free Software Foundation; either version 3 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/lienses/>.
+ *
+ */
+
+#pragma once
+
+#include <osmocom/sigtran/sccp_sap.h>
+
+struct msc {
+ struct llist_head list;
+ struct osmo_sccp_addr addr;
+};
+
+struct msc *msc_alloc(struct osmo_sccp_addr *addr);
+int msc_alloc_from_addr_book(void);
+
+struct msc *msc_get(void);
+
+void msc_free(struct msc *msc);
diff --git a/src/osmo-bsc-nat/Makefile.am b/src/osmo-bsc-nat/Makefile.am
index bb8e990..1dd82fd 100644
--- a/src/osmo-bsc-nat/Makefile.am
+++ b/src/osmo-bsc-nat/Makefile.am
@@ -31,6 +31,7 @@
bssap.c \
logging.c \
main.c \
+ msc.c \
vty.c \
$(NULL)
diff --git a/src/osmo-bsc-nat/bsc_nat.c b/src/osmo-bsc-nat/bsc_nat.c
index 8baa096..23d7498 100644
--- a/src/osmo-bsc-nat/bsc_nat.c
+++ b/src/osmo-bsc-nat/bsc_nat.c
@@ -24,6 +24,7 @@
#include <osmocom/bsc_nat/bsc_nat.h>
#include <osmocom/bsc_nat/bsc_nat_fsm.h>
#include <osmocom/bsc_nat/logging.h>
+#include <osmocom/bsc_nat/msc.h>
struct bsc_nat *bsc_nat_alloc(void *tall_ctx)
{
@@ -40,6 +41,7 @@
OSMO_ASSERT(bsc_nat->ran.sccp_inst);
talloc_set_name_const(bsc_nat->ran.sccp_inst, "struct bsc_nat_sccp_inst (RAN)");
+ INIT_LLIST_HEAD(&bsc_nat->cn.mscs);
INIT_LLIST_HEAD(&bsc_nat->ran.bscs);
bsc_nat_fsm_alloc(bsc_nat);
@@ -49,6 +51,7 @@
void bsc_nat_free(struct bsc_nat *bsc_nat)
{
+ struct msc *msc, *m;
struct bsc *bsc, *b;
if (bsc_nat->fi) {
@@ -56,6 +59,10 @@
bsc_nat->fi = NULL;
}
+ llist_for_each_entry_safe(msc, m, &bsc_nat->cn.mscs, list) {
+ msc_free(msc);
+ }
+
llist_for_each_entry_safe(bsc, b, &bsc_nat->ran.bscs, list) {
bsc_free(bsc);
}
diff --git a/src/osmo-bsc-nat/bsc_nat_fsm.c b/src/osmo-bsc-nat/bsc_nat_fsm.c
index 07b9eb5..4193ae9 100644
--- a/src/osmo-bsc-nat/bsc_nat_fsm.c
+++ b/src/osmo-bsc-nat/bsc_nat_fsm.c
@@ -186,22 +186,7 @@
case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION):
/* connection-less data received */
- addr = &prim->u.unitdata.calling_addr;
-
- if (sccp_sap_get_peer_addr_out(sccp_inst, addr, &peer_addr_out) < 0)
- goto error;
-
- LOGP(DMAIN, LOGL_DEBUG, "Fwd to %s\n", bsc_nat_print_addr_ran(&peer_addr_out));
-
- /* oph->msg stores oph and unitdata msg. Move oph->msg->data to
- * unitdata msg and send it again. */
- msgb_pull_to_l2(oph->msg);
- osmo_sccp_tx_unitdata(g_bsc_nat->ran.sccp_inst->scu,
- &g_bsc_nat->ran.sccp_inst->addr,
- &peer_addr_out,
- oph->msg->data,
- msgb_length(oph->msg));
- rc = 0;
+ rc = bssap_handle_udt(sccp_inst, &prim->u.unitdata.calling_addr, oph->msg, msgb_l2len(oph->msg));
break;
default:
diff --git a/src/osmo-bsc-nat/main.c b/src/osmo-bsc-nat/main.c
index c0b65ea..6cb1e0f 100644
--- a/src/osmo-bsc-nat/main.c
+++ b/src/osmo-bsc-nat/main.c
@@ -30,6 +30,7 @@
#include <osmocom/bsc_nat/bsc_nat.h>
#include <osmocom/bsc_nat/bsc_nat_fsm.h>
#include <osmocom/bsc_nat/logging.h>
+#include <osmocom/bsc_nat/msc.h>
#include <osmocom/bsc_nat/vty.h>
static const char *const copyright =
@@ -199,6 +200,9 @@
bsc_nat_fsm_start(g_bsc_nat);
+ if (msc_alloc_from_addr_book() < 0)
+ exit(1);
+
while (!osmo_select_shutdown_done())
osmo_select_main_ctx(0);
diff --git a/src/osmo-bsc-nat/msc.c b/src/osmo-bsc-nat/msc.c
new file mode 100644
index 0000000..70f9d76
--- /dev/null
+++ b/src/osmo-bsc-nat/msc.c
@@ -0,0 +1,71 @@
+/* (C) 2021 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>
+ * Author: Oliver Smith <osmith(a)sysmocom.de>
+ * All Rights Reserved
+ *
+ * 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
+ * the Free Software Foundation; either version 3 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/lienses/>.
+ *
+ */
+
+#include "config.h"
+#include <errno.h>
+#include <osmocom/bsc_nat/msc.h>
+#include <osmocom/bsc_nat/bsc_nat.h>
+#include <osmocom/bsc_nat/logging.h>
+
+struct msc *msc_alloc(struct osmo_sccp_addr *addr)
+{
+ struct msc *msc = talloc_zero(g_bsc_nat, struct msc);
+
+ OSMO_ASSERT(msc);
+ talloc_set_name(msc, "MSC(PC=%s)", osmo_ss7_pointcode_print(NULL, addr->pc));
+
+ LOGP(DMAIN, LOGL_DEBUG, "Add %s\n", talloc_get_name(msc));
+
+ msc->addr = *addr;
+
+ INIT_LLIST_HEAD(&msc->list);
+ llist_add(&msc->list, &g_bsc_nat->cn.mscs);
+
+ return msc;
+}
+
+int msc_alloc_from_addr_book(void)
+{
+ struct osmo_sccp_addr addr;
+
+ /* For now only one MSC is supported */
+ if (osmo_sccp_addr_by_name_local(&addr, "msc", g_bsc_nat->cn.sccp_inst->ss7_inst) < 0) {
+ LOGP(DMAIN, LOGL_ERROR, "Configuration error, MSC not found in address book\n");
+ return -ENOENT;
+ }
+
+ msc_alloc(&addr);
+ return 0;
+}
+
+struct msc *msc_get(void)
+{
+ /* For now only one MSC is supported */
+
+ OSMO_ASSERT(!llist_empty(&g_bsc_nat->cn.mscs));
+
+ return llist_first_entry(&g_bsc_nat->cn.mscs, struct msc, list);
+}
+
+void msc_free(struct msc *msc)
+{
+ LOGP(DMAIN, LOGL_DEBUG, "Del %s\n", talloc_get_name(msc));
+ llist_del(&msc->list);
+ talloc_free(msc);
+}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27473
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc-nat
Gerrit-Branch: master
Gerrit-Change-Id: I711df0c649728f1007857fbfda500ed5ef69287b
Gerrit-Change-Number: 27473
Gerrit-PatchSet: 4
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27471 )
Change subject: Reply to BSC's RESET with RESET ACK directly
......................................................................
Reply to BSC's RESET with RESET ACK directly
Let the BSCNAT directly reply to RESET sent from BSC with RESET ACK.
bssap_ran_handle_reset() is a bit empty right now but will be used in a
future patch to store the BSC.
Related: SYS#5560
Related: https://osmocom.org/projects/osmo-bscnat/wiki/AoIP_OsmoBSCNAT#RESET
Change-Id: I3223409e25c93b625d67634caf68efe9772e2558
---
M include/osmocom/bsc_nat/Makefile.am
A include/osmocom/bsc_nat/bssap.h
M src/osmo-bsc-nat/Makefile.am
M src/osmo-bsc-nat/bsc_nat_fsm.c
A src/osmo-bsc-nat/bssap.c
5 files changed, 130 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/include/osmocom/bsc_nat/Makefile.am b/include/osmocom/bsc_nat/Makefile.am
index 90f44a7..76aada0 100644
--- a/include/osmocom/bsc_nat/Makefile.am
+++ b/include/osmocom/bsc_nat/Makefile.am
@@ -1,6 +1,7 @@
noinst_HEADERS = \
bsc_nat.h \
bsc_nat_fsm.h \
+ bssap.h \
logging.h \
vty.h \
$(NULL)
diff --git a/include/osmocom/bsc_nat/bssap.h b/include/osmocom/bsc_nat/bssap.h
new file mode 100644
index 0000000..996cb69
--- /dev/null
+++ b/include/osmocom/bsc_nat/bssap.h
@@ -0,0 +1,25 @@
+/* (C) 2022 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>
+ * Author: Oliver Smith <osmith(a)sysmocom.de>
+ * All Rights Reserved
+ *
+ * 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
+ * the Free Software Foundation; either version 3 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/lienses/>.
+ *
+ */
+
+#pragma once
+
+#include <osmocom/bsc_nat/bsc_nat.h>
+
+int bssap_handle_udt(struct bsc_nat_sccp_inst *sccp_inst, struct osmo_sccp_addr *addr, struct msgb *msgb,
+ unsigned int length);
diff --git a/src/osmo-bsc-nat/Makefile.am b/src/osmo-bsc-nat/Makefile.am
index 6a759cb..445c098 100644
--- a/src/osmo-bsc-nat/Makefile.am
+++ b/src/osmo-bsc-nat/Makefile.am
@@ -27,6 +27,7 @@
osmo_bsc_nat_SOURCES = \
bsc_nat.c \
bsc_nat_fsm.c \
+ bssap.c \
logging.c \
main.c \
vty.c \
diff --git a/src/osmo-bsc-nat/bsc_nat_fsm.c b/src/osmo-bsc-nat/bsc_nat_fsm.c
index 4ce60ce..0c36607 100644
--- a/src/osmo-bsc-nat/bsc_nat_fsm.c
+++ b/src/osmo-bsc-nat/bsc_nat_fsm.c
@@ -27,6 +27,7 @@
#include <osmocom/sigtran/sccp_helpers.h>
#include <osmocom/bsc_nat/bsc_nat.h>
#include <osmocom/bsc_nat/bsc_nat_fsm.h>
+#include <osmocom/bsc_nat/bssap.h>
#include <osmocom/bsc_nat/logging.h>
#define DEFAULT_PC_RAN "0.23.1" /* same as default for OsmoMSC */
@@ -299,6 +300,10 @@
case OSMO_PRIM(OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_INDICATION):
/* connection-less data received */
+ rc = bssap_handle_udt(sccp_inst, &prim->u.unitdata.calling_addr, oph->msg, msgb_l2len(oph->msg));
+
+ /* FIXME: don't forward this to the MSC anymore, as soon as the
+ * BSCNAT is able to do the RESET to MSC by itself. */
addr = &prim->u.unitdata.calling_addr;
if (sccp_sap_get_peer_addr_out(sccp_inst, addr, &peer_addr_out) < 0)
@@ -314,7 +319,6 @@
&peer_addr_out,
oph->msg->data,
msgb_length(oph->msg));
- rc = 0;
break;
default:
diff --git a/src/osmo-bsc-nat/bssap.c b/src/osmo-bsc-nat/bssap.c
new file mode 100644
index 0000000..c054db6
--- /dev/null
+++ b/src/osmo-bsc-nat/bssap.c
@@ -0,0 +1,98 @@
+/* (C) 2022 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>
+ * Author: Oliver Smith <osmith(a)sysmocom.de>
+ * All Rights Reserved
+ *
+ * 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
+ * the Free Software Foundation; either version 3 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/lienses/>.
+ *
+ */
+
+#include "config.h"
+#include <osmocom/core/msgb.h>
+#include <osmocom/gsm/gsm0808.h>
+#include <osmocom/sigtran/sccp_helpers.h>
+#include <osmocom/sigtran/sccp_sap.h>
+#include <osmocom/bsc_nat/bsc_nat.h>
+#include <osmocom/bsc_nat/logging.h>
+
+static int bssap_ran_handle_reset(struct osmo_sccp_addr *addr, struct msgb *msg, unsigned int length)
+{
+ struct bsc_nat_sccp_inst *sccp_inst = g_bsc_nat->ran;
+
+ LOGP(DMAIN, LOGL_NOTICE, "Rx RESET from %s\n", bsc_nat_print_addr(sccp_inst, addr));
+
+ LOGP(DMAIN, LOGL_NOTICE, "Tx RESET ACK to %s\n", bsc_nat_print_addr(sccp_inst, addr));
+ msg = gsm0808_create_reset_ack();
+ return osmo_sccp_tx_unitdata_msg(sccp_inst->scu, &sccp_inst->addr, addr, msg);
+}
+
+static int bssap_ran_rcvmsg_udt(struct osmo_sccp_addr *addr, struct msgb *msg, unsigned int length)
+{
+ int ret = 0;
+
+ switch (msg->l3h[0]) {
+ case BSS_MAP_MSG_RESET:
+ ret = bssap_ran_handle_reset(addr, msg, length);
+ break;
+ default:
+ LOGP(DMAIN, LOGL_NOTICE, "Unimplemented BSSMAP UDT %s\n", gsm0808_bssap_name(msg->l3h[0]));
+ break;
+ }
+
+ return ret;
+}
+
+static int bssap_rcvmsg_udt(struct bsc_nat_sccp_inst *sccp_inst, struct osmo_sccp_addr *addr, struct msgb *msg,
+ unsigned int length)
+{
+ if (length < 1) {
+ LOGP(DMAIN, LOGL_ERROR, "Not enough room: %u\n", length);
+ return -1;
+ }
+
+ LOGP(DMAIN, LOGL_NOTICE, "Rx UDT BSSMAP %s\n", gsm0808_bssap_name(msg->l3h[0]));
+
+ /* NOTE: bssap_cn_rcvmsg_udt() will be added in a future patch */
+ return bssap_ran_rcvmsg_udt(addr, msg, length);
+}
+
+int bssap_handle_udt(struct bsc_nat_sccp_inst *sccp_inst, struct osmo_sccp_addr *addr, struct msgb *msgb,
+ unsigned int length)
+{
+ struct bssmap_header *bs;
+ int rc = -1;
+
+ LOGP(DMAIN, LOGL_DEBUG, "Rx UDT: %s\n", osmo_hexdump(msgb->l2h, length));
+
+ if (length < sizeof(*bs)) {
+ LOGP(DMAIN, LOGL_ERROR, "The header is too short\n");
+ return -1;
+ }
+
+ bs = (struct bssmap_header *)msgb->l2h;
+ if (bs->length < length - sizeof(*bs)) {
+ LOGP(DMAIN, LOGL_ERROR, "Failed to parse BSSMAP header\n");
+ return -1;
+ }
+
+ switch (bs->type) {
+ case BSSAP_MSG_BSS_MANAGEMENT:
+ msgb->l3h = &msgb->l2h[sizeof(*bs)];
+ rc = bssap_rcvmsg_udt(sccp_inst, addr, msgb, length - sizeof(*bs));
+ break;
+ default:
+ LOGP(DMAIN, LOGL_NOTICE, "Unimplemented msg type: %s\n", gsm0808_bssap_name(bs->type));
+ }
+
+ return rc;
+}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc-nat/+/27471
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc-nat
Gerrit-Branch: master
Gerrit-Change-Id: I3223409e25c93b625d67634caf68efe9772e2558
Gerrit-Change-Number: 27471
Gerrit-PatchSet: 4
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>
Gerrit-MessageType: merged
Attention is currently required from: laforge, dexter.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27552 )
Change subject: osmo-bts-trx: rx_tchh_fn(): get rid of chan_state->meas_avg_facch
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
> this is probably the kind of change we want @pmaier to review, but unfortunately he's unavailable th […]
Yes, definitely. We can wait until he's back, not urgent.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27552
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I7902b4709bc3f418174e8373f52e87bb31cdc826
Gerrit-Change-Number: 27552
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 22 Mar 2022 21:34:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: comment
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27558 )
Change subject: trx_sched_ul_burst(): get rid of the 'switch' statement
......................................................................
trx_sched_ul_burst(): get rid of the 'switch' statement
Both TRXC_RACH and TRXC_PTCCH are handled in the rx_rach_fn(),
so we can eliminate the need of having a 'switch' statement in
the general (perfrmance critical) code path.
Change-Id: I66d8785a63215af37a77e258039549e4e6292e49
---
M src/common/scheduler.c
M src/osmo-bts-trx/sched_lchan_rach.c
2 files changed, 7 insertions(+), 10 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
laforge: Looks good to me, but someone else must approve
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index b27d7ea..e6a664f 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -1546,16 +1546,9 @@
/* handle NOPE indications */
if (bi->flags & TRX_BI_F_NOPE_IND) {
- switch (bi->chan) {
- case TRXC_PTCCH:
- case TRXC_RACH:
- /* For some logical channel types NOPE.ind is valueless. */
- return 0;
- default:
- /* NOTE: Uplink burst handler must check bi->burst_len before
- * accessing bi->burst to avoid uninitialized memory access. */
- return func(l1ts, bi);
- }
+ /* NOTE: Uplink burst handler must check bi->burst_len before
+ * accessing bi->burst to avoid uninitialized memory access. */
+ return func(l1ts, bi);
}
/* decrypt */
diff --git a/src/osmo-bts-trx/sched_lchan_rach.c b/src/osmo-bts-trx/sched_lchan_rach.c
index c3abf32..5d9d0b1 100644
--- a/src/osmo-bts-trx/sched_lchan_rach.c
+++ b/src/osmo-bts-trx/sched_lchan_rach.c
@@ -112,6 +112,10 @@
uint8_t ra;
int rc;
+ /* Ignore NOPE indications, they're of no use here */
+ if (bi->flags & TRX_BI_F_NOPE_IND)
+ return 0;
+
/* TSC (Training Sequence Code) is an optional parameter of the UL burst
* indication. We need this information in order to decide whether an
* Access Burst is 11-bit encoded or not (see OS#1854). If this information
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27558
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I66d8785a63215af37a77e258039549e4e6292e49
Gerrit-Change-Number: 27558
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(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-MessageType: merged
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27550 )
Change subject: osmo-bts-trx: rx_tchh_fn(): use proper meas averaging mode
......................................................................
osmo-bts-trx: rx_tchh_fn(): use proper meas averaging mode
Compared to TCH/F, TCH/H is a bit special in a way that:
* speech frames are interleaved over 4 consecutive bursts,
* while FACCH frames are interleaved over 6 consecutive bursts.
This is why in rx_tchh_fn() we allocate a buffer large enough to
store up to 6 bursts. Let's say we have that buffer filled up
completely with all 6 bursts (from 'a' to 'f'). Now attempting
to decode them may yield either a speech frame or a FACCH frame:
+---+---+---+---+---+---+
| a | b | c | d | e | f | Burst 'a' received first, 'f' last
+---+---+---+---+---+---+
^^^^^^^^^^^^^^^ Speech frame (bursts 'a' .. 'd')
^^^^^^^^^^^^^^^^^^^^^^^ FACCH frame (bursts 'a' .. 'f')
For FACCH we use measurement averaging mode SCHED_MEAS_AVG_M_S6N6,
so that 6 last samples are averaged - so far so good. For speech
we use SCHED_MEAS_AVG_M_S4N4, so that 4 last samples corresponding
to bursts 'c', 'd', 'e', 'f' are averaged - this is wrong.
We actually need to average the *first* 4 samples corresponding to
bursts 'a', 'b', 'c', 'd' in the case of speech. Let's add and use
a new averaging mode SCHED_MEAS_AVG_M_S6N4 for that.
Change-Id: Iea6f4e5471550f4c2b57aaebeac83c80e879489d
---
M include/osmo-bts/scheduler.h
M src/osmo-bts-trx/sched_lchan_tchh.c
M src/osmo-bts-trx/scheduler_trx.c
3 files changed, 5 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index 8643edd..1e1a2d7 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -306,10 +306,12 @@
/* Averaging mode for trx_sched_meas_avg() */
enum sched_meas_avg_mode {
- /* last 4 bursts (default for xCCH, TCH/H, PTCCH and PDTCH) */
+ /* last 4 bursts (default for xCCH, PTCCH and PDTCH) */
SCHED_MEAS_AVG_M_S4N4,
/* last 8 bursts (default for TCH/F and FACCH/F) */
SCHED_MEAS_AVG_M_S8N8,
+ /* first 4 of last 6 bursts (default for TCH/H) */
+ SCHED_MEAS_AVG_M_S6N4,
/* last 6 bursts (default for FACCH/H) */
SCHED_MEAS_AVG_M_S6N6,
/* first 4 of last 8 bursts */
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index 8264163..edbb566 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -64,7 +64,7 @@
* Even FN ending at: 10,11,19,20,2,3
*/
int fn_is_odd = (((bi->fn + 26 - 10) % 26) >> 2) & 1;
- enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_S4N4;
+ enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_S6N4;
struct l1sched_meas_set meas_avg;
unsigned int fn_begin;
unsigned int fn_tch_end;
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 78c7b4a..6ce5a9a 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -635,6 +635,7 @@
static const uint8_t trx_sched_meas_modeset[][2] = {
[SCHED_MEAS_AVG_M_S4N4] = { 4, 4 },
[SCHED_MEAS_AVG_M_S8N8] = { 8, 8 },
+ [SCHED_MEAS_AVG_M_S6N4] = { 6, 4 },
[SCHED_MEAS_AVG_M_S6N6] = { 6, 6 },
[SCHED_MEAS_AVG_M_S8N4] = { 8, 4 },
[SCHED_MEAS_AVG_M_S6N2] = { 6, 2 },
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27550
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iea6f4e5471550f4c2b57aaebeac83c80e879489d
Gerrit-Change-Number: 27550
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(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-MessageType: merged
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27548 )
Change subject: osmo-bts-trx: use consistent naming for 'enum sched_meas_avg_mode'
......................................................................
osmo-bts-trx: use consistent naming for 'enum sched_meas_avg_mode'
This is a purely cosmetic change. The new naming clearly indicates
how deep to go back in the measurement history (S) and how many
samples to average (N). For example:
* SCHED_MEAS_AVG_M_S4N4 - go S=4 steps back and average N=4 samples;
* SCHED_MEAS_AVG_M_S6N2 - go S=6 steps back and average N=2 samples.
Change-Id: I96a8dd08084c7c179f879fc00e75c5edcfb11caa
---
M include/osmo-bts/scheduler.h
M src/osmo-bts-trx/sched_lchan_pdtch.c
M src/osmo-bts-trx/sched_lchan_tchf.c
M src/osmo-bts-trx/sched_lchan_tchh.c
M src/osmo-bts-trx/sched_lchan_xcch.c
M src/osmo-bts-trx/scheduler_trx.c
6 files changed, 21 insertions(+), 21 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index d640647..8643edd 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -307,17 +307,17 @@
/* Averaging mode for trx_sched_meas_avg() */
enum sched_meas_avg_mode {
/* last 4 bursts (default for xCCH, TCH/H, PTCCH and PDTCH) */
- SCHED_MEAS_AVG_M_QUAD,
+ SCHED_MEAS_AVG_M_S4N4,
/* last 8 bursts (default for TCH/F and FACCH/F) */
- SCHED_MEAS_AVG_M_OCTO,
+ SCHED_MEAS_AVG_M_S8N8,
/* last 6 bursts (default for FACCH/H) */
- SCHED_MEAS_AVG_M_SIX,
+ SCHED_MEAS_AVG_M_S6N6,
/* first 4 of last 8 bursts */
- SCHED_MEAS_AVG_M8_FIRST_QUAD,
+ SCHED_MEAS_AVG_M_S8N4,
/* first 2 of last 6 bursts */
- SCHED_MEAS_AVG_M6_FIRST_TWO,
+ SCHED_MEAS_AVG_M_S6N2,
/* middle 2 of last 6 bursts */
- SCHED_MEAS_AVG_M6_MIDDLE_TWO,
+ SCHED_MEAS_AVG_M_S4N2,
};
void trx_sched_meas_push(struct l1sched_chan_state *chan_state,
diff --git a/src/osmo-bts-trx/sched_lchan_pdtch.c b/src/osmo-bts-trx/sched_lchan_pdtch.c
index 6a2ad0d..92bb5a8 100644
--- a/src/osmo-bts-trx/sched_lchan_pdtch.c
+++ b/src/osmo-bts-trx/sched_lchan_pdtch.c
@@ -101,7 +101,7 @@
return 0;
/* average measurements of the last 4 bursts */
- trx_sched_meas_avg(chan_state, &meas_avg, SCHED_MEAS_AVG_M_QUAD);
+ trx_sched_meas_avg(chan_state, &meas_avg, SCHED_MEAS_AVG_M_S4N4);
/* check for complete set of bursts */
if ((*mask & 0xf) != 0xf) {
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index 1bf67a0..0388ec0 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -55,7 +55,7 @@
uint8_t rsl_cmode = chan_state->rsl_cmode;
uint8_t tch_mode = chan_state->tch_mode;
uint8_t tch_data[128]; /* just to be safe */
- enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_OCTO;
+ enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_S8N8;
struct l1sched_meas_set meas_avg;
int rc, amr = 0;
int n_errors = 0;
@@ -175,11 +175,11 @@
switch (chan_state->amr_last_dtx) {
case AFS_SID_FIRST:
case AFS_SID_UPDATE_CN:
- meas_avg_mode = SCHED_MEAS_AVG_M8_FIRST_QUAD;
+ meas_avg_mode = SCHED_MEAS_AVG_M_S8N4;
break;
case AFS_SID_UPDATE:
case AFS_ONSET:
- meas_avg_mode = SCHED_MEAS_AVG_M_QUAD;
+ meas_avg_mode = SCHED_MEAS_AVG_M_S4N4;
break;
}
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index 5d2c12c..8264163 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -64,7 +64,7 @@
* Even FN ending at: 10,11,19,20,2,3
*/
int fn_is_odd = (((bi->fn + 26 - 10) % 26) >> 2) & 1;
- enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_QUAD;
+ enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_S4N4;
struct l1sched_meas_set meas_avg;
unsigned int fn_begin;
unsigned int fn_tch_end;
@@ -214,10 +214,10 @@
case AHS_SID_UPDATE_CN:
case AHS_SID_FIRST_INH:
case AHS_SID_UPDATE_INH:
- meas_avg_mode = SCHED_MEAS_AVG_M6_FIRST_TWO;
+ meas_avg_mode = SCHED_MEAS_AVG_M_S6N2;
break;
case AHS_ONSET:
- meas_avg_mode = SCHED_MEAS_AVG_M6_MIDDLE_TWO;
+ meas_avg_mode = SCHED_MEAS_AVG_M_S4N2;
break;
}
@@ -250,7 +250,7 @@
/* average measurements of the last N (depends on mode) bursts */
if (rc == GSM_MACBLOCK_LEN)
- meas_avg_mode = SCHED_MEAS_AVG_M_SIX;
+ meas_avg_mode = SCHED_MEAS_AVG_M_S6N6;
trx_sched_meas_avg(chan_state, &meas_avg, meas_avg_mode);
/* Check if the frame is bad */
diff --git a/src/osmo-bts-trx/sched_lchan_xcch.c b/src/osmo-bts-trx/sched_lchan_xcch.c
index 6a65574..1d529f2 100644
--- a/src/osmo-bts-trx/sched_lchan_xcch.c
+++ b/src/osmo-bts-trx/sched_lchan_xcch.c
@@ -111,7 +111,7 @@
return 0;
/* average measurements of the last 4 bursts */
- trx_sched_meas_avg(chan_state, &meas_avg, SCHED_MEAS_AVG_M_QUAD);
+ trx_sched_meas_avg(chan_state, &meas_avg, SCHED_MEAS_AVG_M_S4N4);
/* check for complete set of bursts */
if ((*mask & 0xf) != 0xf) {
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 3a6418b..74de902 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -647,27 +647,27 @@
switch (mode) {
/* last 4 bursts (default for xCCH, TCH/H, PTCCH and PDTCH) */
- case SCHED_MEAS_AVG_M_QUAD:
+ case SCHED_MEAS_AVG_M_S4N4:
n = 4; shift = n;
break;
/* last 8 bursts (default for TCH/F and FACCH/F) */
- case SCHED_MEAS_AVG_M_OCTO:
+ case SCHED_MEAS_AVG_M_S8N8:
n = 8; shift = n;
break;
/* last 6 bursts (default for FACCH/H) */
- case SCHED_MEAS_AVG_M_SIX:
+ case SCHED_MEAS_AVG_M_S6N6:
n = 6; shift = n;
break;
/* first 4 of last 8 bursts */
- case SCHED_MEAS_AVG_M8_FIRST_QUAD:
+ case SCHED_MEAS_AVG_M_S8N4:
n = 4; shift = 8;
break;
/* first 2 of last 6 bursts */
- case SCHED_MEAS_AVG_M6_FIRST_TWO:
+ case SCHED_MEAS_AVG_M_S6N2:
n = 2; shift = 6;
break;
/* middle 2 of last 6 bursts */
- case SCHED_MEAS_AVG_M6_MIDDLE_TWO:
+ case SCHED_MEAS_AVG_M_S4N2:
n = 2; shift = 4;
break;
default:
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27548
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I96a8dd08084c7c179f879fc00e75c5edcfb11caa
Gerrit-Change-Number: 27548
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(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-MessageType: merged
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27523 )
Change subject: BSC_Tests: avoid code duplication in f_expect_chan_rel()
......................................................................
BSC_Tests: avoid code duplication in f_expect_chan_rel()
Using a guard statement makes no sense given that we match the
cellSelectionIndicatorValue conditionally within the alt branch
itself. Removing that guard statement eliminates the need to
have an additional alt branch with identical body.
Change-Id: I373376637a083637ce01f3ac59fe5fd2836ac6cd
---
M bsc/BSC_Tests.ttcn
1 file changed, 1 insertion(+), 20 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index a553f25..4683dc7 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -2052,7 +2052,7 @@
got_deact_sacch := true;
repeat;
}
- [not istemplatekind(expect_cells, "omit")] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(tr_RSL_DATA_REQ(rsl_chan_nr, ?, decmatch tr_RRM_RR_RELEASE_CellSelectInd))) -> value ud {
+ [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(tr_RSL_DATA_REQ(rsl_chan_nr, ?, decmatch tr_RRM_RR_RELEASE))) -> value ud {
got_rr_chan_rel := true;
if (f_rsl_find_ie(ud.rsl, RSL_IE_L3_INFO, l3_ie) == false) {
@@ -2084,25 +2084,6 @@
}
repeat;
}
- [istemplatekind(expect_cells, "omit")] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(tr_RSL_DATA_REQ(rsl_chan_nr, ?, decmatch tr_RRM_RR_RELEASE))) -> value ud {
- got_rr_chan_rel := true;
-
- if (f_rsl_find_ie(ud.rsl, RSL_IE_L3_INFO, l3_ie) == false) {
- setverdict(fail, "cannot find L3");
- mtc.stop;
- }
- l3 := dec_PDU_ML3_NW_MS(l3_ie.l3_info.payload);
-
- int2enum(oct2int(l3.msgs.rrm.channelRelease.rRCause.valuePart), got_cause);
- log("GOT CAUSE CODE: ", l3.msgs.rrm.channelRelease.rRCause.valuePart, " = ", got_cause);
- if (match(got_cause, expect_rr_cause)) {
- setverdict(pass);
- } else {
- log("EXPECTED CAUSE CODE: ", expect_rr_cause);
- setverdict(fail, "Received RR Channel Release Cause code does not match expectations");
- }
- repeat;
- }
[] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(tr_RSL_REL_REQ(rsl_chan_nr, ?))) {
got_rll_rel_req := true;
/* FIXME: Why are we getting this for LinkID SACCH? */
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27523
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I373376637a083637ce01f3ac59fe5fd2836ac6cd
Gerrit-Change-Number: 27523
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27536 )
Change subject: gen_links.sh.inc: Fix globbing writing '*.ttcn' to */.gitignore
......................................................................
gen_links.sh.inc: Fix globbing writing '*.ttcn' to */.gitignore
This was the case under ggsn_tests, which in turn prevents search text
tools like "ag" to find stuff in .ttcn files (because it skips code in
.gitignore).
Change-Id: Iaef3cfd5ae29db352046664ab4949b037ca80307
---
M gen_links.sh.inc
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
laforge: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/gen_links.sh.inc b/gen_links.sh.inc
index 539b398..c21bcd6 100644
--- a/gen_links.sh.inc
+++ b/gen_links.sh.inc
@@ -36,6 +36,8 @@
}
ignore_pp_results() {
+ # Avoid using the pattern itself if no file is found in globbing below:
+ shopt -s nullglob
for pp in *.ttcnpp; do
ttcn_file="$(echo $pp | sed 's/pp$//')"
echo "$ttcn_file" >> .gitignore
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27536
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iaef3cfd5ae29db352046664ab4949b037ca80307
Gerrit-Change-Number: 27536
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged