gerrit-log
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
January 2025
- 1 participants
- 1491 discussions
[XS] Change in libosmo-netif[master]: include/osmocom/netif/Makefile.am cosmetic: make it easier to extend
by fixeria 10 Jan '25
by fixeria 10 Jan '25
10 Jan '25
Attention is currently required from: falconia.
fixeria has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmo-netif/+/39278?usp=email )
Change subject: include/osmocom/netif/Makefile.am cosmetic: make it easier to extend
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/39278?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I05ecbdb44286b842e158278fb07479846cd66806
Gerrit-Change-Number: 39278
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Comment-Date: Fri, 10 Jan 2025 07:29:59 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
1
0
[XS] Change in libosmo-netif[master]: include/osmocom/netif/Makefile.am cosmetic: make it easier to extend
by falconia 10 Jan '25
by falconia 10 Jan '25
10 Jan '25
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/39278?usp=email )
Change subject: include/osmocom/netif/Makefile.am cosmetic: make it easier to extend
......................................................................
include/osmocom/netif/Makefile.am cosmetic: make it easier to extend
To make it easier to add new headers to osmonetif_HEADERS list,
make two cosmetic changes to it:
* List all currently exported headers in alphabetical order;
* Use $(NULL) construct so that every header-naming line ends
with a backslash.
Change-Id: I05ecbdb44286b842e158278fb07479846cd66806
---
M include/osmocom/netif/Makefile.am
1 file changed, 4 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/78/39278/1
diff --git a/include/osmocom/netif/Makefile.am b/include/osmocom/netif/Makefile.am
index 3d8a56b..d518edb 100644
--- a/include/osmocom/netif/Makefile.am
+++ b/include/osmocom/netif/Makefile.am
@@ -4,14 +4,15 @@
osmonetif_HEADERS = amr.h \
datagram.h \
- jibuf.h \
- osmux.h \
ipa.h \
ipa_unit.h \
+ jibuf.h \
+ osmux.h \
prim.h \
rs232.h \
rtp.h \
- stream.h
+ stream.h \
+ $(NULL)
if ENABLE_LIBSCTP
osmonetif_HEADERS += sctp.h
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/39278?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: I05ecbdb44286b842e158278fb07479846cd66806
Gerrit-Change-Number: 39278
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
1
0
[XS] Change in libosmo-netif[master]: src/Makefile.am cosmetic: make it easier to extend
by falconia 10 Jan '25
by falconia 10 Jan '25
10 Jan '25
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/39279?usp=email )
Change subject: src/Makefile.am cosmetic: make it easier to extend
......................................................................
src/Makefile.am cosmetic: make it easier to extend
To make it easier to add new source files to libosmonetif_la_SOURCES
list, make two cosmetic changes to it:
* List stream.c before stream_{cli,srv}.c, matching the order
that is used in other similar instances;
* Use $(NULL) construct so that every source-naming line ends
with a backslash.
Change-Id: I98cf6d592fb66d5f22d486358ccdab06306ae3b0
---
M src/Makefile.am
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/79/39279/1
diff --git a/src/Makefile.am b/src/Makefile.am
index bd3f272..e3634be 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,9 +23,10 @@
prim.c \
rs232.c \
rtp.c \
+ stream.c \
stream_cli.c \
stream_srv.c \
- stream.c
+ $(NULL)
if ENABLE_LIBSCTP
libosmonetif_la_SOURCES += sctp.c
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/39279?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: I98cf6d592fb66d5f22d486358ccdab06306ae3b0
Gerrit-Change-Number: 39279
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
1
0
10 Jan '25
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/39280?usp=email )
Change subject: bring twjit into libosmo-netif
......................................................................
bring twjit into libosmo-netif
twjit is the jitter buffer portion of Themyscira Wireless RTP
endpoint implementation, an alternative to Belledonne libortp.
Unlike Belledonne software, ThemWi RTP library was developed
specifically for use in Osmocom-based GSM, ISDN and IP-PSTN
network elements, and is built on top of libosmocore primitives -
thus it can function more natively in Osmocom universe than ortp.
This ThemWi library was initially developed externally to Osmocom,
but is now being brought into libosmo-netif so it can be used by
native Osmocom projects, particularly OsmoBTS.
Related: OS#6474
Change-Id: Ia3be5834571ca18b68939abbcf1ce3a879156658
---
M configure.ac
M include/osmocom/netif/Makefile.am
A include/osmocom/netif/twjit.h
A include/osmocom/netif/twjit_private.h
M src/Makefile.am
A src/twjit.c
A src/twjit_in.c
A src/twjit_out.c
A src/twjit_vty.c
9 files changed, 955 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/80/39280/1
diff --git a/configure.ac b/configure.ac
index 9513270..9b52901 100644
--- a/configure.ac
+++ b/configure.ac
@@ -92,6 +92,7 @@
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.10.0)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.10.0)
PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 1.10.0)
+PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.10.0)
AC_ARG_ENABLE([libsctp], [AS_HELP_STRING([--disable-libsctp], [Do not enable socket multiaddr APIs requiring libsctp])],
[ENABLE_LIBSCTP=$enableval], [ENABLE_LIBSCTP="yes"])
diff --git a/include/osmocom/netif/Makefile.am b/include/osmocom/netif/Makefile.am
index d518edb..d06adda 100644
--- a/include/osmocom/netif/Makefile.am
+++ b/include/osmocom/netif/Makefile.am
@@ -1,5 +1,6 @@
noinst_HEADERS = \
stream_private.h \
+ twjit_private.h \
$(NULL)
osmonetif_HEADERS = amr.h \
@@ -12,6 +13,7 @@
rs232.h \
rtp.h \
stream.h \
+ twjit.h \
$(NULL)
if ENABLE_LIBSCTP
diff --git a/include/osmocom/netif/twjit.h b/include/osmocom/netif/twjit.h
new file mode 100644
index 0000000..905f113
--- /dev/null
+++ b/include/osmocom/netif/twjit.h
@@ -0,0 +1,135 @@
+/*
+ * Themyscira Wireless RTP jitter buffer implementation:
+ * public API definition for Osmocom-integrated version.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#pragma once
+
+#include <stdint.h>
+#include <stdbool.h>
+
+/*
+ * Each instance of twjit in the present version exists as struct osmo_twjit.
+ * This structure is opaque, and always constitutes a talloc context.
+ */
+struct osmo_twjit;
+
+/*
+ * twjit configuration tunings, usually set via vty. This config structure
+ * always has to be provided in order to create a twjit instance.
+ */
+struct osmo_twjit_config {
+ /* buffer depth: starting minimum and high watermark */
+ uint16_t bd_start;
+ uint16_t bd_hiwat;
+ /* interval for thinning of too-deep standing queue */
+ uint16_t thinning_int;
+ /* guard against time traveler RTP packets */
+ uint16_t max_future_sec;
+ /* min and max time delta in starting state, 0 means not set */
+ uint16_t start_min_delta;
+ uint16_t start_max_delta;
+};
+
+/*
+ * Stats collected during the lifetime of a twjit instance.
+ */
+struct osmo_twjit_stats {
+ /* normal operation */
+ uint32_t rx_packets;
+ uint32_t delivered_pkt;
+ uint32_t handovers_in;
+ uint32_t handovers_out;
+ /* undesirable, but not totally unexpected */
+ uint32_t too_old;
+ uint32_t underruns;
+ uint32_t ho_underruns;
+ uint32_t output_gaps;
+ uint32_t thinning_drops;
+ /* unusual error events */
+ uint32_t bad_packets;
+ uint32_t duplicate_ts;
+ /* independent analysis of Rx packet stream */
+ uint32_t ssrc_changes;
+ uint32_t seq_skips;
+ uint32_t seq_backwards;
+ uint32_t seq_repeats;
+ uint32_t intentional_gaps;
+ uint32_t ts_resets;
+ uint32_t jitter_max;
+};
+
+/*
+ * Info collected from the incoming RTP data stream
+ * for the purpose of generating RTCP reception report blocks.
+ * Key point: unlike the counters in struct osmo_twjit_stats,
+ * all RR info is reset to initial whenever incoming SSRC changes,
+ * as necessitated by RTCP data model being organized per SSRC.
+ */
+struct osmo_twjit_rr_info {
+ uint32_t ssrc;
+ uint32_t rx_packets;
+ uint32_t base_seq;
+ uint32_t max_seq_ext;
+ uint32_t expected_pkt;
+ uint32_t jitter_accum;
+};
+
+/* twjit module API functions */
+
+struct osmo_twjit *osmo_twjit_create(void *ctx, uint16_t clock_khz,
+ uint16_t quantum_ms,
+ const struct osmo_twjit_config *config);
+void osmo_twjit_destroy(struct osmo_twjit *twjit);
+
+void osmo_twjit_new_config(struct osmo_twjit *twjit,
+ const struct osmo_twjit_config *config);
+void osmo_twjit_reset(struct osmo_twjit *twjit);
+
+struct msgb;
+
+/* RTP input, takes ownership of msgb */
+void osmo_twjit_input(struct osmo_twjit *twjit, struct msgb *msg);
+
+/* output function, to be called by TDM/GSM/etc fixed-timing side */
+struct msgb *osmo_twjit_output(struct osmo_twjit *twjit);
+
+/* Stats and RR info structures are contained inside opaque struct osmo_twjit.
+ * We need to provide access to these stats and RR info structures to API
+ * users, but we don't want to make the whole twjit instance struct public.
+ * Also we would like to have fast external access to these stats, hence an API
+ * that copies our stats to caller-provided storage would be very inefficient.
+ * Compromise: we allow direct external access to just these selected parts
+ * of the full internal state structure by providing API functions that
+ * return pointers to these selected parts.
+ */
+const struct osmo_twjit_stats *
+osmo_twjit_get_stats(struct osmo_twjit *twjit);
+
+const struct osmo_twjit_rr_info *
+osmo_twjit_get_rr_info(struct osmo_twjit *twjit);
+
+/* When we compose outgoing RTCP packets in the upper layer of twrtp,
+ * we need to know whether or not we have received at least one valid
+ * RTP data packet so far. If we haven't received any RTP yet, then
+ * we have no Rx SSRC, all data in struct osmo_twjit_rr_info are invalid,
+ * and we cannot send RTCP reception reports.
+ */
+bool osmo_twjit_got_any_input(struct osmo_twjit *twjit);
+
+/* vty configuration functions */
+
+void osmo_twjit_init_defaults(struct osmo_twjit_config *config);
+
+void osmo_twjit_vty_init(int twjit_node);
+
+struct vty;
+
+int osmo_twjit_config_write(struct vty *vty,
+ const struct osmo_twjit_config *conf,
+ const char *name, const char *prefix);
diff --git a/include/osmocom/netif/twjit_private.h b/include/osmocom/netif/twjit_private.h
new file mode 100644
index 0000000..0312af4
--- /dev/null
+++ b/include/osmocom/netif/twjit_private.h
@@ -0,0 +1,78 @@
+/*
+ * Themyscira Wireless RTP jitter buffer implementation:
+ * internal definitions confined to twjit code inside libosmo-netif.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#pragma once
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/timer.h>
+
+#include <osmocom/netif/twjit.h>
+
+/*
+ * Each twjit instance has two sub-buffers; each subbuf is a queue of
+ * received RTP packets that have the same SSRC and whose timestamps
+ * increment in the expected cadence, with each ts delta being an
+ * integral multiple of the samples-per-quantum constant.
+ */
+struct twjit_subbuf {
+ uint32_t ssrc;
+ uint32_t head_ts;
+ struct llist_head queue;
+ uint32_t depth;
+ uint32_t delta_ms; /* used only in starting state */
+ /* thinning mechanism */
+ uint16_t drop_int_count;
+ /* running config for this subbuf */
+ struct osmo_twjit_config conf;
+};
+
+/*
+ * Each twjit instance is in one of 4 fundamental states at any moment,
+ * as enumerated here.
+ */
+enum twjit_state {
+ TWJIT_STATE_EMPTY,
+ TWJIT_STATE_HUNT,
+ TWJIT_STATE_FLOWING,
+ TWJIT_STATE_HANDOVER,
+};
+
+/* Main structure for one instance of twjit */
+struct osmo_twjit {
+ /* pointer to config structure given to osmo_twjit_create(),
+ * memory must remain valid, but content can change at any time. */
+ const struct osmo_twjit_config *ext_config;
+ /* count of RTP timestamp units per quantum */
+ uint32_t ts_quantum;
+ /* quanta per second, used to scale max_future_sec */
+ uint16_t quanta_per_sec;
+ /* scaling factors for time delta conversions */
+ uint16_t ts_units_per_ms;
+ uint32_t ts_units_per_sec;
+ uint32_t ns_to_ts_units;
+ /* operational state */
+ enum twjit_state state;
+ struct twjit_subbuf sb[2];
+ uint8_t read_sb; /* 0 or 1 */
+ uint8_t write_sb; /* ditto */
+ /* info about the most recent Rx packet */
+ uint32_t last_ts;
+ uint16_t last_seq;
+ bool got_first_packet;
+ struct timespec last_arrival;
+ uint32_t last_arrival_delta;
+ /* analytics for RTCP RR, also remembers last SSRC */
+ struct osmo_twjit_rr_info rr_info;
+ /* stats over lifetime of this instance */
+ struct osmo_twjit_stats stats;
+};
diff --git a/src/Makefile.am b/src/Makefile.am
index e3634be..171b879 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,12 +3,14 @@
LIBVERSION=13:1:2
AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)
-AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(COVERAGE_CFLAGS) $(LIBSCTP_CFLAGS)
+AM_CFLAGS= -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) \
+ $(LIBOSMOVTY_CFLAGS) $(COVERAGE_CFLAGS) $(LIBSCTP_CFLAGS)
AM_LDFLAGS = $(COVERAGE_LDFLAGS)
lib_LTLIBRARIES = libosmonetif.la
-libosmonetif_la_LIBADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBSCTP_LIBS)
+libosmonetif_la_LIBADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) \
+ $(LIBOSMOVTY_LIBS) $(LIBSCTP_LIBS)
libosmonetif_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBVERSION) -no-undefined
libosmonetif_la_SOURCES = amr.c \
@@ -26,6 +28,10 @@
stream.c \
stream_cli.c \
stream_srv.c \
+ twjit.c \
+ twjit_in.c \
+ twjit_out.c \
+ twjit_vty.c \
$(NULL)
if ENABLE_LIBSCTP
diff --git a/src/twjit.c b/src/twjit.c
new file mode 100644
index 0000000..4c77f53
--- /dev/null
+++ b/src/twjit.c
@@ -0,0 +1,171 @@
+/*
+ * Themyscira Wireless RTP jitter buffer implementation: basic functions,
+ * everything that isn't factored out into input handling, output handling
+ * or vty config modules.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/utils.h>
+
+#include <osmocom/netif/twjit.h>
+#include <osmocom/netif/twjit_private.h>
+
+void osmo_twjit_init_defaults(struct osmo_twjit_config *config)
+{
+ memset(config, 0, sizeof(struct osmo_twjit_config));
+
+ /* While the theoretical minimum starting fill level is 1, the
+ * practically useful minimum (achieving lowest latency, but not
+ * incurring underruns in normal healthy operation) is 2 for typical
+ * network configurations that combine elements with "perfect" 20 ms
+ * timing (T1/E1 interfaces, external IP-PSTN links, software
+ * transcoders timed by system clock etc) and GSM-to-IP OsmoBTS
+ * whose 20 ms timing contains the small inherent jitter of TDMA. */
+ config->bd_start = 2;
+
+ /* The high water mark setting determines when the standing queue
+ * thinning mechanism kicks in. A standing queue that is longer
+ * than the starting fill level will occur when the flow starts
+ * during a network latency spike, but then the network latency
+ * goes down. If this setting is too high, deep standing queues
+ * will persist, adding needless latency to speech or CSD.
+ * If this setting is too low, the thinning mechanism will be
+ * too invasive, needlessly and perhaps frequently deleting a quantum
+ * of speech or data from the stream and incurring a phase shift.
+ * Starting fill level plus 2 seems like a good default. */
+ config->bd_hiwat = 4;
+
+ /* When the standing queue thinning mechanism does kick in,
+ * it drops every Nth packet, where N is the thinning interval.
+ * Given that this mechanism forcibly deletes a quantum of speech
+ * or data from the stream, these induced disruptions should be
+ * spaced out, and the managing operator should also keep in mind
+ * that the incurred phase shift may be a problem for some
+ * applications, particularly CSD. Our current default is
+ * a prime number, reducing the probability that the thinning
+ * mechanism will interfere badly with intrinsic features of the
+ * stream being thinned. 17 quantum units at 20 ms per quantum
+ * is 340 ms, which should be sufficiently long spacing to make
+ * speech quantum deletions tolerable. */
+ config->thinning_int = 17;
+
+ /* With RTP timestamps being 32 bits and with the usual RTP
+ * clock rate of 8000 timestamp units per second, a packet may
+ * arrive that claims to be as far as 3 days into the future.
+ * Such aberrant RTP packets are jocularly referred to as
+ * time travelers. Assuming that actual time travel either
+ * does not exist at all or at least does not happen in the
+ * present context, we reason that when such "time traveler" RTP
+ * packets do arrive, we must be dealing with the effect of a
+ * software bug or misdesign or misconfiguration in whatever
+ * foreign network element is sending us RTP. In any case,
+ * irrespective of the cause, we must be prepared for the
+ * possibility of seeming "time travel" in the incoming RTP stream.
+ * We implement an arbitrary threshold: if the received RTP ts
+ * is too far into the future, we treat that packet as the
+ * beginning of a new stream, same as SSRC change or non-quantum
+ * ts increment. This threshold has 1 s granularity, which is
+ * sufficient for its intended purpose of catching gross errors.
+ * The minimum setting of this threshold is 1 s, but let's
+ * default to 10 s, being generous to networks with really bad
+ * latency. */
+ config->max_future_sec = 10;
+}
+
+/* create and destroy functions */
+
+struct osmo_twjit *osmo_twjit_create(void *ctx, uint16_t clock_khz,
+ uint16_t quantum_ms,
+ const struct osmo_twjit_config *config)
+{
+ struct osmo_twjit *twjit;
+
+ twjit = talloc_zero(ctx, struct osmo_twjit);
+ if (!twjit)
+ return NULL;
+
+ twjit->ext_config = config;
+ twjit->state = TWJIT_STATE_EMPTY;
+ INIT_LLIST_HEAD(&twjit->sb[0].queue);
+ INIT_LLIST_HEAD(&twjit->sb[1].queue);
+ twjit->ts_quantum = (uint32_t) quantum_ms * clock_khz;
+ twjit->quanta_per_sec = 1000 / quantum_ms;
+ twjit->ts_units_per_ms = clock_khz;
+ twjit->ts_units_per_sec = (uint32_t) clock_khz * 1000;
+ twjit->ns_to_ts_units = 1000000 / clock_khz;
+
+ return twjit;
+}
+
+void osmo_twjit_destroy(struct osmo_twjit *twjit)
+{
+ msgb_queue_free(&twjit->sb[0].queue);
+ msgb_queue_free(&twjit->sb[1].queue);
+ talloc_free(twjit);
+}
+
+/* Here is how twjit config works: every twjit instance remembers
+ * a pointer to struct osmo_twjit_config, either the initial one
+ * given to osmo_twjit_create() or an updated one set with
+ * osmo_twjit_new_config(). However, the memory holding this
+ * config structure remains owned by the application, and all
+ * config settings therein may be freely changed by vty at any time.
+ * In the case of changes to twjit config after the call to
+ * osmo_twjit_create(), whether these changes are done by feeding
+ * a new config structure to osmo_twjit_new_config() or by changing
+ * values in the previously-supplied structure, all changes take
+ * effect atomically whenever a new sub-buffer is initialized,
+ * upon receiving the first RTP packet into a completely empty
+ * buffer or upon receiving a packet that constitutes handover.
+ */
+void osmo_twjit_new_config(struct osmo_twjit *twjit,
+ const struct osmo_twjit_config *config)
+{
+ twjit->ext_config = config;
+}
+
+/* The following reset function is intended to be called when the
+ * application stops doing regular (once every time quantum) reads
+ * from the jitter buffer, but may resume this activity later.
+ * All packet Rx state and queues are cleared, but "lifetime"
+ * statistical counters are NOT reset.
+ */
+void osmo_twjit_reset(struct osmo_twjit *twjit)
+{
+ msgb_queue_free(&twjit->sb[0].queue);
+ msgb_queue_free(&twjit->sb[1].queue);
+ twjit->state = TWJIT_STATE_EMPTY;
+ twjit->sb[0].depth = 0;
+ twjit->sb[1].depth = 0;
+ twjit->got_first_packet = false;
+}
+
+/* simple information retrieval functions */
+
+const struct osmo_twjit_stats *
+osmo_twjit_get_stats(struct osmo_twjit *twjit)
+{
+ return &twjit->stats;
+}
+
+const struct osmo_twjit_rr_info *
+osmo_twjit_get_rr_info(struct osmo_twjit *twjit)
+{
+ return &twjit->rr_info;
+}
+
+bool osmo_twjit_got_any_input(struct osmo_twjit *twjit)
+{
+ return twjit->got_first_packet;
+}
diff --git a/src/twjit_in.c b/src/twjit_in.c
new file mode 100644
index 0000000..6f0583d
--- /dev/null
+++ b/src/twjit_in.c
@@ -0,0 +1,304 @@
+/*
+ * Themyscira Wireless RTP jitter buffer implementation: input processing
+ * of received RTP packets.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include <arpa/inet.h> /* for network byte order functions */
+
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/timer.h>
+#include <osmocom/core/utils.h>
+
+#include <osmocom/netif/twjit.h>
+#include <osmocom/netif/twjit_private.h>
+#include <osmocom/netif/rtp.h>
+
+/* raw analytics on the Rx packet stream */
+
+static void analytics_init(struct osmo_twjit *twjit, uint32_t rx_ssrc,
+ uint16_t rx_seq)
+{
+ struct osmo_twjit_rr_info *rri = &twjit->rr_info;
+
+ rri->ssrc = rx_ssrc;
+ rri->rx_packets = 1;
+ rri->base_seq = rx_seq;
+ rri->max_seq_ext = rx_seq;
+ rri->expected_pkt = 1;
+ rri->jitter_accum = 0;
+}
+
+static void analytics_cont(struct osmo_twjit *twjit, uint16_t rx_seq,
+ uint32_t rx_ts, const struct timespec *now)
+{
+ struct osmo_twjit_rr_info *rri = &twjit->rr_info;
+ uint16_t seq_ext_lo = rri->max_seq_ext;
+ uint16_t seq_ext_hi = rri->max_seq_ext >> 16;
+ int16_t seq_delta = (int16_t)(rx_seq - twjit->last_seq);
+ int16_t seq_delta2 = (int16_t)(rx_seq - seq_ext_lo);
+ int32_t ts_delta = (int32_t)(rx_ts - twjit->last_ts);
+ struct timespec time_delta;
+ uint32_t time_delta_tsu;
+ int32_t jitter_new, ts_delta_clamp;
+
+ /* analytics for our own stats */
+ if (seq_delta < 0)
+ twjit->stats.seq_backwards++;
+ else if (seq_delta == 0)
+ twjit->stats.seq_repeats++;
+ else if (seq_delta == 1) {
+ if (ts_delta != twjit->ts_quantum) {
+ if (ts_delta > 0 && (ts_delta % twjit->ts_quantum) == 0)
+ twjit->stats.intentional_gaps++;
+ else
+ twjit->stats.ts_resets++;
+ }
+ } else
+ twjit->stats.seq_skips++;
+
+ /* analytics for RTCP RR: packet counts */
+ rri->rx_packets++;
+ if (seq_delta2 > 0) {
+ if (rx_seq < seq_ext_lo)
+ seq_ext_hi++;
+ seq_ext_lo = rx_seq;
+ rri->max_seq_ext = ((uint32_t) seq_ext_hi << 16) | seq_ext_lo;
+ rri->expected_pkt = rri->max_seq_ext - rri->base_seq + 1;
+ }
+
+ /* time-of-arrival analytics */
+ time_delta.tv_sec = now->tv_sec - twjit->last_arrival.tv_sec;
+ time_delta.tv_nsec = now->tv_nsec - twjit->last_arrival.tv_nsec;
+ if (time_delta.tv_nsec < 0) {
+ time_delta.tv_sec--;
+ time_delta.tv_nsec += 1000000000;
+ }
+ /* to avoid overflows in downstream math, clamp to 1 hour */
+ if (time_delta.tv_sec >= 3600) {
+ time_delta.tv_sec = 3600;
+ time_delta.tv_nsec = 0;
+ }
+ /* convert to RTP timestamp units */
+ time_delta_tsu = time_delta.tv_sec * twjit->ts_units_per_sec +
+ time_delta.tv_nsec / twjit->ns_to_ts_units;
+ twjit->last_arrival_delta = time_delta_tsu;
+ /* jitter calculation for RTCP RR */
+ ts_delta_clamp = twjit->ts_units_per_sec * 3600;
+ if (ts_delta > ts_delta_clamp)
+ ts_delta = ts_delta_clamp;
+ else if (ts_delta < -ts_delta_clamp)
+ ts_delta = -ts_delta_clamp;
+ jitter_new = time_delta_tsu - ts_delta;
+ if (jitter_new < 0)
+ jitter_new = -jitter_new;
+ rri->jitter_accum += jitter_new - ((rri->jitter_accum + 8) >> 4);
+ if (jitter_new > twjit->stats.jitter_max)
+ twjit->stats.jitter_max = jitter_new;
+}
+
+/* actual twjit input logic */
+
+static void
+init_subbuf_first_packet(struct osmo_twjit *twjit, struct msgb *msg,
+ uint32_t rx_ssrc, uint32_t rx_ts)
+{
+ struct twjit_subbuf *sb = &twjit->sb[twjit->write_sb];
+
+ OSMO_ASSERT(llist_empty(&sb->queue));
+ OSMO_ASSERT(sb->depth == 0);
+ /* all good, proceed */
+ sb->ssrc = rx_ssrc;
+ sb->head_ts = rx_ts;
+ msgb_enqueue(&sb->queue, msg);
+ sb->depth = 1;
+ memcpy(&sb->conf, twjit->ext_config, sizeof(struct osmo_twjit_config));
+ sb->drop_int_count = 0;
+ /* The setting of delta_ms is needed in order to pacify the check
+ * in twjit_out.c:starting_sb_is_ready() in configurations with
+ * bd_start=1. An alternative would be to enforce start_min_delta
+ * being not set with bd_start=1, but the present solution is
+ * simpler than doing cross-enforcement between two different
+ * parameter settings in vty. */
+ sb->delta_ms = UINT32_MAX;
+}
+
+enum input_decision {
+ INPUT_CONTINUE,
+ INPUT_TOO_OLD,
+ INPUT_RESET,
+};
+
+static enum input_decision
+check_input_for_subbuf(struct osmo_twjit *twjit, bool starting,
+ uint32_t rx_ssrc, uint32_t rx_ts)
+{
+ struct twjit_subbuf *sb = &twjit->sb[twjit->write_sb];
+ int32_t ts_delta;
+
+ if (rx_ssrc != sb->ssrc)
+ return INPUT_RESET;
+ sb->delta_ms = twjit->last_arrival_delta / twjit->ts_units_per_ms;
+ ts_delta = (int32_t)(rx_ts - sb->head_ts);
+ if (ts_delta < 0)
+ return INPUT_TOO_OLD;
+ if (ts_delta % twjit->ts_quantum)
+ return INPUT_RESET;
+ if (starting) {
+ if (sb->conf.start_max_delta &&
+ sb->delta_ms > sb->conf.start_max_delta)
+ return INPUT_RESET;
+ } else {
+ uint32_t fwd = ts_delta / twjit->ts_quantum;
+
+ if (fwd >= (uint32_t) sb->conf.max_future_sec *
+ twjit->quanta_per_sec)
+ return INPUT_RESET;
+ }
+ return INPUT_CONTINUE;
+}
+
+static void toss_write_queue(struct osmo_twjit *twjit)
+{
+ struct twjit_subbuf *sb = &twjit->sb[twjit->write_sb];
+
+ msgb_queue_free(&sb->queue);
+ sb->depth = 0;
+}
+
+static void insert_pkt_write_sb(struct osmo_twjit *twjit, struct msgb *new_msg,
+ uint32_t rx_ts)
+{
+ struct twjit_subbuf *sb = &twjit->sb[twjit->write_sb];
+ uint32_t ts_delta = rx_ts - sb->head_ts;
+ uint32_t ins_depth = ts_delta / twjit->ts_quantum;
+ struct msgb *old_msg;
+ uint32_t old_ts_delta;
+
+ /* are we increasing total depth, and can we do simple tail append? */
+ if (ins_depth >= sb->depth) {
+ msgb_enqueue(&sb->queue, new_msg);
+ sb->depth = ins_depth + 1;
+ return;
+ }
+ /* nope - do it the hard way */
+ llist_for_each_entry(old_msg, &sb->queue, list) {
+ old_ts_delta = old_msg->cb[0] - sb->head_ts;
+ if (old_ts_delta == ts_delta) {
+ /* two packets with the same timestamp! */
+ twjit->stats.duplicate_ts++;
+ msgb_free(new_msg);
+ return;
+ }
+ if (old_ts_delta > ts_delta)
+ break;
+ }
+ llist_add_tail(&new_msg->list, &old_msg->list);
+}
+
+static void trim_starting_sb(struct osmo_twjit *twjit)
+{
+ struct twjit_subbuf *sb = &twjit->sb[twjit->write_sb];
+ struct msgb *msg;
+ uint32_t msg_ts, ts_adv, quantum_adv;
+
+ while (sb->depth > sb->conf.bd_start) {
+ msg = msgb_dequeue(&sb->queue);
+ OSMO_ASSERT(msg);
+ msgb_free(msg);
+ OSMO_ASSERT(!llist_empty(&sb->queue));
+ msg = llist_entry(sb->queue.next, struct msgb, list);
+ msg_ts = msg->cb[0];
+ ts_adv = msg_ts - sb->head_ts;
+ quantum_adv = ts_adv / twjit->ts_quantum;
+ OSMO_ASSERT(sb->depth > quantum_adv);
+ sb->head_ts = msg_ts;
+ sb->depth -= quantum_adv;
+ }
+}
+
+void osmo_twjit_input(struct osmo_twjit *twjit, struct msgb *msg)
+{
+ bool got_previous_input = twjit->got_first_packet;
+ struct rtp_hdr *rtph;
+ uint32_t rx_ssrc, rx_ts;
+ uint16_t rx_seq;
+ struct timespec now;
+ enum input_decision id;
+
+ rtph = osmo_rtp_get_hdr(msg);
+ if (!rtph) {
+ twjit->stats.bad_packets++;
+ msgb_free(msg);
+ return;
+ }
+ rx_ssrc = ntohl(rtph->ssrc);
+ rx_ts = ntohl(rtph->timestamp);
+ rx_seq = ntohs(rtph->sequence);
+ osmo_clock_gettime(CLOCK_MONOTONIC, &now);
+ if (!got_previous_input) {
+ analytics_init(twjit, rx_ssrc, rx_seq);
+ twjit->got_first_packet = true;
+ } else if (rx_ssrc != twjit->rr_info.ssrc) {
+ twjit->stats.ssrc_changes++;
+ analytics_init(twjit, rx_ssrc, rx_seq);
+ } else
+ analytics_cont(twjit, rx_seq, rx_ts, &now);
+ twjit->last_seq = rx_seq;
+ twjit->last_ts = rx_ts;
+ memcpy(&twjit->last_arrival, &now, sizeof(struct timespec));
+ twjit->stats.rx_packets++;
+ msg->cb[0] = rx_ts;
+
+ switch (twjit->state) {
+ case TWJIT_STATE_EMPTY:
+ /* first packet into totally empty buffer */
+ if (got_previous_input)
+ twjit->stats.underruns++;
+ twjit->state = TWJIT_STATE_HUNT;
+ twjit->write_sb = 0;
+ init_subbuf_first_packet(twjit, msg, rx_ssrc, rx_ts);
+ return;
+ case TWJIT_STATE_HUNT:
+ case TWJIT_STATE_HANDOVER:
+ id = check_input_for_subbuf(twjit, true, rx_ssrc, rx_ts);
+ if (id == INPUT_TOO_OLD) {
+ msgb_free(msg);
+ return;
+ }
+ if (id == INPUT_RESET) {
+ toss_write_queue(twjit);
+ init_subbuf_first_packet(twjit, msg, rx_ssrc, rx_ts);
+ return;
+ }
+ insert_pkt_write_sb(twjit, msg, rx_ts);
+ trim_starting_sb(twjit);
+ return;
+ case TWJIT_STATE_FLOWING:
+ id = check_input_for_subbuf(twjit, false, rx_ssrc, rx_ts);
+ if (id == INPUT_TOO_OLD) {
+ twjit->stats.too_old++;
+ msgb_free(msg);
+ return;
+ }
+ if (id == INPUT_RESET) {
+ twjit->state = TWJIT_STATE_HANDOVER;
+ twjit->write_sb = !twjit->write_sb;
+ init_subbuf_first_packet(twjit, msg, rx_ssrc, rx_ts);
+ twjit->stats.handovers_in++;
+ return;
+ }
+ insert_pkt_write_sb(twjit, msg, rx_ts);
+ return;
+ default:
+ OSMO_ASSERT(0);
+ }
+}
diff --git a/src/twjit_out.c b/src/twjit_out.c
new file mode 100644
index 0000000..94a2a39
--- /dev/null
+++ b/src/twjit_out.c
@@ -0,0 +1,122 @@
+/*
+ * Themyscira Wireless RTP jitter buffer implementation:
+ * output to the fixed timing system.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/utils.h>
+
+#include <osmocom/netif/twjit.h>
+#include <osmocom/netif/twjit_private.h>
+
+static bool starting_sb_is_ready(struct osmo_twjit *twjit)
+{
+ struct twjit_subbuf *sb = &twjit->sb[twjit->write_sb];
+
+ if (sb->depth < sb->conf.bd_start)
+ return false;
+ if (sb->delta_ms < sb->conf.start_min_delta)
+ return false;
+ return true;
+}
+
+static bool read_sb_is_empty(struct osmo_twjit *twjit)
+{
+ struct twjit_subbuf *sb = &twjit->sb[twjit->read_sb];
+
+ return sb->depth == 0;
+}
+
+static struct msgb *pull_from_read_sb(struct osmo_twjit *twjit)
+{
+ struct twjit_subbuf *sb = &twjit->sb[twjit->read_sb];
+ struct msgb *msg;
+
+ OSMO_ASSERT(!llist_empty(&sb->queue));
+ OSMO_ASSERT(sb->depth > 0);
+ msg = llist_entry(sb->queue.next, struct msgb, list);
+ if (msg->cb[0] == sb->head_ts) {
+ llist_del(&msg->list);
+ twjit->stats.delivered_pkt++;
+ } else {
+ msg = NULL;
+ twjit->stats.output_gaps++;
+ }
+ sb->head_ts += twjit->ts_quantum;
+ sb->depth--;
+ return msg;
+}
+
+static void read_sb_thinning(struct osmo_twjit *twjit)
+{
+ struct twjit_subbuf *sb = &twjit->sb[twjit->read_sb];
+ struct msgb *msg;
+
+ if (sb->drop_int_count) {
+ sb->drop_int_count--;
+ return;
+ }
+ if (sb->depth <= sb->conf.bd_hiwat)
+ return;
+ twjit->stats.thinning_drops++;
+ msg = pull_from_read_sb(twjit);
+ if (msg)
+ msgb_free(msg);
+ sb->drop_int_count = sb->conf.thinning_int - 2;
+}
+
+static void toss_read_queue(struct osmo_twjit *twjit)
+{
+ struct twjit_subbuf *sb = &twjit->sb[twjit->read_sb];
+
+ msgb_queue_free(&sb->queue);
+ sb->depth = 0;
+}
+
+struct msgb *osmo_twjit_output(struct osmo_twjit *twjit)
+{
+ switch (twjit->state) {
+ case TWJIT_STATE_EMPTY:
+ return NULL;
+ case TWJIT_STATE_HUNT:
+ if (!starting_sb_is_ready(twjit))
+ return NULL;
+ twjit->state = TWJIT_STATE_FLOWING;
+ twjit->read_sb = twjit->write_sb;
+ return pull_from_read_sb(twjit);
+ case TWJIT_STATE_FLOWING:
+ if (read_sb_is_empty(twjit)) {
+ twjit->state = TWJIT_STATE_EMPTY;
+ return NULL;
+ }
+ read_sb_thinning(twjit);
+ return pull_from_read_sb(twjit);
+ case TWJIT_STATE_HANDOVER:
+ if (starting_sb_is_ready(twjit)) {
+ toss_read_queue(twjit);
+ twjit->stats.handovers_out++;
+ twjit->state = TWJIT_STATE_FLOWING;
+ twjit->read_sb = twjit->write_sb;
+ return pull_from_read_sb(twjit);
+ }
+ if (read_sb_is_empty(twjit)) {
+ twjit->state = TWJIT_STATE_HUNT;
+ twjit->stats.ho_underruns++;
+ return NULL;
+ }
+ read_sb_thinning(twjit);
+ return pull_from_read_sb(twjit);
+ default:
+ OSMO_ASSERT(0);
+ }
+}
diff --git a/src/twjit_vty.c b/src/twjit_vty.c
new file mode 100644
index 0000000..a16f9a1
--- /dev/null
+++ b/src/twjit_vty.c
@@ -0,0 +1,134 @@
+/*
+ * Themyscira Wireless RTP jitter buffer implementation: vty configuration.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <osmocom/core/utils.h>
+#include <osmocom/vty/vty.h>
+#include <osmocom/vty/command.h>
+
+#include <osmocom/netif/twjit.h>
+
+int osmo_twjit_config_write(struct vty *vty,
+ const struct osmo_twjit_config *conf,
+ const char *name, const char *prefix)
+{
+ vty_out(vty, "%s%s%s", prefix, name ? : "twjit", VTY_NEWLINE);
+ vty_out(vty, "%s buffer-depth %u %u%s", prefix, conf->bd_start,
+ conf->bd_hiwat, VTY_NEWLINE);
+ vty_out(vty, "%s thinning-interval %u%s", prefix, conf->thinning_int,
+ VTY_NEWLINE);
+ vty_out(vty, "%s max-future-sec %u%s", prefix, conf->max_future_sec,
+ VTY_NEWLINE);
+
+ if (conf->start_min_delta) {
+ vty_out(vty, "%s start-min-delta %u%s", prefix,
+ conf->start_min_delta, VTY_NEWLINE);
+ }
+ if (conf->start_max_delta) {
+ vty_out(vty, "%s start-max-delta %u%s", prefix,
+ conf->start_max_delta, VTY_NEWLINE);
+ }
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_buffer_depth, cfg_buffer_depth_cmd,
+ "buffer-depth <1-65535> <1-65535>",
+ "Buffer depth configuration\n"
+ "Minimum fill required to start flow\n"
+ "High water mark fill level\n")
+{
+ struct osmo_twjit_config *conf = vty->index;
+ unsigned bd_start = atoi(argv[0]);
+ unsigned bd_hiwat = atoi(argv[1]);
+
+ if (bd_hiwat < bd_start) {
+ vty_out(vty, "%% Error: high water mark cannot be less than starting level%s",
+ VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ conf->bd_start = bd_start;
+ conf->bd_hiwat = bd_hiwat;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_thinning, cfg_thinning_cmd,
+ "thinning-interval <2-65535>",
+ "Standing queue thinning configuration\n"
+ "Drop every Nth packet\n")
+{
+ struct osmo_twjit_config *conf = vty->index;
+ conf->thinning_int = atoi(argv[0]);
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_max_future, cfg_max_future_cmd,
+ "max-future-sec <1-65535>",
+ "Guard against time traveler packets\n"
+ "Maximum permissible number of seconds into the future\n")
+{
+ struct osmo_twjit_config *conf = vty->index;
+ conf->max_future_sec = atoi(argv[0]);
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_start_min_delta, cfg_start_min_delta_cmd,
+ "start-min-delta <1-65535>",
+ "Minimum required delta in time-of-arrival to start flow\n"
+ "Time delta value in ms\n")
+{
+ struct osmo_twjit_config *conf = vty->index;
+ conf->start_min_delta = atoi(argv[0]);
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_no_start_min_delta, cfg_no_start_min_delta_cmd,
+ "no start-min-delta",
+ NO_STR "Minimum required delta in time-of-arrival to start flow\n")
+{
+ struct osmo_twjit_config *conf = vty->index;
+ conf->start_min_delta = 0;
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_start_max_delta, cfg_start_max_delta_cmd,
+ "start-max-delta <1-65535>",
+ "Maximum permitted gap in time-of-arrival in starting state\n"
+ "Time delta value in ms\n")
+{
+ struct osmo_twjit_config *conf = vty->index;
+ conf->start_max_delta = atoi(argv[0]);
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_no_start_max_delta, cfg_no_start_max_delta_cmd,
+ "no start-max-delta",
+ NO_STR "Maximum permitted gap in time-of-arrival in starting state\n")
+{
+ struct osmo_twjit_config *conf = vty->index;
+ conf->start_max_delta = 0;
+ return CMD_SUCCESS;
+}
+
+void osmo_twjit_vty_init(int twjit_node)
+{
+ install_lib_element(twjit_node, &cfg_buffer_depth_cmd);
+ install_lib_element(twjit_node, &cfg_thinning_cmd);
+ install_lib_element(twjit_node, &cfg_max_future_cmd);
+ install_lib_element(twjit_node, &cfg_start_min_delta_cmd);
+ install_lib_element(twjit_node, &cfg_no_start_min_delta_cmd);
+ install_lib_element(twjit_node, &cfg_start_max_delta_cmd);
+ install_lib_element(twjit_node, &cfg_no_start_max_delta_cmd);
+}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/39280?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: Ia3be5834571ca18b68939abbcf1ce3a879156658
Gerrit-Change-Number: 39280
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
1
0
10 Jan '25
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/39281?usp=email )
Change subject: bring twrtp into libosmo-netif
......................................................................
bring twrtp into libosmo-netif
twrtp is the top layer of Themyscira Wireless RTP endpoint
implementation, an alternative to Belledonne libortp.
Unlike Belledonne software, ThemWi RTP library was developed
specifically for use in Osmocom-based GSM, ISDN and IP-PSTN
network elements, and is built on top of libosmocore primitives -
thus it can function more natively in Osmocom universe than ortp.
This ThemWi library was initially developed externally to Osmocom,
but is now being brought into libosmo-netif so it can be used by
native Osmocom projects, particularly OsmoBTS.
Related: OS#6474
Change-Id: Ib63215aaf13ef8ab8f2e0c8d310164cd5c8824eb
---
M include/osmocom/netif/Makefile.am
A include/osmocom/netif/rtcp_defs.h
A include/osmocom/netif/twrtp.h
A include/osmocom/netif/twrtp_private.h
M src/Makefile.am
A src/twrtp_base.c
A src/twrtp_bind.c
A src/twrtp_misc.c
A src/twrtp_remote.c
A src/twrtp_rtcp_rx.c
A src/twrtp_rtcp_tx.c
A src/twrtp_rtp_rx.c
A src/twrtp_rtp_tx.c
A src/twrtp_twjit.c
14 files changed, 1,288 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/81/39281/1
diff --git a/include/osmocom/netif/Makefile.am b/include/osmocom/netif/Makefile.am
index d06adda..a3cfcdd 100644
--- a/include/osmocom/netif/Makefile.am
+++ b/include/osmocom/netif/Makefile.am
@@ -1,6 +1,8 @@
noinst_HEADERS = \
+ rtcp_defs.h \
stream_private.h \
twjit_private.h \
+ twrtp_private.h \
$(NULL)
osmonetif_HEADERS = amr.h \
@@ -14,6 +16,7 @@
rtp.h \
stream.h \
twjit.h \
+ twrtp.h \
$(NULL)
if ENABLE_LIBSCTP
diff --git a/include/osmocom/netif/rtcp_defs.h b/include/osmocom/netif/rtcp_defs.h
new file mode 100644
index 0000000..744be35
--- /dev/null
+++ b/include/osmocom/netif/rtcp_defs.h
@@ -0,0 +1,49 @@
+/*
+ * Some definitions for RTCP, just enough to implement SR and RR
+ * generation and parsing in twrtp.
+ */
+
+#pragma once
+
+#include <stdint.h>
+
+struct rtcp_sr_rr_hdr {
+ uint8_t v_p_rc;
+ uint8_t pt;
+ uint16_t len;
+ uint32_t ssrc;
+};
+
+struct rtcp_sr_block {
+ uint32_t ntp_sec;
+ uint32_t ntp_fract;
+ uint32_t rtp_ts;
+ uint32_t pkt_count;
+ uint32_t octet_count;
+};
+
+struct rtcp_rr_block {
+ uint32_t ssrc;
+ uint32_t lost_word;
+ uint32_t max_seq_ext;
+ uint32_t jitter;
+ uint16_t lsr_sec;
+ uint16_t lsr_fract;
+ uint16_t dlsr_sec;
+ uint16_t dlsr_fract;
+};
+
+#define RTCP_PT_SR 200
+#define RTCP_PT_RR 201
+#define RTCP_PT_SDES 202
+#define RTCP_PT_BYE 203
+#define RTCP_PT_APP 204
+
+#define SDES_ITEM_CNAME 1
+#define SDES_ITEM_NAME 2
+#define SDES_ITEM_EMAIL 3
+#define SDES_ITEM_PHONE 4
+#define SDES_ITEM_LOC 5
+#define SDES_ITEM_TOOL 6
+#define SDES_ITEM_NOTE 7
+#define SDES_ITEM_PRIV 8
diff --git a/include/osmocom/netif/twrtp.h b/include/osmocom/netif/twrtp.h
new file mode 100644
index 0000000..c6fa9af
--- /dev/null
+++ b/include/osmocom/netif/twrtp.h
@@ -0,0 +1,139 @@
+/*
+ * Themyscira Wireless RTP endpoint implementation:
+ * public API definition for Osmocom-integrated version.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#pragma once
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <osmocom/core/socket.h>
+
+/*
+ * Each instance of twrtp in the present version exists as struct osmo_twrtp.
+ * This structure is opaque, and always constitutes a talloc context.
+ */
+struct osmo_twrtp;
+
+/*
+ * Stats collected during the lifetime of a twrtp instance.
+ */
+struct osmo_twrtp_stats {
+ uint32_t rx_rtp_pkt;
+ uint32_t rx_rtp_badsrc;
+ uint32_t rx_rtcp_pkt;
+ uint32_t rx_rtcp_badsrc;
+ uint32_t rx_rtcp_invalid;
+ uint32_t rx_rtcp_wrong_ssrc;
+ uint32_t tx_rtp_pkt;
+ uint32_t tx_rtp_bytes;
+ uint32_t tx_rtcp_pkt;
+};
+
+/* declare structs that are used in our API */
+
+struct msgb;
+struct osmo_twjit_config;
+struct osmo_twjit_stats;
+struct osmo_twjit_rr_info;
+
+/* public API functions: create & destroy, local and remote addresses */
+
+struct osmo_twrtp *
+osmo_twrtp_create(void *ctx, uint16_t clock_khz, uint16_t quantum_ms,
+ bool random_ts_seq,
+ const struct osmo_twjit_config *twjit_config);
+void osmo_twrtp_destroy(struct osmo_twrtp *endp);
+
+int osmo_twrtp_supply_fds(struct osmo_twrtp *endp, int rtp_fd, int rtcp_fd);
+
+int osmo_twrtp_bind_local_ipv4(struct osmo_twrtp *endp,
+ const struct in_addr *ip, uint16_t port);
+int osmo_twrtp_bind_local_ipv6(struct osmo_twrtp *endp,
+ const struct in6_addr *ip6, uint16_t port);
+int osmo_twrtp_bind_local_sin(struct osmo_twrtp *endp,
+ const struct sockaddr_in *sin);
+int osmo_twrtp_bind_local_sin6(struct osmo_twrtp *endp,
+ const struct sockaddr_in6 *sin6);
+
+void osmo_twrtp_set_remote_ipv4(struct osmo_twrtp *endp,
+ const struct in_addr *ip, uint16_t port);
+void osmo_twrtp_set_remote_ipv6(struct osmo_twrtp *endp,
+ const struct in6_addr *ip6, uint16_t port);
+void osmo_twrtp_set_remote_sin(struct osmo_twrtp *endp,
+ const struct sockaddr_in *sin);
+void osmo_twrtp_set_remote_sin6(struct osmo_twrtp *endp,
+ const struct sockaddr_in6 *sin6);
+
+/* receiving incoming RTP via twjit */
+
+void osmo_twrtp_twjit_rx_enable(struct osmo_twrtp *endp);
+void osmo_twrtp_twjit_rx_disable(struct osmo_twrtp *endp);
+
+/* output function, to be called by TDM/GSM/etc fixed-timing side */
+struct msgb *osmo_twrtp_twjit_rx_poll(struct osmo_twrtp *endp);
+
+void osmo_twrtp_new_twjit_config(struct osmo_twrtp *endp,
+ const struct osmo_twjit_config *config);
+
+/* receiving incoming RTP without twjit */
+
+/* callback function takes ownership of msgb! */
+typedef void (*osmo_twrtp_raw_rx_cb)(struct osmo_twrtp *endp, void *user_data,
+ struct msgb *msg);
+
+void osmo_twrtp_set_raw_rx_cb(struct osmo_twrtp *endp, osmo_twrtp_raw_rx_cb cb,
+ void *user_data);
+
+/* RTP Tx direction */
+
+int osmo_twrtp_tx_quantum(struct osmo_twrtp *endp, const uint8_t *payload,
+ unsigned payload_len, uint8_t payload_type,
+ bool marker, bool auto_marker, bool send_rtcp);
+void osmo_twrtp_tx_skip(struct osmo_twrtp *endp);
+void osmo_twrtp_tx_restart(struct osmo_twrtp *endp);
+
+int osmo_twrtp_tx_forward(struct osmo_twrtp *endp, struct msgb *msg);
+
+/* support for emitting RTCP SR & RR */
+
+int osmo_twrtp_set_sdes(struct osmo_twrtp *endp, const char *cname,
+ const char *name, const char *email, const char *phone,
+ const char *loc, const char *tool, const char *note);
+void osmo_twrtp_set_auto_rtcp_interval(struct osmo_twrtp *endp,
+ uint16_t interval);
+
+int osmo_twrtp_send_rtcp_rr(struct osmo_twrtp *endp);
+
+/* stats retrieval: valid with or without twjit */
+
+const struct osmo_twrtp_stats *osmo_twrtp_get_stats(struct osmo_twrtp *endp);
+
+/* have we received at least one RTCP RR matching our RTP Tx output? */
+bool osmo_twrtp_got_rtcp_rr(struct osmo_twrtp *endp);
+
+/* retrieving RTCP RR info: valid only if above function returned true */
+uint32_t osmo_twrtp_rr_lost_word(struct osmo_twrtp *endp);
+int32_t osmo_twrtp_rr_lost_cumulative(struct osmo_twrtp *endp);
+uint32_t osmo_twrtp_rr_jitter_last(struct osmo_twrtp *endp);
+uint32_t osmo_twrtp_rr_jitter_max(struct osmo_twrtp *endp);
+
+/* retrieving additional info from twjit layer */
+
+const struct osmo_twjit_stats *
+osmo_twrtp_get_twjit_stats(struct osmo_twrtp *endp);
+
+const struct osmo_twjit_rr_info *
+osmo_twrtp_get_twjit_rr_info(struct osmo_twrtp *endp);
+
+bool osmo_twrtp_twjit_got_input(struct osmo_twrtp *endp);
+
+/* socket-related miscellany */
+
+int osmo_twrtp_set_dscp(struct osmo_twrtp *endp, uint8_t dscp);
+int osmo_twrtp_set_socket_prio(struct osmo_twrtp *endp, int prio);
diff --git a/include/osmocom/netif/twrtp_private.h b/include/osmocom/netif/twrtp_private.h
new file mode 100644
index 0000000..d565495
--- /dev/null
+++ b/include/osmocom/netif/twrtp_private.h
@@ -0,0 +1,88 @@
+/*
+ * Themyscira Wireless RTP endpoint implementation:
+ * internal definitions confined to twrtp code inside libosmo-netif.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#pragma once
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include <osmocom/core/osmo_io.h>
+#include <osmocom/core/socket.h>
+#include <osmocom/core/timer.h>
+
+#include <osmocom/netif/twrtp.h>
+
+struct twrtp_endp_tx {
+ uint32_t ssrc;
+ uint32_t ts;
+ uint32_t ts_addend;
+ uint16_t seq;
+ bool started;
+ bool restart;
+};
+
+struct twrtp_endp_rtcp_rx {
+ uint32_t sr_ssrc;
+ uint16_t sr_ntp_sec;
+ uint16_t sr_ntp_fract;
+ struct timespec sr_rx_time;
+ uint32_t rr_lost_word;
+ uint32_t rr_jitter;
+ uint32_t rr_jitter_max;
+ bool got_sr;
+ bool got_rr;
+};
+
+struct twrtp_endp_rtcp_tx {
+ uint32_t last_received;
+ uint32_t last_expected;
+};
+
+struct osmo_twjit;
+
+struct osmo_twrtp {
+ /* the root of the matter: the two sockets */
+ struct osmo_io_fd *iofd_rtp;
+ struct osmo_io_fd *iofd_rtcp;
+ struct osmo_sockaddr rtp_remote;
+ struct osmo_sockaddr rtcp_remote;
+ /* count of RTP timestamp units per quantum */
+ uint32_t ts_quantum;
+ /* scaling factors for RTP Tx timestamp computation */
+ uint32_t ts_units_per_sec;
+ uint32_t ns_to_ts_units;
+ /* RTP Rx path: twjit and raw options */
+ struct osmo_twjit *twjit;
+ osmo_twrtp_raw_rx_cb raw_rx_cb;
+ void *raw_rx_cb_data;
+ /* RTP Tx state */
+ struct twrtp_endp_tx tx;
+ /* RTCP info */
+ struct twrtp_endp_rtcp_rx rtcp_rx;
+ struct twrtp_endp_rtcp_tx rtcp_tx;
+ uint8_t *sdes_buf;
+ uint16_t sdes_len;
+ uint16_t auto_rtcp_interval;
+ uint16_t auto_rtcp_count;
+ /* always have to have stats */
+ struct osmo_twrtp_stats stats;
+ /* bool flags at the end for structure packing optimization */
+ bool register_done;
+ bool remote_set;
+ bool twjit_rx_enable;
+};
+
+/* internal linkage */
+
+extern const struct osmo_io_ops _osmo_twrtp_iops_rtp;
+extern const struct osmo_io_ops _osmo_twrtp_iops_rtcp;
+
+int _osmo_twrtp_send_rtcp(struct osmo_twrtp *endp, bool send_sr,
+ const struct timespec *utc, uint32_t rtp_ts);
diff --git a/src/Makefile.am b/src/Makefile.am
index 171b879..1b563ee 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -32,6 +32,15 @@
twjit_in.c \
twjit_out.c \
twjit_vty.c \
+ twrtp_base.c \
+ twrtp_bind.c \
+ twrtp_misc.c \
+ twrtp_remote.c \
+ twrtp_rtcp_rx.c \
+ twrtp_rtcp_tx.c \
+ twrtp_rtp_rx.c \
+ twrtp_rtp_tx.c \
+ twrtp_twjit.c \
$(NULL)
if ENABLE_LIBSCTP
diff --git a/src/twrtp_base.c b/src/twrtp_base.c
new file mode 100644
index 0000000..bec9a4e
--- /dev/null
+++ b/src/twrtp_base.c
@@ -0,0 +1,160 @@
+/*
+ * Themyscira Wireless RTP endpoint implementation: basic functions,
+ * everything that isn't factored out into other modules.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/osmo_io.h>
+#include <osmocom/core/utils.h>
+
+#include <osmocom/netif/twrtp.h>
+#include <osmocom/netif/twrtp_private.h>
+#include <osmocom/netif/twjit.h>
+#include <osmocom/netif/rtp.h>
+#include <osmocom/netif/rtcp_defs.h>
+
+/* We need to know maximum expected sizes of RTP and RTCP Rx packets
+ * for osmo_io msgb allocation. For RTP, the largest packet size in
+ * 3GPP and IP-PSTN applications is 176 bytes: 12 bytes of RTP header
+ * plus 160 bytes of payload for 20 ms of uncompressed G.711 audio
+ * or CSData. Of course there may be other applications that use
+ * larger RTP packets, in which case we may have to add an API function
+ * that overrides our default msgb alloc size setting - but let's
+ * cross that bridge if and when we actually have such users.
+ *
+ * In case of RTCP, we fully process all received packets inside
+ * the present library, hence we can set osmo_io msgb alloc size
+ * based on what our RTCP Rx code can parse and make use of. Any
+ * additional RTCP Rx data, such as very long SDES strings, will
+ * simply be truncated at osmo_io level - but the subsequent parsing
+ * code will never get to those bits anyway.
+ */
+
+#define MAX_RTP_RX_PACKET (sizeof(struct rtp_hdr) + 160)
+#define MAX_RTCP_RX_PACKET (sizeof(struct rtcp_sr_rr_hdr) + \
+ sizeof(struct rtcp_sr_block) + \
+ sizeof(struct rtcp_rr_block) * 31)
+
+struct osmo_twrtp *
+osmo_twrtp_create(void *ctx, uint16_t clock_khz, uint16_t quantum_ms,
+ bool random_ts_seq,
+ const struct osmo_twjit_config *twjit_config)
+{
+ struct osmo_twrtp *endp;
+
+ endp = talloc_zero(ctx, struct osmo_twrtp);
+ if (!endp)
+ return NULL;
+
+ endp->iofd_rtp = osmo_iofd_setup(endp, -1, NULL,
+ OSMO_IO_FD_MODE_RECVFROM_SENDTO,
+ &_osmo_twrtp_iops_rtp, endp);
+ if (!endp->iofd_rtp) {
+ talloc_free(endp);
+ return NULL;
+ }
+ osmo_iofd_set_alloc_info(endp->iofd_rtp, MAX_RTP_RX_PACKET, 0);
+
+ endp->iofd_rtcp = osmo_iofd_setup(endp, -1, NULL,
+ OSMO_IO_FD_MODE_RECVFROM_SENDTO,
+ &_osmo_twrtp_iops_rtcp, endp);
+ if (!endp->iofd_rtcp) {
+ osmo_iofd_free(endp->iofd_rtp);
+ talloc_free(endp);
+ return NULL;
+ }
+ osmo_iofd_set_alloc_info(endp->iofd_rtcp, MAX_RTCP_RX_PACKET, 0);
+
+ if (twjit_config) {
+ endp->twjit = osmo_twjit_create(endp, clock_khz, quantum_ms,
+ twjit_config);
+ if (!endp->twjit) {
+ osmo_iofd_free(endp->iofd_rtp);
+ osmo_iofd_free(endp->iofd_rtcp);
+ talloc_free(endp);
+ return NULL;
+ }
+ }
+
+ endp->ts_quantum = (uint32_t) quantum_ms * clock_khz;
+ endp->ts_units_per_sec = (uint32_t) clock_khz * 1000;
+ endp->ns_to_ts_units = 1000000 / clock_khz;
+
+ endp->tx.ssrc = random();
+ if (random_ts_seq) {
+ endp->tx.ts_addend = random();
+ endp->tx.seq = random();
+ }
+
+ return endp;
+}
+
+void osmo_twrtp_destroy(struct osmo_twrtp *endp)
+{
+ osmo_iofd_free(endp->iofd_rtp);
+ osmo_iofd_free(endp->iofd_rtcp);
+ if (endp->twjit)
+ osmo_twjit_destroy(endp->twjit);
+ talloc_free(endp);
+}
+
+/* This function equips a newly created twrtp endpoint with file descriptors
+ * for RTP and RTCP sockets. Most applications will use higher-level
+ * osmo_twrtp_bind_local_ipv4() and osmo_twrtp_bind_local_ipv6() functions
+ * that create and bind the right type of sockets, then call the present
+ * function - however, some applications may call this function directly.
+ * In Themyscira Wireless CN environment, there is a separate daemon process
+ * that manages the pool of local UDP ports for RTP+RTCP pairs, and that
+ * daemon passes allocated sockets to its clients via UNIX domain socket
+ * file descriptor passing mechanism - hence twrtp layer must have a public
+ * API that takes in already-bound file descriptor pairs.
+ *
+ * This function always "consumes" the two file descriptors that are passed
+ * to it. If the operation succeeds, each of these fds becomes wrapped in
+ * an osmo_io_fd subordinate to struct osmo_twrtp, and both will eventually
+ * be closed upon osmo_twrtp_destroy(). OTOH, if the present function fails,
+ * it closes both fds before returning its error indication. The latter
+ * behavior may seem wrong, but it is more convenient for all current users,
+ * and consistent with the original twrtp-proto version. If we get a user
+ * application that prefers the other alternative (keeping the fds intact
+ * on EBUSY or if osmo_iofd_register() operations fail), we can create
+ * another variant of this API with that alternative behavior.
+ */
+int osmo_twrtp_supply_fds(struct osmo_twrtp *endp, int rtp_fd, int rtcp_fd)
+{
+ int rc;
+
+ if (endp->register_done) {
+ close(rtp_fd);
+ close(rtcp_fd);
+ return -EBUSY;
+ }
+
+ rc = osmo_iofd_register(endp->iofd_rtp, rtp_fd);
+ if (rc < 0) {
+ close(rtp_fd);
+ close(rtcp_fd);
+ return rc;
+ }
+
+ rc = osmo_iofd_register(endp->iofd_rtcp, rtcp_fd);
+ if (rc < 0) {
+ osmo_iofd_close(endp->iofd_rtp);
+ close(rtcp_fd);
+ return rc;
+ }
+
+ endp->register_done = true;
+ return 0;
+}
diff --git a/src/twrtp_bind.c b/src/twrtp_bind.c
new file mode 100644
index 0000000..66b7e15
--- /dev/null
+++ b/src/twrtp_bind.c
@@ -0,0 +1,120 @@
+/*
+ * Themyscira Wireless RTP endpoint implementation: creating and binding
+ * local UDP sockets for RTP and RTCP.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <stdint.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <osmocom/netif/twrtp.h>
+
+int osmo_twrtp_bind_local_ipv4(struct osmo_twrtp *endp,
+ const struct in_addr *ip, uint16_t port)
+{
+ int rtp_fd, rtcp_fd;
+ struct sockaddr_in sin;
+ int rc;
+
+ sin.sin_family = AF_INET;
+ memcpy(&sin.sin_addr, ip, sizeof(struct in_addr));
+
+ /* do RTP socket first */
+ rc = socket(AF_INET, SOCK_DGRAM, 0);
+ if (rc < 0)
+ return -errno;
+ rtp_fd = rc;
+ sin.sin_port = htons(port);
+ rc = bind(rtp_fd, (struct sockaddr *) &sin, sizeof(sin));
+ if (rc < 0) {
+ rc = -errno;
+ close(rtp_fd);
+ return rc;
+ }
+
+ /* now do RTCP */
+ rc = socket(AF_INET, SOCK_DGRAM, 0);
+ if (rc < 0) {
+ rc = -errno;
+ close(rtp_fd);
+ return rc;
+ }
+ rtcp_fd = rc;
+ sin.sin_port = htons(port + 1);
+ rc = bind(rtcp_fd, (struct sockaddr *) &sin, sizeof(sin));
+ if (rc < 0) {
+ rc = -errno;
+ close(rtp_fd);
+ close(rtcp_fd);
+ return rc;
+ }
+
+ return osmo_twrtp_supply_fds(endp, rtp_fd, rtcp_fd);
+}
+
+int osmo_twrtp_bind_local_ipv6(struct osmo_twrtp *endp,
+ const struct in6_addr *ip6, uint16_t port)
+{
+ int rtp_fd, rtcp_fd;
+ struct sockaddr_in6 sin6;
+ int rc;
+
+ sin6.sin6_family = AF_INET6;
+ memcpy(&sin6.sin6_addr, ip6, sizeof(struct in6_addr));
+
+ /* do RTP socket first */
+ rc = socket(AF_INET6, SOCK_DGRAM, 0);
+ if (rc < 0)
+ return -errno;
+ rtp_fd = rc;
+ sin6.sin6_port = htons(port);
+ rc = bind(rtp_fd, (struct sockaddr *) &sin6, sizeof(sin6));
+ if (rc < 0) {
+ rc = -errno;
+ close(rtp_fd);
+ return rc;
+ }
+
+ /* now do RTCP */
+ rc = socket(AF_INET6, SOCK_DGRAM, 0);
+ if (rc < 0) {
+ rc = -errno;
+ close(rtp_fd);
+ return rc;
+ }
+ rtcp_fd = rc;
+ sin6.sin6_port = htons(port + 1);
+ rc = bind(rtcp_fd, (struct sockaddr *) &sin6, sizeof(sin6));
+ if (rc < 0) {
+ rc = -errno;
+ close(rtp_fd);
+ close(rtcp_fd);
+ return rc;
+ }
+
+ return osmo_twrtp_supply_fds(endp, rtp_fd, rtcp_fd);
+}
+
+int osmo_twrtp_bind_local_sin(struct osmo_twrtp *endp,
+ const struct sockaddr_in *sin)
+{
+ return osmo_twrtp_bind_local_ipv4(endp, &sin->sin_addr,
+ ntohs(sin->sin_port));
+}
+
+int osmo_twrtp_bind_local_sin6(struct osmo_twrtp *endp,
+ const struct sockaddr_in6 *sin6)
+{
+ return osmo_twrtp_bind_local_ipv6(endp, &sin6->sin6_addr,
+ ntohs(sin6->sin6_port));
+}
diff --git a/src/twrtp_misc.c b/src/twrtp_misc.c
new file mode 100644
index 0000000..0526c4a
--- /dev/null
+++ b/src/twrtp_misc.c
@@ -0,0 +1,73 @@
+/*
+ * Themyscira Wireless RTP endpoint implementation: miscellaneous
+ * functions that don't belong anywhere else.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include <osmocom/core/osmo_io.h>
+#include <osmocom/core/socket.h>
+
+#include <osmocom/netif/twrtp.h>
+#include <osmocom/netif/twrtp_private.h>
+
+const struct osmo_twrtp_stats *osmo_twrtp_get_stats(struct osmo_twrtp *endp)
+{
+ return &endp->stats;
+}
+
+bool osmo_twrtp_got_rtcp_rr(struct osmo_twrtp *endp)
+{
+ return endp->rtcp_rx.got_rr;
+}
+
+uint32_t osmo_twrtp_rr_lost_word(struct osmo_twrtp *endp)
+{
+ return endp->rtcp_rx.rr_lost_word;
+}
+
+int32_t osmo_twrtp_rr_lost_cumulative(struct osmo_twrtp *endp)
+{
+ int32_t lost_count;
+
+ lost_count = endp->rtcp_rx.rr_lost_word & 0xFFFFFF;
+ if (lost_count & 0x800000)
+ lost_count |= 0xFF000000;
+ return lost_count;
+}
+
+uint32_t osmo_twrtp_rr_jitter_last(struct osmo_twrtp *endp)
+{
+ return endp->rtcp_rx.rr_jitter;
+}
+
+uint32_t osmo_twrtp_rr_jitter_max(struct osmo_twrtp *endp)
+{
+ return endp->rtcp_rx.rr_jitter_max;
+}
+
+int osmo_twrtp_set_dscp(struct osmo_twrtp *endp, uint8_t dscp)
+{
+ int rc;
+
+ rc = osmo_sock_set_dscp(osmo_iofd_get_fd(endp->iofd_rtp), dscp);
+ if (rc < 0)
+ return rc;
+ return osmo_sock_set_dscp(osmo_iofd_get_fd(endp->iofd_rtcp), dscp);
+}
+
+int osmo_twrtp_set_socket_prio(struct osmo_twrtp *endp, int prio)
+{
+ int rc;
+
+ rc = osmo_sock_set_priority(osmo_iofd_get_fd(endp->iofd_rtp), prio);
+ if (rc < 0)
+ return rc;
+ return osmo_sock_set_priority(osmo_iofd_get_fd(endp->iofd_rtcp), prio);
+}
diff --git a/src/twrtp_remote.c b/src/twrtp_remote.c
new file mode 100644
index 0000000..75e85da
--- /dev/null
+++ b/src/twrtp_remote.c
@@ -0,0 +1,62 @@
+/*
+ * Themyscira Wireless RTP endpoint implementation: different ways
+ * of setting the address of the remote RTP peer.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include <osmocom/netif/twrtp.h>
+#include <osmocom/netif/twrtp_private.h>
+
+void osmo_twrtp_set_remote_ipv4(struct osmo_twrtp *endp,
+ const struct in_addr *ip, uint16_t port)
+{
+ endp->rtp_remote.u.sin.sin_family = AF_INET;
+ memcpy(&endp->rtp_remote.u.sin.sin_addr, ip, sizeof(struct in_addr));
+ endp->rtp_remote.u.sin.sin_port = htons(port);
+
+ endp->rtcp_remote.u.sin.sin_family = AF_INET;
+ memcpy(&endp->rtcp_remote.u.sin.sin_addr, ip, sizeof(struct in_addr));
+ endp->rtcp_remote.u.sin.sin_port = htons(port + 1);
+
+ endp->remote_set = true;
+}
+
+void osmo_twrtp_set_remote_ipv6(struct osmo_twrtp *endp,
+ const struct in6_addr *ip6, uint16_t port)
+{
+ endp->rtp_remote.u.sin6.sin6_family = AF_INET6;
+ memcpy(&endp->rtp_remote.u.sin6.sin6_addr, ip6,
+ sizeof(struct in6_addr));
+ endp->rtp_remote.u.sin6.sin6_port = htons(port);
+
+ endp->rtcp_remote.u.sin6.sin6_family = AF_INET6;
+ memcpy(&endp->rtcp_remote.u.sin6.sin6_addr, ip6,
+ sizeof(struct in6_addr));
+ endp->rtcp_remote.u.sin6.sin6_port = htons(port + 1);
+
+ endp->remote_set = true;
+}
+
+void osmo_twrtp_set_remote_sin(struct osmo_twrtp *endp,
+ const struct sockaddr_in *sin)
+{
+ osmo_twrtp_set_remote_ipv4(endp, &sin->sin_addr, ntohs(sin->sin_port));
+}
+
+void osmo_twrtp_set_remote_sin6(struct osmo_twrtp *endp,
+ const struct sockaddr_in6 *sin6)
+{
+ osmo_twrtp_set_remote_ipv6(endp, &sin6->sin6_addr,
+ ntohs(sin6->sin6_port));
+}
diff --git a/src/twrtp_rtcp_rx.c b/src/twrtp_rtcp_rx.c
new file mode 100644
index 0000000..d4b01ad
--- /dev/null
+++ b/src/twrtp_rtcp_rx.c
@@ -0,0 +1,98 @@
+/*
+ * Themyscira Wireless RTP endpoint implementation: RTCP Rx path
+ * via osmo_io callback.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <arpa/inet.h> /* for network byte order functions */
+
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/osmo_io.h>
+#include <osmocom/core/socket.h>
+#include <osmocom/core/timer.h>
+
+#include <osmocom/netif/twrtp.h>
+#include <osmocom/netif/twrtp_private.h>
+#include <osmocom/netif/rtcp_defs.h>
+
+static void parse_rtcp(struct osmo_twrtp *endp, struct msgb *msg)
+{
+ struct twrtp_endp_rtcp_rx *rxs = &endp->rtcp_rx;
+ struct rtcp_sr_rr_hdr *base_hdr;
+ struct rtcp_sr_block *sr;
+ struct rtcp_rr_block *rr;
+ unsigned rc, i;
+
+ if (msg->len < sizeof(struct rtcp_sr_rr_hdr)) {
+invalid: endp->stats.rx_rtcp_invalid++;
+ return;
+ }
+ base_hdr = (struct rtcp_sr_rr_hdr *) msg->data;
+ msgb_pull(msg, sizeof(struct rtcp_sr_rr_hdr));
+ if ((base_hdr->v_p_rc & 0xC0) != 0x80)
+ goto invalid;
+ switch (base_hdr->pt) {
+ case RTCP_PT_SR:
+ if (msg->len < sizeof(struct rtcp_sr_block))
+ goto invalid;
+ sr = (struct rtcp_sr_block *) msg->data;
+ msgb_pull(msg, sizeof(struct rtcp_sr_block));
+ rxs->got_sr = true;
+ osmo_clock_gettime(CLOCK_MONOTONIC, &rxs->sr_rx_time);
+ rxs->sr_ssrc = ntohl(base_hdr->ssrc);
+ rxs->sr_ntp_sec = ntohl(sr->ntp_sec);
+ rxs->sr_ntp_fract = ntohl(sr->ntp_fract) >> 16;
+ break;
+ case RTCP_PT_RR:
+ break;
+ default:
+ goto invalid;
+ }
+ rc = base_hdr->v_p_rc & 0x1F;
+ if (msg->len < sizeof(struct rtcp_rr_block) * rc)
+ goto invalid;
+ for (i = 0; i < rc; i++) {
+ rr = (struct rtcp_rr_block *) msg->data;
+ msgb_pull(msg, sizeof(struct rtcp_rr_block));
+ if (ntohl(rr->ssrc) != endp->tx.ssrc) {
+ endp->stats.rx_rtcp_wrong_ssrc++;
+ continue;
+ }
+ rxs->got_rr = true;
+ rxs->rr_lost_word = ntohl(rr->lost_word);
+ rxs->rr_jitter = ntohl(rr->jitter);
+ if (rxs->rr_jitter > rxs->rr_jitter_max)
+ rxs->rr_jitter_max = rxs->rr_jitter;
+ }
+}
+
+static void rtcp_rx_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg,
+ const struct osmo_sockaddr *saddr)
+{
+ struct osmo_twrtp *endp = osmo_iofd_get_data(iofd);
+
+ if (!msg)
+ return;
+ if (!endp->remote_set) {
+ msgb_free(msg);
+ return;
+ }
+ if (osmo_sockaddr_cmp(saddr, &endp->rtcp_remote)) {
+ endp->stats.rx_rtcp_badsrc++;
+ msgb_free(msg);
+ return;
+ }
+ endp->stats.rx_rtcp_pkt++;
+ parse_rtcp(endp, msg);
+ msgb_free(msg);
+}
+
+const struct osmo_io_ops _osmo_twrtp_iops_rtcp = {
+ .recvfrom_cb = rtcp_rx_cb,
+};
diff --git a/src/twrtp_rtcp_tx.c b/src/twrtp_rtcp_tx.c
new file mode 100644
index 0000000..360314a
--- /dev/null
+++ b/src/twrtp_rtcp_tx.c
@@ -0,0 +1,240 @@
+/*
+ * Themyscira Wireless RTP endpoint implementation: RTCP Tx functionality.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include <errno.h>
+#include <arpa/inet.h> /* for network byte order functions */
+
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/osmo_io.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/timer.h>
+
+#include <osmocom/netif/twrtp.h>
+#include <osmocom/netif/twrtp_private.h>
+#include <osmocom/netif/twjit.h>
+#include <osmocom/netif/rtcp_defs.h>
+
+#define NTP_EPOCH_MJD 15020
+#define UNIX_EPOCH_MJD 40587
+
+#define NTP_UNIX_EPOCH_DIFF ((UNIX_EPOCH_MJD-NTP_EPOCH_MJD) * 86400UL)
+#define TWO_TO_32_DOUBLE 4294967296.0
+
+static void fill_rr_block(struct osmo_twrtp *endp, struct rtcp_rr_block *rr)
+{
+ struct osmo_twjit *twjit = endp->twjit;
+ const struct osmo_twjit_rr_info *rri = osmo_twjit_get_rr_info(twjit);
+ const struct twrtp_endp_rtcp_rx *rxs = &endp->rtcp_rx;
+ struct twrtp_endp_rtcp_tx *txs = &endp->rtcp_tx;
+ uint32_t delta_expect, delta_rcvd;
+ int32_t cumulative_lost, newly_lost;
+ uint32_t lost_fract, lost_word;
+ struct timespec now, time_delta;
+
+ cumulative_lost = (int32_t)(rri->expected_pkt - rri->rx_packets);
+ if (cumulative_lost > 0x7FFFFF)
+ cumulative_lost = 0x7FFFFF;
+ else if (cumulative_lost < -0x800000)
+ cumulative_lost = -0x800000;
+ delta_expect = rri->expected_pkt - txs->last_expected;
+ txs->last_expected = rri->expected_pkt;
+ delta_rcvd = rri->rx_packets - txs->last_received;
+ txs->last_received = rri->rx_packets;
+ newly_lost = (int32_t)(delta_expect - delta_rcvd);
+ if (delta_expect == 0 || newly_lost <= 0)
+ lost_fract = 0;
+ else
+ lost_fract = (newly_lost << 8) / delta_expect;
+ lost_word = (lost_fract << 8) | (cumulative_lost & 0xFFFFFF);
+
+ rr->ssrc = htonl(rri->ssrc);
+ rr->lost_word = htonl(lost_word);
+ rr->max_seq_ext = htonl(rri->max_seq_ext);
+ rr->jitter = htonl(rri->jitter_accum >> 4);
+
+ if (rxs->got_sr && rxs->sr_ssrc == rri->ssrc) {
+ osmo_clock_gettime(CLOCK_MONOTONIC, &now);
+ time_delta.tv_sec = now.tv_sec - rxs->sr_rx_time.tv_sec;
+ time_delta.tv_nsec = now.tv_nsec - rxs->sr_rx_time.tv_nsec;
+ if (time_delta.tv_nsec < 0) {
+ time_delta.tv_sec--;
+ time_delta.tv_nsec += 1000000000;
+ }
+ rr->lsr_sec = htons(rxs->sr_ntp_sec);
+ rr->lsr_fract = htons(rxs->sr_ntp_fract);
+ rr->dlsr_sec = htons(time_delta.tv_sec);
+ rr->dlsr_fract = htons(time_delta.tv_nsec / 1000000000.0f *
+ 65536.0f);
+ } else {
+ rr->lsr_sec = 0;
+ rr->lsr_fract = 0;
+ rr->dlsr_sec = 0;
+ rr->dlsr_fract = 0;
+ }
+}
+
+int _osmo_twrtp_send_rtcp(struct osmo_twrtp *endp, bool send_sr,
+ const struct timespec *utc, uint32_t rtp_ts)
+{
+ bool send_rr = false;
+ struct msgb *msg;
+ struct rtcp_sr_rr_hdr *hdr;
+ struct rtcp_sr_block *sr;
+ struct rtcp_rr_block *rr;
+ uint8_t *sdes_out;
+ int rc;
+
+ if (!endp->register_done || !endp->remote_set || !endp->sdes_buf)
+ return -EINVAL;
+ if (endp->twjit && osmo_twjit_got_any_input(endp->twjit))
+ send_rr = true;
+ if (!send_sr && !send_rr)
+ return -ENODATA; /* nothing to send, neither SR nor RR */
+ msg = msgb_alloc_c(endp, sizeof(struct rtcp_sr_rr_hdr) +
+ sizeof(struct rtcp_sr_block) +
+ sizeof(struct rtcp_rr_block) + endp->sdes_len,
+ "ThemWi-RTCP-Tx");
+ if (!msg)
+ return -ENOMEM;
+
+ hdr = (struct rtcp_sr_rr_hdr *)
+ msgb_put(msg, sizeof(struct rtcp_sr_rr_hdr));
+ hdr->v_p_rc = send_rr ? 0x81 : 0x80;
+ if (send_sr) {
+ hdr->pt = RTCP_PT_SR;
+ hdr->len = htons(send_rr ? 12 : 6);
+ } else {
+ hdr->pt = RTCP_PT_RR;
+ hdr->len = htons(7);
+ }
+ hdr->ssrc = htonl(endp->tx.ssrc);
+ if (send_sr) {
+ sr = (struct rtcp_sr_block *)
+ msgb_put(msg, sizeof(struct rtcp_sr_block));
+ sr->ntp_sec = htonl(utc->tv_sec + NTP_UNIX_EPOCH_DIFF);
+ sr->ntp_fract = htonl(utc->tv_nsec / 1000000000.0 *
+ TWO_TO_32_DOUBLE);
+ sr->rtp_ts = htonl(rtp_ts);
+ sr->pkt_count = htonl(endp->stats.tx_rtp_pkt);
+ sr->octet_count = htonl(endp->stats.tx_rtp_bytes);
+ }
+ if (send_rr) {
+ rr = (struct rtcp_rr_block *)
+ msgb_put(msg, sizeof(struct rtcp_rr_block));
+ fill_rr_block(endp, rr);
+ }
+ sdes_out = msgb_put(msg, endp->sdes_len);
+ memcpy(sdes_out, endp->sdes_buf, endp->sdes_len);
+
+ rc = osmo_iofd_sendto_msgb(endp->iofd_rtcp, msg, 0, &endp->rtcp_remote);
+ if (rc < 0) {
+ msgb_free(msg);
+ return rc;
+ }
+ endp->stats.tx_rtcp_pkt++;
+ return 0;
+}
+
+int osmo_twrtp_send_rtcp_rr(struct osmo_twrtp *endp)
+{
+ return _osmo_twrtp_send_rtcp(endp, false, NULL, 0);
+}
+
+void osmo_twrtp_set_auto_rtcp_interval(struct osmo_twrtp *endp,
+ uint16_t interval)
+{
+ endp->auto_rtcp_interval = interval;
+}
+
+int osmo_twrtp_set_sdes(struct osmo_twrtp *endp, const char *cname,
+ const char *name, const char *email, const char *phone,
+ const char *loc, const char *tool, const char *note)
+{
+ uint16_t len_str, len_padded, len_with_hdr, len;
+ struct rtcp_sr_rr_hdr *hdr;
+ uint8_t *dp;
+
+ if (!cname)
+ return -EINVAL;
+ len_str = strlen(cname) + 2;
+ if (name)
+ len_str += strlen(name) + 2;
+ if (email)
+ len_str += strlen(email) + 2;
+ if (phone)
+ len_str += strlen(phone) + 2;
+ if (loc)
+ len_str += strlen(loc) + 2;
+ if (tool)
+ len_str += strlen(tool) + 2;
+ if (note)
+ len_str += strlen(note) + 2;
+ len_padded = (len_str + 4) & ~3;
+ len_with_hdr = len_padded + sizeof(struct rtcp_sr_rr_hdr);
+
+ if (endp->sdes_buf)
+ talloc_free(endp->sdes_buf);
+ endp->sdes_buf = talloc_size(endp, len_with_hdr);
+ if (!endp->sdes_buf)
+ return -ENOMEM;
+
+ hdr = (struct rtcp_sr_rr_hdr *) endp->sdes_buf;
+ hdr->v_p_rc = 0x81;
+ hdr->pt = RTCP_PT_SDES;
+ hdr->len = htons(len_with_hdr / 4 - 1);
+ hdr->ssrc = htonl(endp->tx.ssrc);
+ dp = endp->sdes_buf + sizeof(struct rtcp_sr_rr_hdr);
+ *dp++ = SDES_ITEM_CNAME;
+ *dp++ = len = strlen(cname);
+ memcpy(dp, cname, len);
+ dp += len;
+ if (name) {
+ *dp++ = SDES_ITEM_NAME;
+ *dp++ = len = strlen(name);
+ memcpy(dp, name, len);
+ dp += len;
+ }
+ if (email) {
+ *dp++ = SDES_ITEM_EMAIL;
+ *dp++ = len = strlen(email);
+ memcpy(dp, email, len);
+ dp += len;
+ }
+ if (phone) {
+ *dp++ = SDES_ITEM_PHONE;
+ *dp++ = len = strlen(phone);
+ memcpy(dp, phone, len);
+ dp += len;
+ }
+ if (loc) {
+ *dp++ = SDES_ITEM_LOC;
+ *dp++ = len = strlen(loc);
+ memcpy(dp, loc, len);
+ dp += len;
+ }
+ if (tool) {
+ *dp++ = SDES_ITEM_TOOL;
+ *dp++ = len = strlen(tool);
+ memcpy(dp, tool, len);
+ dp += len;
+ }
+ if (note) {
+ *dp++ = SDES_ITEM_NOTE;
+ *dp++ = len = strlen(note);
+ memcpy(dp, note, len);
+ dp += len;
+ }
+ memset(dp, 0, len_padded - len_str);
+
+ endp->sdes_len = len_with_hdr;
+ return 0;
+}
diff --git a/src/twrtp_rtp_rx.c b/src/twrtp_rtp_rx.c
new file mode 100644
index 0000000..69db583
--- /dev/null
+++ b/src/twrtp_rtp_rx.c
@@ -0,0 +1,57 @@
+/*
+ * Themyscira Wireless RTP endpoint implementation: RTP Rx path
+ * via osmo_io callback.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/osmo_io.h>
+#include <osmocom/core/socket.h>
+#include <osmocom/core/utils.h>
+
+#include <osmocom/netif/twrtp.h>
+#include <osmocom/netif/twrtp_private.h>
+#include <osmocom/netif/twjit.h>
+
+static void rtp_rx_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg,
+ const struct osmo_sockaddr *saddr)
+{
+ struct osmo_twrtp *endp = osmo_iofd_get_data(iofd);
+
+ if (!msg)
+ return;
+ if (!endp->remote_set) {
+ msgb_free(msg);
+ return;
+ }
+ if (osmo_sockaddr_cmp(saddr, &endp->rtp_remote)) {
+ endp->stats.rx_rtp_badsrc++;
+ msgb_free(msg);
+ return;
+ }
+ endp->stats.rx_rtp_pkt++;
+ if (endp->twjit_rx_enable)
+ osmo_twjit_input(endp->twjit, msg);
+ else if (endp->raw_rx_cb)
+ endp->raw_rx_cb(endp, endp->raw_rx_cb_data, msg);
+ else
+ msgb_free(msg);
+}
+
+const struct osmo_io_ops _osmo_twrtp_iops_rtp = {
+ .recvfrom_cb = rtp_rx_cb,
+};
+
+void osmo_twrtp_set_raw_rx_cb(struct osmo_twrtp *endp, osmo_twrtp_raw_rx_cb cb,
+ void *user_data)
+{
+ endp->raw_rx_cb = cb;
+ endp->raw_rx_cb_data = user_data;
+}
diff --git a/src/twrtp_rtp_tx.c b/src/twrtp_rtp_tx.c
new file mode 100644
index 0000000..410781f
--- /dev/null
+++ b/src/twrtp_rtp_tx.c
@@ -0,0 +1,132 @@
+/*
+ * Themyscira Wireless RTP endpoint implementation: RTP Tx functionality.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include <errno.h>
+#include <arpa/inet.h> /* for network byte order functions */
+
+#include <osmocom/core/msgb.h>
+#include <osmocom/core/osmo_io.h>
+#include <osmocom/core/timer.h>
+
+#include <osmocom/netif/twrtp.h>
+#include <osmocom/netif/twrtp_private.h>
+#include <osmocom/netif/rtp.h>
+
+static uint32_t gen_timestamp(struct timespec *now, struct osmo_twrtp *endp)
+{
+ uint32_t ts;
+
+ ts = now->tv_sec * endp->ts_units_per_sec +
+ now->tv_nsec / endp->ns_to_ts_units;
+ ts += endp->tx.ts_addend;
+ return ts;
+}
+
+int osmo_twrtp_tx_quantum(struct osmo_twrtp *endp, const uint8_t *payload,
+ unsigned payload_len, uint8_t payload_type,
+ bool marker, bool auto_marker, bool send_rtcp)
+{
+ struct msgb *msg;
+ struct timespec now;
+ uint32_t restart_ts;
+ int32_t ts_delta;
+ struct rtp_hdr *rtph;
+ uint8_t *pl_out;
+ int rc;
+
+ if (!endp->register_done || !endp->remote_set)
+ return -EINVAL;
+ msg = msgb_alloc_c(endp, sizeof(struct rtp_hdr) + payload_len,
+ "ThemWi-RTP-Tx");
+ if (!msg) {
+ osmo_twrtp_tx_skip(endp);
+ return -ENOMEM;
+ }
+
+ /* timestamp generation is where we do some trickery */
+ osmo_clock_gettime(CLOCK_REALTIME, &now);
+ if (!endp->tx.started) {
+ endp->tx.ts = gen_timestamp(&now, endp);
+ endp->tx.started = true;
+ endp->tx.restart = false;
+ if (auto_marker)
+ marker = true;
+ } else if (endp->tx.restart) {
+ restart_ts = gen_timestamp(&now, endp);
+ ts_delta = (int32_t)(restart_ts - endp->tx.ts);
+ if (ts_delta <= 0) {
+ /* shouldn't happen, unless something funky w/clock */
+ endp->tx.ts++;
+ } else {
+ if (ts_delta % endp->ts_quantum == 0)
+ restart_ts++;
+ endp->tx.ts = restart_ts;
+ }
+ endp->tx.restart = false;
+ if (auto_marker)
+ marker = true;
+ }
+
+ rtph = (struct rtp_hdr *) msgb_put(msg, sizeof(struct rtp_hdr));
+ rtph->version = RTP_VERSION;
+ rtph->padding = 0;
+ rtph->extension = 0;
+ rtph->csrc_count = 0;
+ rtph->marker = marker;
+ rtph->payload_type = payload_type;
+ rtph->sequence = htons(endp->tx.seq);
+ rtph->timestamp = htonl(endp->tx.ts);
+ rtph->ssrc = htonl(endp->tx.ssrc);
+ pl_out = msgb_put(msg, payload_len);
+ memcpy(pl_out, payload, payload_len);
+ endp->tx.seq++;
+ endp->tx.ts += endp->ts_quantum;
+
+ rc = osmo_iofd_sendto_msgb(endp->iofd_rtp, msg, 0, &endp->rtp_remote);
+ if (rc < 0) {
+ msgb_free(msg);
+ return rc;
+ }
+ endp->stats.tx_rtp_pkt++;
+ endp->stats.tx_rtp_bytes += payload_len;
+
+ if (endp->auto_rtcp_interval) {
+ endp->auto_rtcp_count++;
+ if (endp->auto_rtcp_count >= endp->auto_rtcp_interval) {
+ endp->auto_rtcp_count = 0;
+ send_rtcp = true;
+ }
+ }
+ if (send_rtcp) {
+ _osmo_twrtp_send_rtcp(endp, true, &now,
+ endp->tx.ts - endp->ts_quantum);
+ }
+
+ return 0;
+}
+
+void osmo_twrtp_tx_skip(struct osmo_twrtp *endp)
+{
+ if (!endp->tx.started || endp->tx.restart)
+ return;
+ endp->tx.ts += endp->ts_quantum;
+}
+
+void osmo_twrtp_tx_restart(struct osmo_twrtp *endp)
+{
+ endp->tx.restart = true;
+}
+
+int osmo_twrtp_tx_forward(struct osmo_twrtp *endp, struct msgb *msg)
+{
+ return osmo_iofd_sendto_msgb(endp->iofd_rtp, msg, 0, &endp->rtp_remote);
+}
diff --git a/src/twrtp_twjit.c b/src/twrtp_twjit.c
new file mode 100644
index 0000000..3ae5b00
--- /dev/null
+++ b/src/twrtp_twjit.c
@@ -0,0 +1,58 @@
+/*
+ * Themyscira Wireless RTP endpoint implementation: interface to twjit
+ * layer below. Use of twjit is optional in the strict sense, but it
+ * is used most of the time.
+ *
+ * This code was contributed to Osmocom Cellular Network Infrastructure
+ * project by Mother Mychaela N. Falconia of Themyscira Wireless.
+ * Mother Mychaela's contributions are NOT subject to copyright:
+ * no rights reserved, all rights relinquished.
+ */
+
+#include <stdbool.h>
+#include <osmocom/core/utils.h>
+
+#include <osmocom/netif/twrtp.h>
+#include <osmocom/netif/twrtp_private.h>
+#include <osmocom/netif/twjit.h>
+
+void osmo_twrtp_twjit_rx_enable(struct osmo_twrtp *endp)
+{
+ OSMO_ASSERT(endp->twjit);
+ endp->twjit_rx_enable = true;
+}
+
+void osmo_twrtp_twjit_rx_disable(struct osmo_twrtp *endp)
+{
+ OSMO_ASSERT(endp->twjit);
+ endp->twjit_rx_enable = false;
+ osmo_twjit_reset(endp->twjit);
+}
+
+struct msgb *osmo_twrtp_twjit_rx_poll(struct osmo_twrtp *endp)
+{
+ return osmo_twjit_output(endp->twjit);
+}
+
+void osmo_twrtp_new_twjit_config(struct osmo_twrtp *endp,
+ const struct osmo_twjit_config *config)
+{
+ osmo_twjit_new_config(endp->twjit, config);
+}
+
+const struct osmo_twjit_stats *
+osmo_twrtp_get_twjit_stats(struct osmo_twrtp *endp)
+{
+ return osmo_twjit_get_stats(endp->twjit);
+}
+
+const struct osmo_twjit_rr_info *
+osmo_twrtp_get_twjit_rr_info(struct osmo_twrtp *endp)
+{
+ return osmo_twjit_get_rr_info(endp->twjit);
+}
+
+bool osmo_twrtp_twjit_got_input(struct osmo_twrtp *endp)
+{
+ return osmo_twjit_got_any_input(endp->twjit);
+}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/39281?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: Ib63215aaf13ef8ab8f2e0c8d310164cd5c8824eb
Gerrit-Change-Number: 39281
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
1
0
[S] Change in libosmocore[master]: osmo_iofd_register: fix the case of changing fd
by falconia 10 Jan '25
by falconia 10 Jan '25
10 Jan '25
Attention is currently required from: pespin.
falconia has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmocore/+/39276?usp=email )
Change subject: osmo_iofd_register: fix the case of changing fd
......................................................................
Patch Set 2:
(1 comment)
File src/core/osmo_io.c:
https://gerrit.osmocom.org/c/libosmocore/+/39276/comment/42fc86fb_945358ce?… :
PS2, Line 759: if (fd >= 0)
> I think you don't even need this "if" line, you can do "iofd->fd = fd;" directly.
No, the conditional is still needed. Users are allowed to set fd earlier and pass -1 to `osmo_iofd_register()`; removing the `if` like you propose would break that case.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/39276?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: If8b8486ad7934afa203dfe1e996c9217373a017b
Gerrit-Change-Number: 39276
Gerrit-PatchSet: 2
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 10 Jan 2025 02:26:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
1
0
[S] Change in osmo-bsc[master]: nokia_site: change RSL bootstrap logic
by Jenkins Builder 10 Jan '25
by Jenkins Builder 10 Jan '25
10 Jan '25
Jenkins Builder has posted comments on this change by csaba.sipos. ( https://gerrit.osmocom.org/c/osmo-bsc/+/39277?usp=email )
Change subject: nokia_site: change RSL bootstrap logic
......................................................................
Patch Set 1:
(27 comments)
File src/osmo-bsc/bts_nokia_site.c:
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/e16fdbc0_3c577e5c?usp… :
PS1, Line 1742: if (bts->nokia.configured != 0) {
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/0f262026_179d0423?usp… :
PS1, Line 1742: if (bts->nokia.configured != 0) {
please, no spaces at the start of a line
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/d272f23a_b5248b09?usp… :
PS1, Line 1743: /* start TRX (RSL link) */
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/5f33749b_539f6eca?usp… :
PS1, Line 1745: struct gsm_e1_subslot *e1_link =
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/e97d0d6f_d37281a6?usp… :
PS1, Line 1745: struct gsm_e1_subslot *e1_link =
please, no spaces at the start of a line
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/60cff783_76c15f65?usp… :
PS1, Line 1746: &sign_link->trx->rsl_e1_link;
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/c432aa5e_a78f9704?usp… :
PS1, Line 1746: &sign_link->trx->rsl_e1_link;
please, no spaces at the start of a line
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/41637b11_a2c21f3e?usp… :
PS1, Line 1747: struct e1inp_line *line;
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/ac3188dc_c4355e03?usp… :
PS1, Line 1747: struct e1inp_line *line;
please, no spaces at the start of a line
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/706abc0e_3682a957?usp… :
PS1, Line 1749: bts->nokia.configured = 0;
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/68b492ea_612e4295?usp… :
PS1, Line 1749: bts->nokia.configured = 0;
please, no spaces at the start of a line
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/c65637b8_d8476ee7?usp… :
PS1, Line 1751: /* RSL Link */
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/de9780ef_f9924786?usp… :
PS1, Line 1752: line = e1inp_line_find(e1_link->e1_nr);
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/9397c001_6946c948?usp… :
PS1, Line 1752: line = e1inp_line_find(e1_link->e1_nr);
please, no spaces at the start of a line
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/9832029c_1d92b964?usp… :
PS1, Line 1753: if (!line) {
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/136ddd69_d45ab1e1?usp… :
PS1, Line 1753: if (!line) {
please, no spaces at the start of a line
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/fc91a355_53a74af4?usp… :
PS1, Line 1754: LOG_BTS(bts, DLINP, LOGL_ERROR, "RSL link referring to "
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/d4dde760_6aa27625?usp… :
PS1, Line 1754: LOG_BTS(bts, DLINP, LOGL_ERROR, "RSL link referring to "
please, no spaces at the start of a line
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/fdb586c1_c712dc54?usp… :
PS1, Line 1755: "non-existing E1 line %u\n", e1_link->e1_nr);
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/cf206b7e_cfde6655?usp… :
PS1, Line 1755: "non-existing E1 line %u\n", e1_link->e1_nr);
please, no spaces at the start of a line
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/4339f9f7_d45dc657?usp… :
PS1, Line 1756: return -ENOMEM;
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/50aa6a9b_38468f71?usp… :
PS1, Line 1756: return -ENOMEM;
please, no spaces at the start of a line
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/b5ef161a_daafc0eb?usp… :
PS1, Line 1757: }
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/127994f1_181449d6?usp… :
PS1, Line 1757: }
please, no spaces at the start of a line
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/0069ed79_97a361d9?usp… :
PS1, Line 1758: /* start TRX */
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/9ac72d58_807d6d39?usp… :
PS1, Line 1759: start_sabm_in_line(line, 1, SAPI_RSL); /* start only RSL */
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-20843):
https://gerrit.osmocom.org/c/osmo-bsc/+/39277/comment/2f2d4b86_0f697270?usp… :
PS1, Line 1759: start_sabm_in_line(line, 1, SAPI_RSL); /* start only RSL */
please, no spaces at the start of a line
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/39277?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7319a64f069d239a582547bc422058ff5848d2e2
Gerrit-Change-Number: 39277
Gerrit-PatchSet: 1
Gerrit-Owner: csaba.sipos <metro4(a)freemail.hu>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Fri, 10 Jan 2025 00:31:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
1
0
10 Jan '25
csaba.sipos has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/39277?usp=email )
Change subject: nokia_site: change RSL bootstrap logic
......................................................................
nokia_site: change RSL bootstrap logic
Wait for BTS_CONF_COMPL and start RSL bootstrap after.
This way the TRX SW load has enough time to complete and the RSL LAPD becomes available.
Important for MetroSite, UltraSite BTS types.
Change-Id: I7319a64f069d239a582547bc422058ff5848d2e2
Signed-off-by: csaba.sipos <metro4(a)freemail.hu>
---
M src/osmo-bsc/bts_nokia_site.c
1 file changed, 19 insertions(+), 21 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/77/39277/1
diff --git a/src/osmo-bsc/bts_nokia_site.c b/src/osmo-bsc/bts_nokia_site.c
index 688a8a4..dd4c89a 100644
--- a/src/osmo-bsc/bts_nokia_site.c
+++ b/src/osmo-bsc/bts_nokia_site.c
@@ -1731,27 +1731,6 @@
osmo_timer_setup(&bts->nokia.reset_timer, reset_timer_cb, bts);
osmo_timer_schedule(&bts->nokia.reset_timer, 0, 0);
}
-
- /* ACK for CONF DATA message ? */
- if (bts->nokia.configured != 0) {
- /* start TRX (RSL link) */
-
- struct gsm_e1_subslot *e1_link =
- &sign_link->trx->rsl_e1_link;
- struct e1inp_line *line;
-
- bts->nokia.configured = 0;
-
- /* RSL Link */
- line = e1inp_line_find(e1_link->e1_nr);
- if (!line) {
- LOG_BTS(bts, DLINP, LOGL_ERROR, "RSL link referring to "
- "non-existing E1 line %u\n", e1_link->e1_nr);
- return -ENOMEM;
- }
- /* start TRX */
- start_sabm_in_line(line, 1, SAPI_RSL); /* start only RSL */
- }
break;
case NOKIA_MSG_STATE_CHANGED:
/* send ACK */
@@ -1760,6 +1739,25 @@
case NOKIA_MSG_CONF_COMPLETE:
/* send ACK */
abis_nm_ack(bts, ref);
+ if (bts->nokia.configured != 0) {
+ /* start TRX (RSL link) */
+
+ struct gsm_e1_subslot *e1_link =
+ &sign_link->trx->rsl_e1_link;
+ struct e1inp_line *line;
+
+ bts->nokia.configured = 0;
+
+ /* RSL Link */
+ line = e1inp_line_find(e1_link->e1_nr);
+ if (!line) {
+ LOG_BTS(bts, DLINP, LOGL_ERROR, "RSL link referring to "
+ "non-existing E1 line %u\n", e1_link->e1_nr);
+ return -ENOMEM;
+ }
+ /* start TRX */
+ start_sabm_in_line(line, 1, SAPI_RSL); /* start only RSL */
+ }
/* fake 12.21 OM */
nokia_abis_nm_fake_1221_ok(bts);
break;
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/39277?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7319a64f069d239a582547bc422058ff5848d2e2
Gerrit-Change-Number: 39277
Gerrit-PatchSet: 1
Gerrit-Owner: csaba.sipos <metro4(a)freemail.hu>
1
0
[S] Change in libosmocore[master]: osmo_iofd_register: fix the case of changing fd
by pespin 09 Jan '25
by pespin 09 Jan '25
09 Jan '25
Attention is currently required from: falconia.
pespin has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmocore/+/39276?usp=email )
Change subject: osmo_iofd_register: fix the case of changing fd
......................................................................
Patch Set 2:
(1 comment)
File src/core/osmo_io.c:
https://gerrit.osmocom.org/c/libosmocore/+/39276/comment/50a159c5_588bb1d8?… :
PS1, Line 760: return iofd->fd == fd ? 0 : -ENOTSUP;
> See my other comment above.
Done
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/39276?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: If8b8486ad7934afa203dfe1e996c9217373a017b
Gerrit-Change-Number: 39276
Gerrit-PatchSet: 2
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Comment-Date: Thu, 09 Jan 2025 23:46:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: falconia <falcon(a)freecalypso.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
1
0
[S] Change in libosmocore[master]: osmo_iofd_register: fix the case of changing fd
by pespin 09 Jan '25
by pespin 09 Jan '25
09 Jan '25
Attention is currently required from: falconia.
pespin has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmocore/+/39276?usp=email )
Change subject: osmo_iofd_register: fix the case of changing fd
......................................................................
Patch Set 2:
(1 comment)
File src/core/osmo_io.c:
https://gerrit.osmocom.org/c/libosmocore/+/39276/comment/cb5f5c12_0433c467?… :
PS1, Line 756: else if (iofd->fd < 0)
> Please look at the new version of my patch. […]
Done
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/39276?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: If8b8486ad7934afa203dfe1e996c9217373a017b
Gerrit-Change-Number: 39276
Gerrit-PatchSet: 2
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: falconia <falcon(a)freecalypso.org>
Gerrit-Comment-Date: Thu, 09 Jan 2025 23:46:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: falconia <falcon(a)freecalypso.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
1
0