pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39690?usp=email )
Change subject: sccp: Allow marking UNIT-DATA.req Sequence Control param non-presence, set SLS
......................................................................
sccp: Allow marking UNIT-DATA.req Sequence Control param non-presence, set SLS
The public API for SCCP UNIT-DATA.req was missing a way to state whether
the "Sequence Control" Parameter was present or not in the primitive.
This was originated most probably by the fact that the field is always
present for SUA CLDT message generated and sent over the wire.
Still, the presence of such field during UNIT-DATA.req actually
indicates the Protocol Class to be used/set on the message.
Hence, it is important to provide it.
Once the Protocol Class to transmit the message is known, we can then
generate a proper SLS.
Change-Id: I834e91c1ec337713b0e684cf4fd7de854150bef6
---
M include/osmocom/sigtran/sccp_sap.h
M src/sccp_helpers.c
M src/sccp_sclc.c
3 files changed, 39 insertions(+), 5 deletions(-)
Approvals:
daniel: Looks good to me, but someone else must approve
Jenkins Builder: Verified
pespin: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h
index d0fb040..98a48be 100644
--- a/include/osmocom/sigtran/sccp_sap.h
+++ b/include/osmocom/sigtran/sccp_sap.h
@@ -236,6 +236,13 @@
};
/* OSMO_SCU_PRIM_N_UNITDATA */
+/* NOTE: Ideally there should have been a "bool in_sequence_control_present",
+ * but that was found too late, so instead set:
+ * "in_sequence_control = OSMO_SCU_UNITDATA_PARAM_SEQUENCE_CONTROL_NOT_PRESENT"
+ * to mark the field not present (aka select Protocol Class 0).
+ * See ITU-T Q.711 6.2.1 for more information.
+ */
+#define OSMO_SCU_UNITDATA_REQ_P_SEQUENCE_CONTROL_NOT_PRESENT 0xffffffff
struct osmo_scu_unitdata_param {
struct osmo_sccp_addr called_addr;
struct osmo_sccp_addr calling_addr;
diff --git a/src/sccp_helpers.c b/src/sccp_helpers.c
index 2a04b9d..6dd9ab8 100644
--- a/src/sccp_helpers.c
+++ b/src/sccp_helpers.c
@@ -72,6 +72,7 @@
param = &prim->u.unitdata;
memcpy(¶m->calling_addr, calling_addr, sizeof(*calling_addr));
memcpy(¶m->called_addr, called_addr, sizeof(*called_addr));
+ param->in_sequence_control = OSMO_SCU_UNITDATA_REQ_P_SEQUENCE_CONTROL_NOT_PRESENT;
osmo_prim_init(&prim->oph, SCCP_SAP_USER, OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_REQUEST, msg);
msg->l2h = msgb_put(msg, len);
diff --git a/src/sccp_sclc.c b/src/sccp_sclc.c
index 186efbd..e0a2844 100644
--- a/src/sccp_sclc.c
+++ b/src/sccp_sclc.c
@@ -35,9 +35,6 @@
* SUA which classic SCCP cannot handle (like IP addresses in GT).
* However, all SCCP features can be expressed in SUA.
*
- * The code only supports Class 2. No support for Class 3 is intended,
- * but patches are of course always welcome.
- *
* Missing other features:
* * Segmentation/Reassembly support
* * T(guard) after (re)start
@@ -67,18 +64,47 @@
{
struct xua_msg *xua = xua_msg_alloc();
struct osmo_scu_unitdata_param *udpar = &prim->u.unitdata;
+ uint32_t seq_ctrl = udpar->in_sequence_control;
+ uint32_t proto_class;
if (!xua)
return NULL;
+ if (seq_ctrl == OSMO_SCU_UNITDATA_REQ_P_SEQUENCE_CONTROL_NOT_PRESENT) {
+ /* ITU-T Q.711 6.2.1 Class 0:
+ * "The SCCP user can invoke this service by means of the parameter
+ * "sequence control" in the N-UNITDATA request primitive being absent" */
+ proto_class = 0;
+ /* Erase the mark, we are anyway not using it in protocol_class=0. */
+ seq_ctrl = 0;
+ /* ITU-T Q.714 (1.1.2.1 Protocol class 0):
+ * "They are transferred independently of each other.
+ * Therefore, they may be delivered to the SCCP user out-of-sequence."
+ */
+ xua->mtp.sls = rand() & 0xf;
+ } else {
+ /* "ITU-T Q.711 6.2.1 Class 1:
+ * "The SCCP user can invoke this service by means of the parameter
+ * "sequence control" in the N-UNITDATA request primitive being present." */
+ proto_class = 1;
+ /* ITU-T Q.714 (1.1.2.2 Protocol class 1):
+ * "The Signalling Link Selection (SLS) parameter in the MTP-TRANSFER
+ * request primitive is chosen by the originating SCCP based on the value
+ * of the sequence control parameter. The SLS shall be identical for a
+ * stream of NSDUs with the same sequence control parameter".
+ * SLS is 4 bits, as described in ITU Q.704 Figure 3.
+ */
+ xua->mtp.sls = udpar->in_sequence_control & 0x0f;
+ }
+
switch (msg_type) {
case SUA_CL_CLDT:
xua->hdr = XUA_HDR(SUA_MSGC_CL, SUA_CL_CLDT);
xua_msg_add_u32(xua, SUA_IEI_ROUTE_CTX, 0); /* FIXME */
- xua_msg_add_u32(xua, SUA_IEI_PROTO_CLASS, 0);
+ xua_msg_add_u32(xua, SUA_IEI_PROTO_CLASS, proto_class);
xua_msg_add_sccp_addr(xua, SUA_IEI_SRC_ADDR, &udpar->calling_addr);
xua_msg_add_sccp_addr(xua, SUA_IEI_DEST_ADDR, &udpar->called_addr);
- xua_msg_add_u32(xua, SUA_IEI_SEQ_CTRL, udpar->in_sequence_control);
+ xua_msg_add_u32(xua, SUA_IEI_SEQ_CTRL, seq_ctrl);
/* optional: importance, ... correlation id? */
if (!prim)
goto prim_needed;
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39690?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I834e91c1ec337713b0e684cf4fd7de854150bef6
Gerrit-Change-Number: 39690
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
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: falconia.
pespin has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/osmo-mgw/+/39751?usp=email )
Change subject: E1: implement dummy fill for HRv1 codec
......................................................................
Patch Set 5: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/39751?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I188bc0a0468b19126281016f45e36f1de617e9ee
Gerrit-Change-Number: 39751
Gerrit-PatchSet: 5
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Comment-Date: Mon, 10 Mar 2025 10:01:32 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39735?usp=email )
Change subject: testenv: use --autoreconf-in-src-copy by default
......................................................................
testenv: use --autoreconf-in-src-copy by default
Pass --autoreconf-in-src-copy to osmo-dev's gen_makefile.py by default,
so we can always avoid errors related to:
* running "./configure" in-tree and out-of-tree (results in "configure:
error: source directory already configured; run "make distclean" there
first")
* running "./configure" / "autoreconf" with different autotools versions
(on host system and in podman container)
I've kept is as experimental flag at first for better testing, but make
it the default now as it seems to work reliably.
The old make dir is cleaned up when the user runs "./testenv.py clean"
the next time.
Related: osmo-dev I18ac50e3441df81e1fe7d8d5321df7e80ab9c650
Change-Id: I41e1fb534e253ddb43f266d73485b83259a8aa40
---
M _testenv/testenv/__init__.py
M _testenv/testenv/osmo_dev.py
M _testenv/testenv/requirements.py
3 files changed, 9 insertions(+), 16 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
fixeria: Looks good to me, approved
diff --git a/_testenv/testenv/__init__.py b/_testenv/testenv/__init__.py
index 4a925bb..c1991ca 100644
--- a/_testenv/testenv/__init__.py
+++ b/_testenv/testenv/__init__.py
@@ -170,14 +170,6 @@
default=ccache_dir_default,
)
- group = sub_run.add_argument_group("experimental options")
- group.add_argument(
- "-A",
- "--autoreconf-in-src-copy",
- action="store_true",
- help="run autoreconf in a copy of the source dir, avoids 'run make distclean' errors",
- )
-
sub.add_parser("clean", help="clean previous build artifacts")
args = parser.parse_args()
diff --git a/_testenv/testenv/osmo_dev.py b/_testenv/testenv/osmo_dev.py
index 8748b93..695ca0d 100644
--- a/_testenv/testenv/osmo_dev.py
+++ b/_testenv/testenv/osmo_dev.py
@@ -73,14 +73,10 @@
os.path.join(testenv.args.cache, "host/usr"),
]
- if testenv.args.autoreconf_in_src_copy:
- # Use a different make dir, so we don't have unexpected behavior when
- # the user already ran autoreconf or ./configure through osmo-dev with
- # the previous make dir, without --autoreconf-in-src-copy.
- make_dir += "2"
- extra_opts += [
- "--autoreconf-in-src-copy",
- ]
+ # Make dirs created without passing --autoreconf-in-src-copy to
+ # gen_makefile.py (as previous versions of testenv did) are incompatible.
+ # Add the "2" to avoid potential conflicts.
+ make_dir += "2"
cmd = [
"./gen_makefile.py",
@@ -103,6 +99,7 @@
"no_systemd.opts",
"werror.opts",
os.path.join(testenv.data_dir, "osmo-dev/osmo-bts-trx.opts"),
+ "--autoreconf-in-src-copy",
] + extra_opts
cwd = get_osmo_dev_dir()
diff --git a/_testenv/testenv/requirements.py b/_testenv/testenv/requirements.py
index 4973f6e..5405f50 100644
--- a/_testenv/testenv/requirements.py
+++ b/_testenv/testenv/requirements.py
@@ -44,6 +44,10 @@
"lddtree",
"qemu-system-x86_64",
]
+ if not testenv.args.binary_repo:
+ programs += [
+ "rsync",
+ ]
abort = False
for program in programs:
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39735?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I41e1fb534e253ddb43f266d73485b83259a8aa40
Gerrit-Change-Number: 39735
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-Reviewer: pespin <pespin(a)sysmocom.de>