laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/27018 )
Change subject: make rate_counters work
......................................................................
make rate_counters work
if we don't call rate_ctr_init(), the rate counter internal timer will
not tick,a nd we will never get the per-s/per-m/per-h averages.
Change-Id: Ib5b66c72079330ac161756bcf562d27536d7ce44
---
M src/osmo-e1d.c
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/src/osmo-e1d.c b/src/osmo-e1d.c
index 3ac9642..91bf78d 100644
--- a/src/osmo-e1d.c
+++ b/src/osmo-e1d.c
@@ -175,6 +175,7 @@
vty_init(&vty_info);
logging_vty_add_cmds();
e1d_vty_init(e1d);
+ rate_ctr_init(e1d);
handle_options(argc, argv);
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/27018
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: Ib5b66c72079330ac161756bcf562d27536d7ce44
Gerrit-Change-Number: 27018
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/27019 )
Change subject: update copyright statement
......................................................................
update copyright statement
Change-Id: I1b4817207369e572a2b070443475289cc527c317
---
M src/osmo-e1d.c
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/src/osmo-e1d.c b/src/osmo-e1d.c
index 91bf78d..f86a92a 100644
--- a/src/osmo-e1d.c
+++ b/src/osmo-e1d.c
@@ -1,7 +1,8 @@
/*
* osmo-e1d.c
*
- * (C) 2019 by Sylvain Munaut <tnt(a)246tNt.com>
+ * (C) 2019-2022 by Sylvain Munaut <tnt(a)246tNt.com>
+ * (C) 2019-2022 by Harald Welte <laforge(a)osmocom.org>
*
* All Rights Reserved
*
@@ -83,7 +84,7 @@
.name = "osmo-e1d",
.version = PACKAGE_VERSION,
.copyright =
- "(C) 2019 by Sylvain Munaut <tnt(a)246tNt.com>\r\n",
+ "(C) 2019-2022 by Sylvain Munaut, Harald Welte and contributors\r\n",
"License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>\r\n"
"This is free software: you are free to change and redistribute it.\r\n"
"There is NO WARRANTY, to the extent permitted by law.\r\n",
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/27019
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I1b4817207369e572a2b070443475289cc527c317
Gerrit-Change-Number: 27019
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/27024 )
Change subject: log: socket.c: rather use the osmo_sockaddr_str _FMT
......................................................................
log: socket.c: rather use the osmo_sockaddr_str _FMT
The OSMO_SOCKADDR_STR_FMT() and _ARGS() macros properly place square
braces around IPv6 addresses, so that the port nr is clearly
distinguishable.
before: 1:2::3:4:5
after: [1:2::3:4]:5
When using a struct reference, the macro resolves to '(&sastr) ? .. : ..',
which the compiler complains about as "condition is always true". Shim
around that error with a pointer variable.
I considered using osmo_sockaddr_to_str_c() instead, but here in
socket.c we cannot assume that osmo_select_main_ctx() is being used and
hence can't just use OTC_SELECT for log string composition. The
struct osmo_sockaddr_str is a string representation in a local variable,
and hence doesn't need talloc for log strings.
I considered adding log_check_level() around the log string conversion,
but since all of these instances are on LOGL_ERROR, I didn't bother.
Related: SYS#5599
Change-Id: Idbe7582b2b7f14540919e911dad08af6d491f68f
---
M src/socket.c
1 file changed, 12 insertions(+), 13 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/24/27024/1
diff --git a/src/socket.c b/src/socket.c
index 0ffa11d..882ff02 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -484,8 +484,8 @@
}
#define _SOCKADDR_TO_STR(dest, sockaddr) do { \
- if (osmo_sockaddr_str_from_sockaddr(&dest, &sockaddr->u.sas)) \
- osmo_strlcpy(dest.ip, "Invalid IP", 11); \
+ if (osmo_sockaddr_str_from_sockaddr(dest, &sockaddr->u.sas)) \
+ osmo_strlcpy(dest->ip, "Invalid IP", 11); \
} while (0)
/*! Initialize a socket (including bind and/or connect)
@@ -520,7 +520,8 @@
unsigned int flags)
{
int sfd = -1, rc, on = 1;
- struct osmo_sockaddr_str sastr = {};
+ struct osmo_sockaddr_str _sastr = {};
+ struct osmo_sockaddr_str *sastr = &_sastr;
if ((flags & (OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT)) == 0) {
LOGP(DLGLOBAL, LOGL_ERROR, "invalid: you have to specify either "
@@ -551,8 +552,8 @@
sfd = socket_helper_osa(local, type, proto, flags);
if (sfd < 0) {
_SOCKADDR_TO_STR(sastr, local);
- LOGP(DLGLOBAL, LOGL_ERROR, "no suitable local addr found for: %s:%u\n",
- sastr.ip, sastr.port);
+ LOGP(DLGLOBAL, LOGL_ERROR, "no suitable local addr found for: " OSMO_SOCKADDR_STR_FMT "\n",
+ OSMO_SOCKADDR_STR_FMT_ARGS(sastr));
return -ENODEV;
}
@@ -562,10 +563,8 @@
if (rc < 0) {
_SOCKADDR_TO_STR(sastr, local);
LOGP(DLGLOBAL, LOGL_ERROR,
- "cannot setsockopt socket:"
- " %s:%u: %s\n",
- sastr.ip, sastr.port,
- strerror(errno));
+ "cannot setsockopt socket: " OSMO_SOCKADDR_STR_FMT ": %s\n",
+ OSMO_SOCKADDR_STR_FMT_ARGS(sastr), strerror(errno));
close(sfd);
return rc;
}
@@ -573,8 +572,8 @@
if (bind(sfd, &local->u.sa, sizeof(struct osmo_sockaddr)) == -1) {
_SOCKADDR_TO_STR(sastr, local);
- LOGP(DLGLOBAL, LOGL_ERROR, "unable to bind socket: %s:%u: %s\n",
- sastr.ip, sastr.port, strerror(errno));
+ LOGP(DLGLOBAL, LOGL_ERROR, "unable to bind socket: " OSMO_SOCKADDR_STR_FMT ": %s\n",
+ OSMO_SOCKADDR_STR_FMT_ARGS(sastr), strerror(errno));
close(sfd);
return -1;
}
@@ -596,8 +595,8 @@
rc = connect(sfd, &remote->u.sa, sizeof(struct osmo_sockaddr));
if (rc != 0 && errno != EINPROGRESS) {
_SOCKADDR_TO_STR(sastr, remote);
- LOGP(DLGLOBAL, LOGL_ERROR, "unable to connect socket: %s:%u: %s\n",
- sastr.ip, sastr.port, strerror(errno));
+ LOGP(DLGLOBAL, LOGL_ERROR, "unable to connect socket: " OSMO_SOCKADDR_STR_FMT ": %s\n",
+ OSMO_SOCKADDR_STR_FMT_ARGS(sastr), strerror(errno));
close(sfd);
return rc;
}
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/27024
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Idbe7582b2b7f14540919e911dad08af6d491f68f
Gerrit-Change-Number: 27024
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/27025 )
Change subject: add osmo_quote_str_buf3, osmo_escape_str_buf3
......................................................................
add osmo_quote_str_buf3, osmo_escape_str_buf3
There already are osmo_quote_str_buf() and osmo_quote_str_buf2(), same
for _escape_, but none of them return the snprintf() like string length.
A private function does, publish this in the API.
The returned chars_needed is required to accurately allocate sufficient
size in string functions that call osmo_quote_str/osmo_escape_str. I am
adding such in osmo-upf.git.
Related: SYS#5599
Change-Id: I05d75a40599e3133da099a11e8babaaad0e9493a
---
M include/osmocom/core/utils.h
M src/utils.c
2 files changed, 29 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/25/27025/1
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index 327aa3d..eda0e39 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -157,10 +157,12 @@
char *osmo_quote_cstr_c(void *ctx, const char *str, int in_len);
const char *osmo_escape_str(const char *str, int len);
+int osmo_escape_str_buf3(char *buf, size_t bufsize, const char *str, int in_len);
char *osmo_escape_str_buf2(char *buf, size_t bufsize, const char *str, int in_len);
const char *osmo_escape_str_buf(const char *str, int in_len, char *buf, size_t bufsize);
char *osmo_escape_str_c(const void *ctx, const char *str, int in_len);
const char *osmo_quote_str(const char *str, int in_len);
+int osmo_quote_str_buf3(char *buf, size_t bufsize, const char *str, int in_len);
char *osmo_quote_str_buf2(char *buf, size_t bufsize, const char *str, int in_len);
const char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t bufsize);
char *osmo_quote_str_c(const void *ctx, const char *str, int in_len);
diff --git a/src/utils.c b/src/utils.c
index 357ed53..2012b74 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -754,7 +754,7 @@
* the non-legacy format also escapes those as "\xNN" sequences.
* \return Number of characters that would be written if bufsize were large enough excluding '\0' (like snprintf()).
*/
-static size_t _osmo_escape_str_buf(char *buf, size_t bufsize, const char *str, int in_len, bool legacy_format)
+static int _osmo_escape_str_buf(char *buf, size_t bufsize, const char *str, int in_len, bool legacy_format)
{
struct osmo_strbuf sb = { .buf = buf, .len = bufsize };
int in_pos = 0;
@@ -826,6 +826,18 @@
* \param[in] bufsize sizeof(buf).
* \param[in] str A string that may contain any characters.
* \param[in] in_len Pass -1 to print until nul char, or >= 0 to force a length (also past nul chars).
+ * \return Number of characters that would be written if bufsize were large enough excluding '\0' (like snprintf()).
+ */
+int osmo_escape_str_buf3(char *buf, size_t bufsize, const char *str, int in_len)
+{
+ return _osmo_escape_str_buf(buf, bufsize, str, in_len, false);
+}
+
+/*! Return the string with all non-printable characters escaped.
+ * \param[out] buf string buffer to write escaped characters to.
+ * \param[in] bufsize sizeof(buf).
+ * \param[in] str A string that may contain any characters.
+ * \param[in] in_len Pass -1 to print until nul char, or >= 0 to force a length (also past nul chars).
* \return The output buffer (buf).
*/
char *osmo_escape_str_buf2(char *buf, size_t bufsize, const char *str, int in_len)
@@ -883,6 +895,20 @@
return sb.chars_needed;
}
+/*! Like osmo_escape_str_buf3(), but returns double-quotes around a string, or "NULL" for a NULL string.
+ * This allows passing any char* value and get its C representation as string.
+ * The function signature is suitable for OSMO_STRBUF_APPEND_NOLEN().
+ * \param[out] buf string buffer to write escaped characters to.
+ * \param[in] bufsize sizeof(buf).
+ * \param[in] str A string that may contain any characters.
+ * \param[in] in_len Pass -1 to print until nul char, or >= 0 to force a length.
+ * \return Number of characters that would be written if bufsize were large enough excluding '\0' (like snprintf()).
+ */
+int osmo_quote_str_buf3(char *buf, size_t bufsize, const char *str, int in_len)
+{
+ return _osmo_quote_str_buf(buf, bufsize, str, in_len, false);
+}
+
/*! Like osmo_escape_str_buf2(), but returns double-quotes around a string, or "NULL" for a NULL string.
* This allows passing any char* value and get its C representation as string.
* The function signature is suitable for OSMO_STRBUF_APPEND_NOLEN().
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/27025
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I05d75a40599e3133da099a11e8babaaad0e9493a
Gerrit-Change-Number: 27025
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: tnt.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/27016 )
Change subject: Allow configuration of interfaces/lines via VTY
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS2:
> It fails to re-read the config files it write. […]
thanks, nice catch. the uppercase/lowercase issue is now fixed.
watchdog: yes, has a separate issue, will be adressed.
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/27016
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I89b57b688b68901f87d9683ab9294772ee747d77
Gerrit-Change-Number: 27016
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: tnt <tnt(a)246tNt.com>
Gerrit-Attention: tnt <tnt(a)246tNt.com>
Gerrit-Comment-Date: Mon, 31 Jan 2022 14:49:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: tnt <tnt(a)246tNt.com>
Gerrit-MessageType: comment
Attention is currently required from: laforge.
Hello Jenkins Builder, tnt,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-e1d/+/27016
to look at the new patch set (#3).
Change subject: Allow configuration of interfaces/lines via VTY
......................................................................
Allow configuration of interfaces/lines via VTY
So far, osmo-e1d automatically opened all compatible icE1usb devices
and all E1 lines on those interfaces. Let's allow for 'interface' and
'line' configuration in the VTY. USB devices can be identified by
their serial number string.
If a given device (== E1 interface) has a VTY configuration, then only
those E1 lines with VTY configuration opened.
For each Line (icE1usb or vpair), the mode (channelized/superchannel)
can also be set via VTY.
Change-Id: I89b57b688b68901f87d9683ab9294772ee747d77
Closes: OS#5400
---
M src/e1d.h
M src/intf_line.c
M src/usb.c
M src/vty.c
4 files changed, 257 insertions(+), 14 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/16/27016/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/27016
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I89b57b688b68901f87d9683ab9294772ee747d77
Gerrit-Change-Number: 27016
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: tnt <tnt(a)246tNt.com>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: roox, roh.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/27017 )
Change subject: icE1usb: Move GPS-DO USB control to separate USB interface
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/27017
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: Icd6555a14896c38626fb147b78af44ff719f2254
Gerrit-Change-Number: 27017
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: roh <jsteiger(a)sysmocom.de>
Gerrit-Reviewer: roox <mardnh(a)gmx.de>
Gerrit-Reviewer: tnt <tnt(a)246tNt.com>
Gerrit-Attention: roox <mardnh(a)gmx.de>
Gerrit-Attention: roh <jsteiger(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 31 Jan 2022 14:25:49 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment