laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/36314?usp=email )
Change subject: introduce osmo_stream_cli_get_iofd() API
......................................................................
introduce osmo_stream_cli_get_iofd() API
Using this, a user can obtain the osmo_io_fd, for example in order to
perform configuration like osmo_iofd_set_alloc_info() or
osmo_iofd_set_txqueue_max_length().
Change-Id: Ie19c8294ddb12dfe5e0fd44e047c47e6f9cbd384
---
M include/osmocom/netif/stream.h
M src/stream_cli.c
M src/stream_srv.c
3 files changed, 38 insertions(+), 0 deletions(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h
index 1d97530..61bc1ad 100644
--- a/include/osmocom/netif/stream.h
+++ b/include/osmocom/netif/stream.h
@@ -109,6 +109,7 @@
const char *osmo_stream_srv_get_sockname(const struct osmo_stream_srv *conn);
struct osmo_fd *osmo_stream_srv_get_ofd(struct osmo_stream_srv *srv);
int osmo_stream_srv_get_fd(const struct osmo_stream_srv *srv);
+struct osmo_io_fd *osmo_stream_srv_get_iofd(const struct osmo_stream_srv *srv);
void osmo_stream_srv_destroy(struct osmo_stream_srv *conn);
void osmo_stream_srv_set_flush_and_destroy(struct osmo_stream_srv *conn);
@@ -177,6 +178,7 @@
char *osmo_stream_cli_get_sockname(const struct osmo_stream_cli *cli);
struct osmo_fd *osmo_stream_cli_get_ofd(struct osmo_stream_cli *cli);
int osmo_stream_cli_get_fd(const struct osmo_stream_cli *cli);
+struct osmo_io_fd *osmo_stream_cli_get_iofd(const struct osmo_stream_cli *cli);
void osmo_stream_cli_set_connect_cb(struct osmo_stream_cli *cli, int (*connect_cb)(struct osmo_stream_cli *cli));
void osmo_stream_cli_set_disconnect_cb(struct osmo_stream_cli *cli, int (*disconnect_cb)(struct osmo_stream_cli *cli));
void osmo_stream_cli_set_read_cb(struct osmo_stream_cli *cli, int (*read_cb)(struct osmo_stream_cli *cli));
diff --git a/src/stream_cli.c b/src/stream_cli.c
index ca60e25..fa43a22 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -222,6 +222,18 @@
return -EINVAL;
}
+/*! Retrieve osmo_io descriptor of the stream client socket.
+ * This function must not be called on a stream client in legacy osmo_fd mode!
+ * The iofd is only valid once/after osmo_stream_cli_open() has successfully returned.
+ * \param[in] cli Stream Client of which we want to obtain the file descriptor
+ * \returns osmo_io_fd of stream client, or NULL if stream not yet opened. */
+struct osmo_io_fd *
+osmo_stream_cli_get_iofd(const struct osmo_stream_cli *cli)
+{
+ OSMO_ASSERT(cli->mode == OSMO_STREAM_MODE_OSMO_IO);
+ return cli->iofd;
+}
+
static void osmo_stream_cli_read(struct osmo_stream_cli *cli)
{
LOGSCLI(cli, LOGL_DEBUG, "message received\n");
diff --git a/src/stream_srv.c b/src/stream_srv.c
index 3220b9e..a02c1c2 100644
--- a/src/stream_srv.c
+++ b/src/stream_srv.c
@@ -1037,6 +1037,17 @@
return -EINVAL;
}
+/*! Retrieve osmo_io descriptor of the stream server socket.
+ * This function must not be called on a stream server in legacy osmo_fd mode!
+ * \param[in] srv Stream Server of which we want to obtain the osmo_io descriptor
+ * \returns osmo_io_fd of stream server. */
+struct osmo_io_fd *
+osmo_stream_srv_get_iofd(const struct osmo_stream_srv *srv)
+{
+ OSMO_ASSERT(srv->mode == OSMO_STREAM_MODE_OSMO_IO);
+ return srv->iofd;
+}
+
/*! Retrieve the master (Link) from a Stream Server.
* \param[in] conn Stream Server of which we want to know the Link
* \returns Link through which the given Stream Server is established */
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/36314?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ie19c8294ddb12dfe5e0fd44e047c47e6f9cbd384
Gerrit-Change-Number: 36314
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/36323?usp=email )
Change subject: common: Add RTP related rate counters
......................................................................
Patch Set 1:
(3 comments)
File src/common/bts.c:
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-15184):
https://gerrit.osmocom.org/c/osmo-bts/+/36323/comment/b0858e4e_d83f68e2
PS1, Line 111: [BTS_CTR_RTP_RX_DROP_LOOPBACK] ={"rtp:rx:drop:loopback", "Total number of received RTP packets dropped during loopback"},
spaces required around that '=' (ctx:WxV)
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-15184):
https://gerrit.osmocom.org/c/osmo-bts/+/36323/comment/4680428b_0d443bb0
PS1, Line 112: [BTS_CTR_RTP_RX_DROP_OVERFLOW] ={"rtp:rx:drop:overflow", "Total number of received RTP packets dropped during DL queue overflow"},
spaces required around that '=' (ctx:WxV)
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-15184):
https://gerrit.osmocom.org/c/osmo-bts/+/36323/comment/ddc79c66_e83dec45
PS1, Line 113: [BTS_CTR_RTP_RX_DROP_V110_DEC] ={"rtp:rx:drop:v110_dec", "Total number of received RTP packets dropped during V.110 decode"},
spaces required around that '=' (ctx:WxV)
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/36323?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ide674bde10b0e4b501d6a48947b983090342dfec
Gerrit-Change-Number: 36323
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Sun, 17 Mar 2024 08:44:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: laforge, osmith, pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/mncc-python/+/36320?usp=email )
Change subject: update to MNCC V8 support
......................................................................
Patch Set 3: Code-Review-1
(1 comment)
File mncc.h:
https://gerrit.osmocom.org/c/mncc-python/+/36320/comment/87d5fadc_67f9ef69
PS3, Line 320: struct osmo_gcr_parsed gcr;
This does not match the current state of osmo-msc.git (HEAD @ b03001199a99a67f72846b6eba169eb4064a932c):
```
170 unsigned char lchan_type;
171 unsigned char lchan_mode;
172
173 /* Global Call Reference (encoded as per 3GPP TS 29.205) */
174 uint8_t gcr[16];
175
176 /* A buffer to contain SDP ('\0' terminated) */
177 char sdp[1024];
```
AFAIR, it was Keith's early attempt to implement passing GCR using an unpacked struct, but then we changed the MNCC protocol to carry a buffer encoded as per 3GPP TS 29.205.
--
To view, visit https://gerrit.osmocom.org/c/mncc-python/+/36320?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: mncc-python
Gerrit-Branch: master
Gerrit-Change-Id: Ia27956e42c6c2f494d59b89f42345462c86b10d2
Gerrit-Change-Number: 36320
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Sun, 17 Mar 2024 08:24:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: laforge, osmith, pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/mncc-python/+/36318?usp=email )
Change subject: Initial port from python2 to python3
......................................................................
Patch Set 3: Code-Review-1
(2 comments)
File mncc_test.py:
https://gerrit.osmocom.org/c/mncc-python/+/36318/comment/10277a07_86000a05
PS3, Line 72: return
This is wrong, you need four more spaces. Otherwise the code below in unreachable.
File rtpsource/Makefile:
https://gerrit.osmocom.org/c/mncc-python/+/36318/comment/205ea397_4b12ed73
PS3, Line 2: lasan
this looks unrelated to the py3 migration?
--
To view, visit https://gerrit.osmocom.org/c/mncc-python/+/36318?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: mncc-python
Gerrit-Branch: master
Gerrit-Change-Id: Ie6ecd37353b35a6ac13c6578585c714c9ab46e06
Gerrit-Change-Number: 36318
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Sun, 17 Mar 2024 08:16:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: pespin.
Hello pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/mncc-python/+/36322?usp=email
to look at the new patch set (#2).
Change subject: Adjust mncc_sock.py to MNCC v7 introducing sockaddr_storage
......................................................................
Adjust mncc_sock.py to MNCC v7 introducing sockaddr_storage
It seems that 4 years ago in 2020 we merged Change-Id
Iab17f09380d7cd914cf85746b794c6c04ec7de43 to add MNCCv7 support, but
never actually tested mncc_sock.py ever since, as it still tries to
unconditionally access the 'ip' and 'port' members of the message,
which no longer exist due to the introduction of sockaddr_storage.
Working with sockaddr_storage is a bit nasty as it contains
double-underscores in the __ss_padding member, which means ctypes/python
will make it a private member that we cannot access. Work around this
with a small sed-script that removes the underscores from the
clang2py-generated python source code.
Change-Id: I3aa267a866ffaa54e7d71c19231adc78d3831169
---
M mncc.py
M mncc_sock.py
M regen-mncc-py.sh
3 files changed, 55 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/mncc-python refs/changes/22/36322/2
--
To view, visit https://gerrit.osmocom.org/c/mncc-python/+/36322?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: mncc-python
Gerrit-Branch: master
Gerrit-Change-Id: I3aa267a866ffaa54e7d71c19231adc78d3831169
Gerrit-Change-Number: 36322
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset