Attention is currently required from: pespin.
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bts/+/29285
to look at the new patch set (#4).
Change subject: Introduce Osmux support
......................................................................
Introduce Osmux support
Related: SYS#5987
Requires: libosmo-netif.git Change-Id I632654221826340423e1e97b0f8ed9a2baf6c6c3
Change-Id: Ib80be434c06d07b3611bd18ae25dff8b14a7aad9
---
M TODO-RELEASE
M configure.ac
A doc/manuals/chapters/osmux_bts.adoc
M doc/manuals/osmobts-usermanual.adoc
M include/osmo-bts/Makefile.am
M include/osmo-bts/bts.h
M include/osmo-bts/l1sap.h
M include/osmo-bts/lchan.h
M include/osmo-bts/logging.h
A include/osmo-bts/osmux.h
M include/osmo-bts/vty.h
M src/common/Makefile.am
M src/common/bts.c
M src/common/l1sap.c
M src/common/lchan.c
M src/common/logging.c
M src/common/main.c
A src/common/osmux.c
M src/common/rsl.c
M src/common/vty.c
20 files changed, 881 insertions(+), 46 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/85/29285/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/29285
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ib80be434c06d07b3611bd18ae25dff8b14a7aad9
Gerrit-Change-Number: 29285
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29260 )
Change subject: osmux: Allow the user to alloc msgbs used to provide generated RTP packets
......................................................................
osmux: Allow the user to alloc msgbs used to provide generated RTP packets
This is useful for users of the API which need to keep forwarding the
msgb to lower layers which may need prepending a new header to the msgb,
like osmo-bts with l1sap.
Related: SYS#5987
Change-Id: I632654221826340423e1e97b0f8ed9a2baf6c6c3
---
M include/osmocom/netif/osmux.h
M src/osmux.c
2 files changed, 27 insertions(+), 4 deletions(-)
Approvals:
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/include/osmocom/netif/osmux.h b/include/osmocom/netif/osmux.h
index 8742797..c663c1b 100644
--- a/include/osmocom/netif/osmux.h
+++ b/include/osmocom/netif/osmux.h
@@ -75,6 +75,8 @@
#define OSMUX_MAX_CONCURRENT_CALLS 8
+typedef struct msgb *(*rtp_msgb_alloc_cb_t)(void *rtp_msgb_alloc_priv_data,
+ unsigned int msg_len);
/* one per OSmux circuit_id, ie. one per RTP flow. */
struct osmux_out_handle {
uint16_t rtp_seq;
@@ -86,6 +88,8 @@
struct llist_head list;
void (*tx_cb)(struct msgb *msg, void *data); /* Used defined rtp tx callback */
void *data; /* User defined opaque data structure */
+ rtp_msgb_alloc_cb_t rtp_msgb_alloc_cb; /* User defined msgb alloc function for generated RTP pkts */
+ void *rtp_msgb_alloc_cb_data; /* Opaque data pointer set by user and passed in rtp_msgb_alloc_cb() */
};
static inline uint8_t *osmux_get_payload(struct osmux_hdr *osmuxh)
@@ -113,6 +117,7 @@
void osmux_xfrm_output_set_rtp_ssrc(struct osmux_out_handle *h, uint32_t rtp_ssrc);
void osmux_xfrm_output_set_rtp_pl_type(struct osmux_out_handle *h, uint32_t rtp_payload_type);
void osmux_xfrm_output_set_tx_cb(struct osmux_out_handle *h, void (*tx_cb)(struct msgb *msg, void *data), void *data);
+void osmux_xfrm_output_set_rtp_msgb_alloc_cb(struct osmux_out_handle *h, rtp_msgb_alloc_cb_t cb, void *cb_data);
int osmux_xfrm_output_sched(struct osmux_out_handle *h, struct osmux_hdr *osmuxh);
void osmux_xfrm_output_flush(struct osmux_out_handle *h);
struct osmux_hdr *osmux_xfrm_output_pull(struct msgb *msg);
diff --git a/src/osmux.c b/src/osmux.c
index 63342fa..71afe5c 100644
--- a/src/osmux.c
+++ b/src/osmux.c
@@ -127,11 +127,15 @@
struct rtp_hdr *rtph;
struct amr_hdr *amrh;
struct timespec delta = { .tv_sec = 0, .tv_nsec = DELTA_RTP_MSG*1000 };
+ unsigned int msg_len = sizeof(struct rtp_hdr) +
+ sizeof(struct amr_hdr) +
+ payload_len;
- out_msg = msgb_alloc(sizeof(struct rtp_hdr) +
- sizeof(struct amr_hdr) +
- osmo_amr_bytes(osmuxh->amr_ft),
- "OSMUX test");
+ if (h->rtp_msgb_alloc_cb) {
+ out_msg = h->rtp_msgb_alloc_cb(h->rtp_msgb_alloc_cb_data, msg_len);
+ } else {
+ out_msg = msgb_alloc(msg_len, "osmux-rtp");
+ }
if (out_msg == NULL)
return NULL;
@@ -932,6 +936,20 @@
h->data = data;
}
+/*! \brief Set callback to call when an RTP packet to be generated is to be allocated
+ * \param[in] h the osmux out handle handling a specific CID
+ * \param[in] cb User defined msgb alloc function for generated RTP pkts
+ * \param[in] cb_data Opaque data pointer set by user and passed in \ref cb
+ * \return msgb structure to be used to fill in generated RTP pkt content
+ */
+void osmux_xfrm_output_set_rtp_msgb_alloc_cb(struct osmux_out_handle *h,
+ rtp_msgb_alloc_cb_t cb,
+ void *cb_data)
+{
+ h->rtp_msgb_alloc_cb = cb;
+ h->rtp_msgb_alloc_cb_data = cb_data;
+}
+
/*! \brief Set SSRC of generated RTP packets from Osmux frames
* \param[in] h the osmux out handle handling a specific CID
* \param[in] rtp_ssrc the RTP SSRC to set
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29260
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I632654221826340423e1e97b0f8ed9a2baf6c6c3
Gerrit-Change-Number: 29260
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: fixeria.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29260 )
Change subject: osmux: Allow the user to alloc msgbs used to provide generated RTP packets
......................................................................
Patch Set 4: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29260
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I632654221826340423e1e97b0f8ed9a2baf6c6c3
Gerrit-Change-Number: 29260
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 12 Sep 2022 10:09:58 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment