aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-12-24 14:18:39 +0100
committerlaforge <laforge@osmocom.org>2022-01-05 09:48:26 +0000
commitb204a4e322bcf4d236ca8dba099d4d7c65433239 (patch)
tree83b3e3992788b70595a666eae348c33bbe2bd124
parentaa9220aeacd8bb44d666fb107a08026691973bc3 (diff)
RTP IuUP Emulation: Avoid spamming with retransmitted Init
Until now, an Init was sent on each RTP transmit period, clogging the pcap files. Moreover, this is break by design, since transmitting another Init so close the the previous one would give no time to the transmitter to receive the Init ACk and move state, which means the other end would potentially be reconfigured each time (for each Init). Change-Id: I8e299a3fe49f9d31cae182f7ed4dc0ea3fc22ba2
-rw-r--r--library/IuUP_Emulation.ttcn9
-rw-r--r--library/RTP_Emulation.ttcn4
2 files changed, 11 insertions, 2 deletions
diff --git a/library/IuUP_Emulation.ttcn b/library/IuUP_Emulation.ttcn
index b35602ce..19c2c842 100644
--- a/library/IuUP_Emulation.ttcn
+++ b/library/IuUP_Emulation.ttcn
@@ -105,6 +105,7 @@ function f_IuUP_Em_rx_decaps(inout IuUP_Entity st, octetstring inp) return octet
} else if (match(pdu, tr_IuUP_INIT_ACK)) {
if (st.cfg.active_init == true) {
log("IuUP INIT_ACK Received");
+ st.pending_tx_pdu := omit; /* Drop pending Init retrans */
st.state := ST_DATA_TRANSFER_READY;
} else {
setverdict(fail, "INIT_ACK received in PASSIVE role");
@@ -124,8 +125,12 @@ function f_IuUP_Em_tx_encap(inout IuUP_Entity st, in octetstring payload) return
select (st.state) {
case (ST_INIT) {
if (st.cfg.active_init) {
- /* send INIT */
- pdu := valueof(ts_IuUP_INIT('160051673C01270000820000001710000100'O));
+ if (not isvalue(st.pending_tx_pdu)) {
+ /* send INIT */
+ pdu := valueof(ts_IuUP_INIT('160051673C01270000820000001710000100'O));
+ st.pending_tx_pdu := pdu;
+ } /* else: wait for INIT-ACK return ''O at the end */
+
} else {
/* wait for INIT */
if (isvalue(st.pending_tx_pdu)) {
diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn
index b2360dc5..bdca75da 100644
--- a/library/RTP_Emulation.ttcn
+++ b/library/RTP_Emulation.ttcn
@@ -345,6 +345,10 @@ template PDU_RTP ts_RTP(BIT32_BO_LAST ssrc, INT7b pt, LIN2_BO_LAST seq, uint32_t
private function f_tx_rtp(octetstring payload, BIT1 marker := '0'B) runs on RTP_Emulation_CT {
if (g_cfg.iuup_mode) {
payload := f_IuUP_Em_tx_encap(g_iuup_ent, payload);
+ if (lengthof(payload) == 0) {
+ /* Nothing to transmit, waiting for INIT-ACK */
+ return;
+ }
}
var PDU_RTP rtp := valueof(ts_RTP(g_cfg.tx_ssrc, g_cfg.tx_payload_type, g_tx_next_seq,
g_tx_next_ts, payload, marker));