Change in osmo-ttcn3-hacks[master]: RTP_Emulation: check received RTP packets

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Thu Feb 21 17:01:21 UTC 2019


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13000


Change subject: RTP_Emulation: check received RTP packets
......................................................................

RTP_Emulation: check received RTP packets

The configuration of the RTP Emulation (RtpemConfig) allows to set a
fixed RTP payload that is then used when RTP packets are transmitted.
However, when packets are received, then the payload is not checked.
Lets check the received data against some user configurable rx payload,
that is by default set to the tx payload.

Change-Id: Id0b125aaf915497d0a4f051af890fc34e09da61d
Related: OS#3807
---
M library/RTP_Emulation.ttcn
1 file changed, 14 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/00/13000/1

diff --git a/library/RTP_Emulation.ttcn b/library/RTP_Emulation.ttcn
index fcb158b..b8f0ce4 100644
--- a/library/RTP_Emulation.ttcn
+++ b/library/RTP_Emulation.ttcn
@@ -119,7 +119,9 @@
 	/* number of packets received wrong payload type */
 	integer num_pkts_rx_err_pt,
 	/* number of packets received during Rx disable */
-	integer num_pkts_rx_err_disabled
+	integer num_pkts_rx_err_disabled,
+	/* number of packets received with mismatching payload */
+	integer num_pkts_rx_err_payload
 }
 
 const RtpemStats c_RtpemStatsReset := {
@@ -130,7 +132,8 @@
 	num_pkts_rx_err_seq := 0,
 	num_pkts_rx_err_ts := 0,
 	num_pkts_rx_err_pt := 0,
-	num_pkts_rx_err_disabled := 0
+	num_pkts_rx_err_disabled := 0,
+	num_pkts_rx_err_payload := 0
 }
 
 type record RtpemConfig {
@@ -139,6 +142,7 @@
 	integer tx_duration_ms,
 	BIT32_BO_LAST tx_ssrc,
 	octetstring tx_fixed_payload optional,
+	octetstring rx_fixed_payload optional,
 	boolean iuup_mode,
 	boolean iuup_tx_init
 };
@@ -149,6 +153,7 @@
 	tx_duration_ms := 20,
 	tx_ssrc := '11011110101011011011111011101111'B,
 	tx_fixed_payload := '01020304'O,
+	rx_fixed_payload := '01020304'O,
 	iuup_mode := false,
 	iuup_tx_init := true
 }
@@ -276,6 +281,10 @@
 		setverdict(fail, "RTP packets received while RX was disabled");
 		mtc.stop;
 	}
+	if (s.num_pkts_rx_err_payload != 0) {
+		setverdict(fail, "RTP packets with mismatching payload received");
+		mtc.stop;
+	}
 }
 
 template PDU_RTP ts_RTP(BIT32_BO_LAST ssrc, INT7b pt, LIN2_BO_LAST seq, uint32_t ts,
@@ -437,8 +446,6 @@
 
 		/* process received RTCP/RTP if receiver enabled */
 		[g_rx_enabled] RTP.receive(tr_rtp) -> value rx_rtp {
-			//log("RX RTP: ", rx_rtp);
-
 			/* increment counters */
 			if (rx_rtp.msg.rtp.payload_type != g_cfg.tx_payload_type) {
 				g_stats_rtp.num_pkts_rx_err_pt := g_stats_rtp.num_pkts_rx_err_pt+1;
@@ -446,6 +453,9 @@
 			g_stats_rtp.num_pkts_rx := g_stats_rtp.num_pkts_rx+1;
 			g_stats_rtp.bytes_payload_rx := g_stats_rtp.bytes_payload_rx +
 								lengthof(rx_rtp.msg.rtp.data);
+			if (rx_rtp.msg.rtp.data != g_cfg.rx_fixed_payload) {
+				g_stats_rtp.num_pkts_rx_err_payload := g_stats_rtp.num_pkts_rx_err_payload + 1
+			}
 			if (g_cfg.iuup_mode) {
 				rx_rtp.msg.rtp.data := f_IuUP_Em_rx_decaps(g_iuup_ent, rx_rtp.msg.rtp.data);
 			}

-- 
To view, visit https://gerrit.osmocom.org/13000
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id0b125aaf915497d0a4f051af890fc34e09da61d
Gerrit-Change-Number: 13000
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190221/0a2c18e2/attachment.htm>


More information about the gerrit-log mailing list