fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/40046?usp=email )
Change subject: trx_toolkit/udp_link: Factor code to describe remote into .desc_remote() function
......................................................................
trx_toolkit/udp_link: Factor code to describe remote into .desc_remote() function
And use that utility everywhere where remote of UDPLink is logged.
The reason we are doing this is that with upcoming switch to Cython the
way remote address is stored will change to `struct sockaddr_in` and
instead of updating all users, we will need to only change
UDPLink.desc_remote() in one place.
Add .desc_local() for symmetry.
Change-Id: I1e2fa560ada7a8de4c9b9150058c2a1c73874fbe
---
M src/target/trx_toolkit/data_if.py
M src/target/trx_toolkit/udp_link.py
2 files changed, 9 insertions(+), 5 deletions(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
diff --git a/src/target/trx_toolkit/data_if.py b/src/target/trx_toolkit/data_if.py
index 5bc243f..f59ca17 100644
--- a/src/target/trx_toolkit/data_if.py
+++ b/src/target/trx_toolkit/data_if.py
@@ -70,7 +70,7 @@
msg.parse_msg(data)
except:
log.error("Failed to parse a TRXD Tx message "
- "from R:%s:%u" % (self.remote_addr, self.remote_port))
+ "from R:%s" % self.desc_remote())
return None
# Make sure the header version matches
@@ -90,7 +90,7 @@
msg.parse_msg(bytearray(data))
except:
log.error("Failed to parse a TRXD Rx message "
- "from R:%s:%u" % (self.remote_addr, self.remote_port))
+ "from R:%s" % self.desc_remote())
return None
# Make sure the header version matches
diff --git a/src/target/trx_toolkit/udp_link.py b/src/target/trx_toolkit/udp_link.py
index f0a8224..8690109 100644
--- a/src/target/trx_toolkit/udp_link.py
+++ b/src/target/trx_toolkit/udp_link.py
@@ -34,11 +34,15 @@
def __del__(self):
self.sock.close()
- def desc_link(self):
+ def desc_local(self):
(bind_addr, bind_port) = self.sock.getsockname()
+ return "%s:%u" % (bind_addr, bind_port)
- return "L:%s:%u <-> R:%s:%u" \
- % (bind_addr, bind_port, self.remote_addr, self.remote_port)
+ def desc_remote(self):
+ return "%s:%u" % (self.remote_addr, self.remote_port)
+
+ def desc_link(self):
+ return "L:%s <-> R:%s" % (self.desc_local(), self.desc_remote())
def send(self, data):
self.sendto(data, (self.remote_addr, self.remote_port))
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/40046?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I1e2fa560ada7a8de4c9b9150058c2a1c73874fbe
Gerrit-Change-Number: 40046
Gerrit-PatchSet: 2
Gerrit-Owner: kirr <kirr(a)nexedi.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Attention is currently required from: pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-remsim/+/41947?usp=email )
Change subject: rspro_server.c: Fix missing include for inet_ntoa()
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/41947?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I49352bcc2b8e418e17453809354382bd37eb838e
Gerrit-Change-Number: 41947
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 26 Jan 2026 13:23:06 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-remsim/+/41947?usp=email )
Change subject: rspro_server.c: Fix missing include for inet_ntoa()
......................................................................
rspro_server.c: Fix missing include for inet_ntoa()
This file was calling inet_ntoa() without including arpa/inet.h, which
is the header defining the function according to man and posix
documentation.
Change-Id: I49352bcc2b8e418e17453809354382bd37eb838e
---
M src/server/rspro_server.c
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/47/41947/1
diff --git a/src/server/rspro_server.c b/src/server/rspro_server.c
index 1cc1af1..4e3666c 100644
--- a/src/server/rspro_server.c
+++ b/src/server/rspro_server.c
@@ -3,6 +3,7 @@
#include <unistd.h>
#include <pthread.h>
#include <errno.h>
+#include <arpa/inet.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/select.h>
--
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/41947?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I49352bcc2b8e418e17453809354382bd37eb838e
Gerrit-Change-Number: 41947
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmocom-bb/+/41946?usp=email )
Change subject: fake_trx: reset settings on CMD POWEROFF
......................................................................
Patch Set 1: Verified+1
(1 comment)
Patchset:
PS1:
I have tested this patch by running ttcn3-bts-test.
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/41946?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmocom-bb
Gerrit-Branch: ttcn3-bts-test
Gerrit-Change-Id: I5c58bc684acc7a58d7aa940bb2ae7597d4a282f2
Gerrit-Change-Number: 41946
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 26 Jan 2026 13:05:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes