Attention is currently required from: pespin.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-netif/+/38894?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: stream_srv: Add osmo_stream_srv_link_set_{ip_dscp,priority}() APIs
......................................................................
stream_srv: Add osmo_stream_srv_link_set_{ip_dscp,priority}() APIs
Change-Id: Iacb6b72a05055820253eaaa04850637dd2fc20e9
---
M TODO-RELEASE
M include/osmocom/netif/stream.h
M src/stream_srv.c
3 files changed, 50 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/94/38894/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/38894?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Iacb6b72a05055820253eaaa04850637dd2fc20e9
Gerrit-Change-Number: 38894
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/38894?usp=email )
Change subject: stream_cli: Add osmo_stream_srv_link_set_{ip_dscp,priority}() APIs
......................................................................
stream_cli: Add osmo_stream_srv_link_set_{ip_dscp,priority}() APIs
Change-Id: Iacb6b72a05055820253eaaa04850637dd2fc20e9
---
M TODO-RELEASE
M include/osmocom/netif/stream.h
M src/stream_srv.c
3 files changed, 48 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/94/38894/1
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 15f995e..4f59788 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,4 +7,4 @@
# If any interfaces have been added since the last public release: c:r:a + 1.
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
-libosmo-netif add API osmo_stream_cli_set_{ip_dscp,priority}()
+libosmo-netif add API osmo_stream_cli_set_{ip_dscp,priority}(), osmo_stream_srv_link_set_{ip_dscp,priority}()
diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h
index 96d8bbf..6edf915 100644
--- a/include/osmocom/netif/stream.h
+++ b/include/osmocom/netif/stream.h
@@ -70,6 +70,8 @@
void osmo_stream_srv_link_set_name(struct osmo_stream_srv_link *link, const char *name);
const char *osmo_stream_srv_link_get_name(const struct osmo_stream_srv_link *link);
void osmo_stream_srv_link_set_nodelay(struct osmo_stream_srv_link *link, bool nodelay);
+int osmo_stream_srv_link_set_priority(struct osmo_stream_srv_link *link, int sk_prio);
+int osmo_stream_srv_link_set_ip_dscp(struct osmo_stream_srv_link *link, uint8_t ip_dscp);
void osmo_stream_srv_link_set_addr(struct osmo_stream_srv_link *link, const char *addr);
int osmo_stream_srv_link_set_addrs(struct osmo_stream_srv_link *link, const char **addr, size_t addrcnt);
void osmo_stream_srv_link_set_port(struct osmo_stream_srv_link *link, uint16_t port);
diff --git a/src/stream_srv.c b/src/stream_srv.c
index a600ad9..ced0e05 100644
--- a/src/stream_srv.c
+++ b/src/stream_srv.c
@@ -148,6 +148,24 @@
goto error_close_socket;
}
+ if (link->ip_dscp > 0) {
+ ret = osmo_sock_set_dscp(sock_fd, link->ip_dscp);
+ if (ret < 0) {
+ LOGSLNK(link, LOGL_ERROR, "set_ip_dscp(%u): failed setsockopt err=%d\n",
+ link->ip_dscp, errno);
+ goto error_close_socket;
+ }
+ }
+
+ if (link->sk_prio > 0) {
+ ret = osmo_sock_set_priority(sock_fd, link->sk_prio);
+ if (ret < 0) {
+ LOGSLNK(link, LOGL_ERROR, "set_priority(%u): failed setsockopt err=%d\n",
+ link->sk_prio, errno);
+ goto error_close_socket;
+ }
+ }
+
if (!link->accept_cb) {
ret = -ENOTSUP;
goto error_close_socket;
@@ -224,6 +242,33 @@
link->flags &= ~OSMO_STREAM_SRV_F_NODELAY;
}
+/*! Set the priority value of the stream socket.
+ * Setting this will automatically set the socket priority
+ * option on any socket established via this server link, before
+ * calling the accept_cb().
+ * \param[in] link server link whose sockets are to be configured
+ * \param[in] sk_prio priority value. Values outside 0..6 require CAP_NET_ADMIN.
+ * \return negative on error, 0 on success
+ */
+int osmo_stream_srv_link_set_priority(struct osmo_stream_srv_link *link, int sk_prio)
+{
+ link->sk_prio = sk_prio;
+ return 0;
+}
+
+/*! Set the DSCP (differentiated services code point) of the stream socket.
+ * Setting this will automatically set the IP DSCP option on any socket on any
+ * socket established via this server link, before calling the accept_cb().
+ * \param[in] link server link whose sockets are to be configured
+ * \param[in] ip_dscp DSCP value. Value range 0..63.
+ * \return negative on error, 0 on success
+ */
+int osmo_stream_srv_link_set_ip_dscp(struct osmo_stream_srv_link *link, uint8_t ip_dscp)
+{
+ link->ip_dscp = ip_dscp;
+ return 0;
+}
+
/*! Set the local address to which we bind.
* Any changes to this setting will only become active upon next (re)connect.
* \param[in] link Stream Server Link to modify
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/38894?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Iacb6b72a05055820253eaaa04850637dd2fc20e9
Gerrit-Change-Number: 38894
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/38893?usp=email )
Change subject: stream_cli: Announce failed connect() if reconnect is disabled
......................................................................
stream_cli: Announce failed connect() if reconnect is disabled
One of the use cases of disabling reconnect in osmo_stream_cli is
because the user of the stream wants to control the reconnect based on
upper layer contexts. In this case, though, if there's a failure during
connect() time, the user won't get any notification and hence stay
disconnected forever. Instead, inform the user through the
disconnect_cb().
Change-Id: I69a5f7c3c7cea97d31e2fa03e8c32ce806285eb6
---
M src/stream_cli.c
1 file changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/93/38893/1
diff --git a/src/stream_cli.c b/src/stream_cli.c
index 25dda4f..807f062 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -207,7 +207,10 @@
cli->state = STREAM_CLI_STATE_CLOSED;
- if (old_state == STREAM_CLI_STATE_CONNECTED) {
+ /* If conn was established, notify the disconnection to the user:
+ * Also, if reconnect is disabled by user, notify the user that connect() failed: */
+ if (old_state == STREAM_CLI_STATE_CONNECTED ||
+ (old_state == STREAM_CLI_STATE_CONNECTING && cli->reconnect_timeout < 0)) {
LOGSCLI(cli, LOGL_DEBUG, "connection closed\n");
if (cli->disconnect_cb)
cli->disconnect_cb(cli);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/38893?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I69a5f7c3c7cea97d31e2fa03e8c32ce806285eb6
Gerrit-Change-Number: 38893
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: osmith.
pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-remsim/+/38889?usp=email )
Change subject: contrib/jenkins: libosmo-abis after libosmo-netif
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/38889?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: I72837fbde099f410eff69362155cb62e8a83c2c6
Gerrit-Change-Number: 38889
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 22 Nov 2024 13:02:54 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes