Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-pcap/+/39166?usp=email )
Change subject: pcap-client: Split client-conn allocation to its own constructor function
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/39166?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: I0cea59f9a94cf1233c2df6ea844a1c5599123d64
Gerrit-Change-Number: 39166
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 20 Dec 2024 17:10:59 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-pcap/+/39164?usp=email )
Change subject: pcap-server: Avoid pcap time-based rotation if wall clock went backwards
......................................................................
Patch Set 3: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/39164?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: If2f609f6980156a70a12a8759110038df44c6655
Gerrit-Change-Number: 39164
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 20 Dec 2024 17:10:28 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: dexter.
laforge has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/39193?usp=email )
Change subject: construct: allow stripping of leading zeros with StripTrailerAdapter
......................................................................
Patch Set 2: Code-Review-1
(1 comment)
Patchset:
PS2:
please implement this as a new adapter. The name "StripTrailer" indicates it is about stripping something at the end. If you want to strip something from the front, you can add a new "StripHeader" class. You can also share some code in a newly created shared baseclass from which both StripHeader and StripTrailer inherit.
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/39193?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: I1a9fff17abbbef0c5f6d45f58198debfa12e78b6
Gerrit-Change-Number: 39193
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 20 Dec 2024 17:07:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-pcap/+/39201?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: pcap-server: Introduce VTY cmd '[no] completed-path'
......................................................................
pcap-server: Introduce VTY cmd '[no] completed-path'
This VTY allows enabling feature to instruct osmo-pcap-server to move
the closed files (due to ration) into a separate directory.
This is useful for users who want to monitor and act on closed pcap
files to eg. generate statistics, etc.
Important: completed-path must be in the same filesystem mountpoint as
base-path, since osmo-pcap-server is actually not copying the files,
but atomically renaming the paths through rename() syscall.
Related: SYS#7248
Change-Id: I5166d1c5d9eb45358c87c2e1c5fbf7969d1d5294
---
M doc/manuals/chapters/server.adoc
M include/osmo-pcap/osmo_pcap_server.h
M src/osmo_server_network.c
M src/osmo_server_vty.c
4 files changed, 141 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/01/39201/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/39201?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: I5166d1c5d9eb45358c87c2e1c5fbf7969d1d5294
Gerrit-Change-Number: 39201
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcap/+/39200?usp=email )
Change subject: pcap-server: Resolve real path of pcap file before opening
......................................................................
pcap-server: Resolve real path of pcap file before opening
This means we always end up with a canonicalized absolute path.
While at it, also valdiate that we can indeed resolve the path (eg. it
exists and is reachable with current process permissions) during
startup.
It is preferrable to resolve it everytime a file is opened, this allows
the user to eg. change the base-path to a different symlink it they wish
to change the base-path for new pcaps without restarting osmo-pcap.
Change-Id: I8d161010dc8b480dd4cf90e19ca28a77914a50ad
---
M include/osmo-pcap/osmo_pcap_server.h
M src/osmo_server_network.c
M src/osmo_server_vty.c
3 files changed, 19 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/00/39200/1
diff --git a/include/osmo-pcap/osmo_pcap_server.h b/include/osmo-pcap/osmo_pcap_server.h
index 0a43a69..50bb121 100644
--- a/include/osmo-pcap/osmo_pcap_server.h
+++ b/include/osmo-pcap/osmo_pcap_server.h
@@ -87,6 +87,7 @@
/* Remote connection */
struct osmo_wqueue rem_wq;
int local_fd;
+ /* canonicalized absolute pathname of pcap file we write to */
char *curr_filename;
/* pcap stuff */
diff --git a/src/osmo_server_network.c b/src/osmo_server_network.c
index 0b0073f..8747091 100644
--- a/src/osmo_server_network.c
+++ b/src/osmo_server_network.c
@@ -166,6 +166,7 @@
time_t now = time(NULL);
struct tm tm;
int rc;
+ char *real_base_path;
osmo_pcap_server_close_trace(conn);
@@ -178,11 +179,17 @@
}
localtime_r(&now, &tm);
+ real_base_path = realpath(conn->server->base_path, NULL);
+ if (!real_base_path) {
+ LOGP(DSERVER, LOGL_ERROR, "Failed to resolve real path '%s': %s\n",
+ conn->server->base_path, strerror(errno));
+ return;
+ }
conn->curr_filename = talloc_asprintf(conn, "%s/trace-%s-%d%.2d%.2d_%.2d%.2d%.2d.pcap",
- conn->server->base_path, conn->name,
- tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
- tm.tm_hour, tm.tm_min, tm.tm_sec);
-
+ real_base_path, conn->name,
+ tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
+ tm.tm_hour, tm.tm_min, tm.tm_sec);
+ free(real_base_path);
if (!conn->curr_filename) {
LOGP(DSERVER, LOGL_ERROR, "Failed to assemble filename for %s.\n", conn->name);
return;
diff --git a/src/osmo_server_vty.c b/src/osmo_server_vty.c
index c3014c9..ee3f995 100644
--- a/src/osmo_server_vty.c
+++ b/src/osmo_server_vty.c
@@ -148,6 +148,13 @@
"base-path PATH",
"Base path for log files\n" "Path\n")
{
+ /* Validate we can resolve path: */
+ char *tmp = realpath(argv[0], NULL);
+ if (!tmp) {
+ vty_out(vty, "%% Failed to resolve path '%s': %s%s", argv[0], strerror(errno), VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+ free(tmp);
osmo_talloc_replace_string(pcap_server, &pcap_server->base_path, argv[0]);
return CMD_SUCCESS;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/39200?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: I8d161010dc8b480dd4cf90e19ca28a77914a50ad
Gerrit-Change-Number: 39200
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>