fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/43635?usp=email )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: debian: add packaging for osmo-trx-proxy
......................................................................
debian: add packaging for osmo-trx-proxy
Ship the osmo-trx-proxy binary and its default/example VTY config
(doc/examples/osmo-trx-proxy/osmo-trx-proxy.cfg), following the same
layout as the osmo-trx-ipc package.
Change-Id: I995b44bf9a884cf5ba6db8333e6f08c9604a58a5
Related: OS#6672
---
M debian/control
A debian/osmo-trx-proxy.install
2 files changed, 12 insertions(+), 0 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/debian/control b/debian/control
index 25b3041..bb93b1c 100644
--- a/debian/control
+++ b/debian/control
@@ -189,6 +189,15 @@
between different telecommunication associations for developing new
generations of mobile phone networks. (post-2G/GSM)
+Package: osmo-trx-proxy
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Virtual TRX endpoint proxy for testing without SDR hardware
+ osmo-trx-proxy speaks the TRXC/TRXD protocol on one or more virtual TRX
+ endpoints, simulating an RF path (path loss, ToA, C/I) between them instead
+ of driving actual SDR hardware. It allows testing L1 software (e.g.
+ OsmoBTS) or MS-side stacks (e.g. osmocom-bb/trxcon) without a radio.
+
Package: osmo-trx-doc
Architecture: all
Section: doc
diff --git a/debian/osmo-trx-proxy.install b/debian/osmo-trx-proxy.install
new file mode 100644
index 0000000..d0309eb
--- /dev/null
+++ b/debian/osmo-trx-proxy.install
@@ -0,0 +1,3 @@
+etc/osmocom/osmo-trx-proxy.cfg
+usr/bin/osmo-trx-proxy
+usr/share/doc/osmo-trx/examples/osmo-trx-proxy/osmo-trx-proxy.cfg /usr/share/doc/osmo-trx/examples/osmo-trx-proxy/
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/43635?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I995b44bf9a884cf5ba6db8333e6f08c9604a58a5
Gerrit-Change-Number: 43635
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>
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/43636?usp=email )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: contrib/systemd: add a service file for osmo-trx-proxy
......................................................................
contrib/systemd: add a service file for osmo-trx-proxy
Add osmo-trx-proxy.service, and package it in osmo-trx-proxy along
with the postinst logic to create the 'osmocom' system user/group
it runs as, matching the other osmo-trx-* backends.
Change-Id: I8c5bc092dc5bf6bf07d6e80f64ac7fc06f0cfb96
Related: OS#6672
---
M contrib/systemd/Makefile.am
A contrib/systemd/osmo-trx-proxy.service
M debian/osmo-trx-proxy.install
A debian/osmo-trx-proxy.postinst
4 files changed, 52 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
diff --git a/contrib/systemd/Makefile.am b/contrib/systemd/Makefile.am
index 6566b97..b8cd7eb 100644
--- a/contrib/systemd/Makefile.am
+++ b/contrib/systemd/Makefile.am
@@ -2,7 +2,8 @@
osmo-trx-lms.service \
osmo-trx-uhd.service \
osmo-trx-usrp1.service \
- osmo-trx-ipc.service
+ osmo-trx-ipc.service \
+ osmo-trx-proxy.service
if HAVE_SYSTEMD
SYSTEMD_SERVICES =
@@ -23,5 +24,9 @@
SYSTEMD_SERVICES += osmo-trx-ipc.service
endif
+if ENABLE_PROXY
+SYSTEMD_SERVICES += osmo-trx-proxy.service
+endif
+
systemdsystemunit_DATA = $(SYSTEMD_SERVICES)
endif # HAVE_SYSTEMD
diff --git a/contrib/systemd/osmo-trx-proxy.service b/contrib/systemd/osmo-trx-proxy.service
new file mode 100644
index 0000000..8d79933
--- /dev/null
+++ b/contrib/systemd/osmo-trx-proxy.service
@@ -0,0 +1,23 @@
+[Unit]
+Description=Osmocom Virtual TRX Endpoint Proxy
+After=network-online.target
+Wants=network-online.target
+
+[Service]
+Type=simple
+Restart=always
+StateDirectory=osmocom
+WorkingDirectory=%S/osmocom
+User=osmocom
+Group=osmocom
+ExecStart=/usr/bin/osmo-trx-proxy -c /etc/osmocom/osmo-trx-proxy.cfg
+RestartSec=2
+AmbientCapabilities=CAP_SYS_NICE
+# CPU scheduling policy:
+CPUSchedulingPolicy=rr
+# For real-time scheduling policies an integer between 1 (lowest priority) and 99 (highest priority):
+CPUSchedulingPriority=21
+# See sched(7) for further details on real-time policies and priorities
+
+[Install]
+WantedBy=multi-user.target
diff --git a/debian/osmo-trx-proxy.install b/debian/osmo-trx-proxy.install
index d0309eb..0a3cb05 100644
--- a/debian/osmo-trx-proxy.install
+++ b/debian/osmo-trx-proxy.install
@@ -1,3 +1,4 @@
etc/osmocom/osmo-trx-proxy.cfg
+lib/systemd/system/osmo-trx-proxy.service
usr/bin/osmo-trx-proxy
usr/share/doc/osmo-trx/examples/osmo-trx-proxy/osmo-trx-proxy.cfg /usr/share/doc/osmo-trx/examples/osmo-trx-proxy/
diff --git a/debian/osmo-trx-proxy.postinst b/debian/osmo-trx-proxy.postinst
new file mode 100755
index 0000000..d4857a2
--- /dev/null
+++ b/debian/osmo-trx-proxy.postinst
@@ -0,0 +1,22 @@
+#!/bin/sh -e
+case "$1" in
+ configure)
+ # Create the osmocom group and user (if it doesn't exist yet)
+ if ! getent group osmocom >/dev/null; then
+ groupadd --system osmocom
+ fi
+ if ! getent passwd osmocom >/dev/null; then
+ useradd \
+ --system \
+ --gid osmocom \
+ --home-dir /var/lib/osmocom \
+ --shell /sbin/nologin \
+ --comment "Open Source Mobile Communications" \
+ osmocom
+ fi
+ ;;
+esac
+
+# dh_installdeb(1) will replace this with shell code automatically
+# generated by other debhelper scripts.
+#DEBHELPER#
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/43636?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I8c5bc092dc5bf6bf07d6e80f64ac7fc06f0cfb96
Gerrit-Change-Number: 43636
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>
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/43605?usp=email )
(
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: proxy: implement burst forwarding (proxying) logic
......................................................................
proxy: implement burst forwarding (proxying) logic
Implement osmo_trx_ep_rx_burst_req(): forward a Tx burst request
immediately (no per-endpoint queueing yet) to every other powered-on
endpoint/channel whose Rx frequency matches the source channel's Tx
frequency. Hard bits are converted to soft bits via osmo_ubit2sbit();
toa256/rssi are left at placeholder nominal values until the upcoming
path simulation logic computes them for real.
Change-Id: I1df0389ef523a59402081deb8f74b84e136ea7dd
Related: OS#6672
---
M proxy/src/Makefile.am
A proxy/src/burst_fwd.c
2 files changed, 100 insertions(+), 0 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
Jenkins Builder: Verified
fixeria: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
diff --git a/proxy/src/Makefile.am b/proxy/src/Makefile.am
index 4be255f..5c8b931 100644
--- a/proxy/src/Makefile.am
+++ b/proxy/src/Makefile.am
@@ -20,6 +20,7 @@
trx.c \
clck_gen.c \
ctrl_cmd.c \
+ burst_fwd.c \
logging.c \
$(NULL)
diff --git a/proxy/src/burst_fwd.c b/proxy/src/burst_fwd.c
new file mode 100644
index 0000000..2a9f22d
--- /dev/null
+++ b/proxy/src/burst_fwd.c
@@ -0,0 +1,99 @@
+/*! \file src/burst_fwd.c
+ * osmo-trx-proxy: forward Tx bursts by Rx/Tx frequency match. */
+
+/*
+ * (C) 2026 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de>
+ * Author: Vadim Yanitskiy <vyanitskiy(a)sysmocom.de>
+ *
+ * All Rights Reserved
+ *
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ *
+ * 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/licenses/>.
+ */
+
+#include <string.h>
+
+#include <osmocom/core/bits.h>
+#include <osmocom/core/linuxlist.h>
+
+#include <osmocom/trx/ep.h>
+
+#include <osmocom/proxy/proxy.h>
+#include <osmocom/proxy/trx.h>
+#include <osmocom/proxy/logging.h>
+
+/* Placeholder measurement values, until path_sim.c computes them for real
+ * (matches fake_trx.py's FakeTRX nominal defaults: no timing offset, and
+ * -60 dBm = 50 dBm nominal Tx power - 0 dB Tx attenuation - 110 dB path loss). */
+#define BURST_FWD_TOA256_DEFAULT 0
+#define BURST_FWD_RSSI_DEFAULT -60
+
+#define OSMO_TRXD_F_COMMON_MASK ( \
+ OSMO_TRXD_F_NOPE_REQ | \
+ OSMO_TRXD_F_MOD_TYPE | \
+ OSMO_TRXD_F_TS_INFO | \
+ OSMO_TRXD_F_TRX_NUM \
+ )
+
+static void burst_fwd_to_chan(struct proxy_trx *dst, unsigned int dst_chan,
+ const struct osmo_trxd_burst_req *br)
+{
+ struct osmo_trxd_burst_ind bi = {
+ .flags = br->flags & OSMO_TRXD_F_COMMON_MASK,
+ .fn = br->fn,
+ .tn = br->tn,
+ .toa256 = BURST_FWD_TOA256_DEFAULT,
+ .rssi = BURST_FWD_RSSI_DEFAULT,
+ .burst_len = br->burst_len,
+ .mod = br->mod,
+ .tsc_set = br->tsc_set,
+ .tsc = br->tsc,
+ .trx_num = br->trx_num,
+ };
+
+ osmo_ubit2sbit(bi.burst, br->burst, br->burst_len);
+
+ osmo_trx_ep_send_burst_ind(dst->ep, dst_chan, &bi);
+}
+
+/*! Forward a Tx burst request to every powered-on endpoint/channel
+ * whose Rx frequency matches the source channel's Tx frequency.
+ * TODO: (no frequency hopping support yet, see SETFH in fake_trx.py). */
+void osmo_trx_ep_rx_burst_req(struct osmo_trx_ep *ep, unsigned int chan,
+ const struct osmo_trxd_burst_req *br)
+{
+ const struct proxy_trx *src = osmo_trx_ep_get_priv(ep);
+ const uint32_t tx_freq = src->chans[chan].tx_freq;
+ struct proxy_trx *dst;
+
+ if (!src->powered) {
+ LOGP_TRXCH(src, chan, DTRXD, LOGL_NOTICE,
+ "Rx BURST.req while not powered on, dropping\n");
+ return;
+ }
+
+ llist_for_each_entry(dst, &g_proxy_ctx->trx_list, list) {
+ unsigned int dst_chan;
+
+ if (dst == src || !dst->powered)
+ continue;
+
+ for (dst_chan = 0; dst_chan < dst->num_chans; dst_chan++) {
+ if (dst->chans[dst_chan].rx_freq != tx_freq)
+ continue;
+ burst_fwd_to_chan(dst, dst_chan, br);
+ }
+ }
+}
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/43605?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I1df0389ef523a59402081deb8f74b84e136ea7dd
Gerrit-Change-Number: 43605
Gerrit-PatchSet: 6
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>