Attention is currently required from: daniel, laforge, osmith.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39630?usp=email )
Change subject: xua_rkm: Fix dynamic AS destroyed when multiple ASPs are associated
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
> can we please also add a (TTCN3?) test case for this scenario?
Yes, I'm currently adding some tests to validate dynamic ASP/AS/RKM in osmo-stp.
For now, this will be needed in osmo-ttcn3: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39641
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39630?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I986044944282cea9a13ed59424f2220fee6fe567
Gerrit-Change-Number: 39630
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 27 Feb 2025 18:39:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/38731?usp=email )
Change subject: AS loadsharing: Introduce combined_linkset
......................................................................
Patch Set 7:
(1 comment)
Patchset:
PS7:
Marking ASP/AS loadsharing patchset as WIP since I'm still doing some testing, and I submitted another patchset with fixes for unrealted (to the feature) issues I found during setting up a test env.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/38731?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I500ec74ba975e3c93071771027e4e5fe6000e6f3
Gerrit-Change-Number: 38731
Gerrit-PatchSet: 7
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 27 Feb 2025 18:37:56 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Attention is currently required from: daniel, fixeria, laforge, osmith.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39641?usp=email )
Change subject: stp: Allow setting up different m3ua_config list by test
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
I'm already using this for a couple new tests I'm still pollishing which allow testing dynamic ASP/AS/RKM in STP_Tests_M3UA
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39641?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I0a875bac5e9506be9140d5afa28da25bdc99a5a6
Gerrit-Change-Number: 39641
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 27 Feb 2025 18:35:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39641?usp=email )
Change subject: stp: Allow setting up different m3ua_config list by test
......................................................................
stp: Allow setting up different m3ua_config list by test
This is useful, for instance, for tests willing to test dynamic ASPs.
Change-Id: I0a875bac5e9506be9140d5afa28da25bdc99a5a6
---
M stp/STP_Tests_M3UA.ttcn
1 file changed, 101 insertions(+), 71 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/41/39641/1
diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn
index 0ae854b..195ce81 100644
--- a/stp/STP_Tests_M3UA.ttcn
+++ b/stp/STP_Tests_M3UA.ttcn
@@ -37,14 +37,14 @@
import from STP_Tests_Common all;
-private const integer NR_M3UA := 4; /* number of M3UA clients in ATS */
-private const integer NR_M3UA_SRV := 4; /* number of M3UA servres in ATS */
+private const integer MAX_NR_M3UA := 8; /* Maximum number of M3UA clients+servers in ATS */
modulepar {
/* STP-side IP addresses */
HostList mp_stp_m3ua_ip := { "127.0.0.1", "::1" };
/* local IP addresses */
HostList mp_local_m3ua_ip := { "127.0.0.1", "::1" };
+ /* Clients first, servers afterwards, match mp_m3ua_num_{clients,servers} */
M3uaConfigs mp_m3ua_configs := {
/* as-sender: One ASP within AS */
{
@@ -109,6 +109,10 @@
routing_ctx := 1155
}
};
+ /* number of M3UA clients in ATS */
+ integer mp_m3ua_num_clients := 4;
+ /* number of M3UA servers in ATS */
+ integer mp_m3ua_num_servers := 4;
integer mp_recovery_timeout_msec := 2000;
charstring mp_sccp_service_type := "mtp3_itu";
}
@@ -125,29 +129,32 @@
/* associated routing context */
integer routing_ctx
};
-type record length (NR_M3UA+NR_M3UA_SRV) of M3uaConfig M3uaConfigs;
+type record of M3uaConfig M3uaConfigs;
-private function M3UA_SRV(integer idx) return integer {
- return NR_M3UA+idx;
+private function M3UA_SRV(integer idx) runs on RAW_M3UA_CT return integer {
+ return g_m3ua_num_clients + idx;
}
-private function f_m3ua_cli_config(integer idx) return M3uaConfig {
- if (idx < 0 or idx >= NR_M3UA) {
+private function f_m3ua_cli_config(integer idx) runs on RAW_M3UA_CT return M3uaConfig {
+ if (idx < 0 or idx >= g_m3ua_num_clients) {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "f_m3ua_cli_config(): unexpected idx");
}
- return mp_m3ua_configs[idx];
+ return g_m3ua_configs[idx];
}
-private function f_m3ua_srv_config(integer idx) return M3uaConfig {
- if (idx < 0 or idx >= NR_M3UA_SRV) {
+private function f_m3ua_srv_config(integer idx) runs on RAW_M3UA_CT return M3uaConfig {
+ if (idx < 0 or idx >= g_m3ua_num_servers) {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "f_m3ua_srv_config(): unexpected idx");
}
- return mp_m3ua_configs[M3UA_SRV(idx)];
+ return g_m3ua_configs[M3UA_SRV(idx)];
}
type component RAW_M3UA_CT extends Test_CT {
- port M3UA_CODEC_PT M3UA[NR_M3UA+NR_M3UA_SRV];
- var integer g_m3ua_conn_id[NR_M3UA+NR_M3UA_SRV];
+ port M3UA_CODEC_PT M3UA[MAX_NR_M3UA];
+ var M3uaConfigs g_m3ua_configs;
+ var integer g_m3ua_num_clients;
+ var integer g_m3ua_num_servers;
+ var integer g_m3ua_conn_id[MAX_NR_M3UA];
}
private template PortEvent tr_ConnOpened := {
@@ -170,7 +177,7 @@
friend function f_M3UA_send(integer idx, template (present) PDU_M3UA msg, integer stream := 0)
runs on RAW_M3UA_CT {
- if (mp_m3ua_configs[idx].use_tcp) {
+ if (g_m3ua_configs[idx].use_tcp) {
M3UA[idx].send(t_M3UA_Send(g_m3ua_conn_id[idx], msg, omit));
} else {
M3UA[idx].send(t_M3UA_Send(g_m3ua_conn_id[idx], msg, stream));
@@ -232,7 +239,7 @@
var Option opt_add_local_addrs;
var OptionList opt_list := {};
var template SocketList opt_add_remote_addrs;
- var M3uaConfig m3cfg := mp_m3ua_configs[i];
+ var M3uaConfig m3cfg := g_m3ua_configs[i];
if (lengthof(mp_local_m3ua_ip) == 0 or lengthof(mp_stp_m3ua_ip) == 0) {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
@@ -266,7 +273,7 @@
}
friend function f_M3UA_connect_tcp(integer i) runs on RAW_M3UA_CT {
- var M3uaConfig m3cfg := mp_m3ua_configs[i];
+ var M3uaConfig m3cfg := g_m3ua_configs[i];
var Result res;
if (lengthof(mp_local_m3ua_ip) == 0 or lengthof(mp_stp_m3ua_ip) == 0) {
@@ -288,11 +295,11 @@
friend function f_M3UA_close(integer i) runs on RAW_M3UA_CT {
var Result res;
if (g_m3ua_conn_id[i] < 0) {
- log("Not close()ing m3cfg := ", mp_m3ua_configs[i], " (not connected)");
+ log("Not close()ing m3cfg := ", g_m3ua_configs[i], " (not connected)");
/* not connected */
return;
}
- if (mp_m3ua_configs[i].use_tcp) {
+ if (g_m3ua_configs[i].use_tcp) {
res := M3UA_CodecPort_CtrlFunct.f_IPL4_close(M3UA[i], g_m3ua_conn_id[i], {tcp:={}});
} else {
res := M3UA_CodecPort_CtrlFunct.f_IPL4_close(M3UA[i], g_m3ua_conn_id[i], {sctp:=valueof(ts_SCTP)});
@@ -304,7 +311,7 @@
var Result res;
var Option opt_add_local_addrs;
var OptionList opt_list := {};
- var M3uaConfig m3cfg := mp_m3ua_configs[i];
+ var M3uaConfig m3cfg := g_m3ua_configs[i];
if (lengthof(mp_local_m3ua_ip) == 0 ) {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
@@ -332,12 +339,26 @@
}
}
-friend function f_init_m3ua(boolean ignore_ssnm := true) runs on RAW_M3UA_CT {
+friend function f_init_m3ua(boolean ignore_ssnm := true,
+ template (omit) M3uaConfigs m3ua_configs := omit,
+ integer m3ua_num_clients := 0,
+ integer m3ua_num_servers := 0) runs on RAW_M3UA_CT {
var integer i;
f_init_common();
- for (i := 0; i < NR_M3UA; i:=i+1) {
+ if (isvalue(m3ua_configs)) {
+ g_m3ua_configs := valueof(m3ua_configs);
+ g_m3ua_num_clients := m3ua_num_clients;
+ g_m3ua_num_servers := m3ua_num_servers
+ } else {
+ g_m3ua_configs := mp_m3ua_configs;
+ g_m3ua_num_clients := mp_m3ua_num_clients;
+ g_m3ua_num_servers := mp_m3ua_num_servers;
+ }
+
+
+ for (i := 0; i < g_m3ua_num_clients; i:=i+1) {
map(self:M3UA[i], system:M3UA_CODEC_PT);
}
@@ -346,8 +367,8 @@
activate(as_m3ua_ssnm_ignore());
}
- for (i := 0; i < NR_M3UA; i:=i+1) {
- if (mp_m3ua_configs[i].use_tcp) {
+ for (i := 0; i < g_m3ua_num_clients; i:=i+1) {
+ if (g_m3ua_configs[i].use_tcp) {
f_M3UA_connect_tcp(i);
} else {
f_M3UA_connect_sctp(i);
@@ -360,7 +381,7 @@
log("Clearing M3UA...");
- for (i := 0; i < NR_M3UA; i:=i+1) {
+ for (i := 0; i < g_m3ua_num_clients; i:=i+1) {
f_M3UA_close(i);
}
/* Wait for recovery timer to trigger and shutdown all AS: */
@@ -372,14 +393,14 @@
var integer i;
var PortEvent port_evt;
- for (i := NR_M3UA; i < NR_M3UA+NR_M3UA_SRV; i:=i+1) {
+ for (i := g_m3ua_num_clients; i < lengthof(g_m3ua_configs); i:=i+1) {
map(self:M3UA[i], system:M3UA_CODEC_PT);
}
- for (i := NR_M3UA; i < NR_M3UA+NR_M3UA_SRV; i:=i+1) {
+ for (i := g_m3ua_num_clients; i < lengthof(g_m3ua_configs); i:=i+1) {
/* bind + listen */
f_M3UA_listen(i);
}
- for (i := NR_M3UA; i < NR_M3UA+NR_M3UA_SRV; i:=i+1) {
+ for (i := g_m3ua_num_clients; i < lengthof(g_m3ua_configs); i:=i+1) {
/* wait for accept() */
M3UA[i].receive(tr_ConnOpened) -> value port_evt {
g_m3ua_conn_id[i] := port_evt.connOpened.connId;
@@ -495,12 +516,11 @@
/* test whether the STP accepts M3UA DATA without Routing Context IE */
testcase TC_act_rctx_data_no_rctx() runs on RAW_M3UA_CT {
+ f_init_m3ua();
var OCT4 rctx_sender := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
var OCT4 pc_sender := int2oct(f_m3ua_cli_config(0).point_code, 4);
var OCT4 rctx_receiver := int2oct(f_m3ua_cli_config(1).routing_ctx, 4);
var OCT4 pc_receiver := int2oct(f_m3ua_cli_config(1).point_code, 4);
-
- f_init_m3ua();
/* bring up the sender specifying a routing context */
f_M3UA_asp_up_act(0, rctx := rctx_sender);
@@ -527,13 +547,14 @@
/* test "traffic-mode override" behavior */
testcase TC_tmt_override() runs on RAW_M3UA_CT {
+
+ f_init_m3ua();
+
var OCT4 rctx_sender := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
var OCT4 pc_sender := int2oct(f_m3ua_cli_config(0).point_code, 4);
var OCT4 rctx_receiver := int2oct(f_m3ua_cli_config(1).routing_ctx, 4);
var OCT4 pc_receiver := int2oct(f_m3ua_cli_config(1).point_code, 4);
- f_init_m3ua();
-
/* bring up the 'sender' side (single ASP in AS) */
f_M3UA_asp_up_act(0, omit, omit);
@@ -564,13 +585,14 @@
/* test "traffic-mode load-share" behavior */
testcase TC_tmt_loadshare() runs on RAW_M3UA_CT {
+ var integer i;
+
+ f_init_m3ua();
+
var OCT4 rctx_sender := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
var OCT4 pc_sender := int2oct(f_m3ua_cli_config(0).point_code, 4);
var OCT4 rctx_receiver := int2oct(f_m3ua_cli_config(1).routing_ctx, 4);
var OCT4 pc_receiver := int2oct(f_m3ua_cli_config(1).point_code, 4);
- var integer i;
-
- f_init_m3ua();
/* FIXME: configure the STP via VTY to set traffic-mode */
@@ -590,7 +612,10 @@
/* verify traffic is routed from sender to new receiver */
const integer iter_per_asp := 5;
- var integer num_rx[NR_M3UA] := { 0, 0, 0, 0 };
+ var Integers num_rx := {};
+ for (i := 0; i < g_m3ua_num_clients; i := i + 1) {
+ num_rx := num_rx & {0};
+ }
for (i := 0; i < 2*iter_per_asp; i := i+1) {
var octetstring data := f_rnd_octstring_rnd_len(100);
var template (value) M3UA_Protocol_Data tx_pd;
@@ -617,13 +642,14 @@
/* test "traffic-mode broadcast" behavior */
testcase TC_tmt_broadcast() runs on RAW_M3UA_CT {
+ var integer i;
+
+ f_init_m3ua();
+
var OCT4 rctx_sender := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
var OCT4 pc_sender := int2oct(f_m3ua_cli_config(0).point_code, 4);
var OCT4 rctx_receiver := int2oct(f_m3ua_cli_config(1).routing_ctx, 4);
var OCT4 pc_receiver := int2oct(f_m3ua_cli_config(1).point_code, 4);
- var integer i;
-
- f_init_m3ua();
/* FIXME: configure the STP via VTY to set traffic-mode */
@@ -679,11 +705,11 @@
/* Send RKM registration; expect OK as RCTX does match config */
testcase TC_rkm_reg_static_permitted() runs on RAW_M3UA_CT {
+ f_init_m3ua();
+
var OCT3 dpc := int2oct(f_m3ua_cli_config(0).point_code, 3); // must match config
var OCT4 rctx := int2oct(f_m3ua_cli_config(0).routing_ctx, 4); // must match config
- f_init_m3ua();
-
f_M3UA_send(0, ts_M3UA_REG_REQ({ts_M3UA_rkey(id:='10000099'O, dpc:=dpc, rctx:=rctx)}));
f_M3UA_exp(0, tr_M3UA_REG_RSP({tr_M3UA_reg_res(id:='10000099'O, status:=c_M3UA_REGSTS_SUCCESS,
rctx:=rctx)}));
@@ -850,14 +876,14 @@
/* Test traffic being routed through "server" side STP (M3UA SG), coming back in "client"
* side STP (M3UA ASP) */
testcase TC_clnt_sg_to_asp() runs on RAW_M3UA_CT {
+ f_init_m3ua();
+ f_M3UA_asp_up_act(0);
+
var OCT4 rctx_sender := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
var OCT4 pc_sender := int2oct(f_m3ua_cli_config(0).point_code, 4);
var OCT4 rctx_receiver := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
var OCT4 pc_receiver := int2oct(f_m3ua_srv_config(0).point_code, 4);
- f_init_m3ua();
- f_M3UA_asp_up_act(0);
-
f_init_m3ua_srv();
f_M3UA_CLNT_asp_up_act(M3UA_SRV(0), rctx := rctx_receiver);
@@ -872,14 +898,14 @@
/* Test traffic being routed through "client" side STP (M3UA ASP), coming back in "server"
* side STP (M3UA SG) */
testcase TC_clnt_asp_to_sg() runs on RAW_M3UA_CT {
+ f_init_m3ua();
+ f_M3UA_asp_up_act(0);
+
var OCT4 rctx_sender := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
var OCT4 pc_sender := int2oct(f_m3ua_srv_config(0).point_code, 4);
var OCT4 rctx_receiver := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
var OCT4 pc_receiver := int2oct(f_m3ua_cli_config(0).point_code, 4);
- f_init_m3ua();
- f_M3UA_asp_up_act(0);
-
f_init_m3ua_srv();
f_M3UA_CLNT_asp_up_act(M3UA_SRV(0), rctx := rctx_sender);
@@ -893,15 +919,15 @@
/* Test traffic being routed through "server" side STP (M3UA SG), coming back in "client"
* side STP (M3UA ASP) which has no routing context set */
testcase TC_clnt_sg_to_asp_norctx() runs on RAW_M3UA_CT {
+ /* activate the sender side (ATS is client to STP in SG role) */
+ f_init_m3ua();
+ f_M3UA_asp_up_act(0);
+
var OCT4 rctx_sender := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
var OCT4 pc_sender := int2oct(f_m3ua_cli_config(0).point_code, 4);
var OCT4 pc_receiver := int2oct(f_m3ua_srv_config(1).point_code, 4);
var OCT4 pc_receiver2 := int2oct(f_m3ua_srv_config(2).point_code, 4);
- /* activate the sender side (ATS is client to STP in SG role) */
- f_init_m3ua();
- f_M3UA_asp_up_act(0);
-
/* activate the receiver side (ATS is server to STP in ASP role) */
f_init_m3ua_srv();
f_M3UA_CLNT_asp_up_act(M3UA_SRV(1), rctx := omit);
@@ -920,15 +946,15 @@
/* Test traffic being routed through "server" side STP (M3UA SG), coming back in "client"
* side STP (M3UA ASP) which has no routing context set */
testcase TC_clnt_asp_to_sg_norctx() runs on RAW_M3UA_CT {
+ /* activate the sender side (ATS is client to STP in SG role) */
+ f_init_m3ua();
+ f_M3UA_asp_up_act(0);
+
var OCT4 rctx_receiver := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
var OCT4 pc_receiver := int2oct(f_m3ua_cli_config(0).point_code, 4);
var OCT4 pc_sender := int2oct(f_m3ua_srv_config(1).point_code, 4);
var OCT4 pc_sender2 := int2oct(f_m3ua_srv_config(2).point_code, 4);
- /* activate the sender side (ATS is client to STP in SG role) */
- f_init_m3ua();
- f_M3UA_asp_up_act(0);
-
/* activate the receiver side (ATS is server to STP in ASP role) */
f_init_m3ua_srv();
f_M3UA_CLNT_asp_up_act(M3UA_SRV(1), rctx := omit);
@@ -946,13 +972,13 @@
/* Test if ASPAC / ASPIA of one ASP generates DAVA / DUNA on other ASP */
testcase TC_ssnm_aspac_dava_aspia_duna() runs on RAW_M3UA_CT {
- var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
- var integer pc0 := f_m3ua_cli_config(1).point_code;
-
f_init_m3ua(ignore_ssnm := false);
/* activate the first ASP */
f_M3UA_asp_up_act(0);
+ var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
+ var integer pc0 := f_m3ua_cli_config(1).point_code;
+
/* activate the second ASP */
f_M3UA_asp_up_act(1, c_M3UA_TMT_override, omit);
/* expect DAVA for PC of second ASP on first ASP */
@@ -970,8 +996,6 @@
/* Test if DAVA/DUNA sent from SG to ASP-role STP gets forwarded to other ASP */
testcase TC_ssnm_distribution_dava_duna() runs on RAW_M3UA_CT {
- var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
- var OCT4 rctxS0 := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
/* some random point code whose availability we advertise */
var template (value) M3UA_Point_Code adv_pc := ts_M3UA_PC(1234, 0);
@@ -980,6 +1004,9 @@
/* activate the first ASP */
f_M3UA_asp_up_act(0);
+ var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
+ var OCT4 rctxS0 := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
+
/* activate SG-role ASP (ASP on STP) */
f_init_m3ua_srv();
f_M3UA_CLNT_asp_up_act(M3UA_SRV(0), rctx := rctxS0);
@@ -997,8 +1024,6 @@
/* Test if DAVA/DUNA sent from SG to ASP-role STP gets forwarded to other ASP */
testcase TC_ssnm_distribution_dava_duna_multipc() runs on RAW_M3UA_CT {
- var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
- var OCT4 rctxS0 := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
/* some random point code whose availability we advertise */
var template (value) M3UA_Point_Codes adv_pcs := { ts_M3UA_PC(1234, 0), ts_M3UA_PC(5678, 0) };
@@ -1007,6 +1032,9 @@
/* activate the first ASP */
f_M3UA_asp_up_act(0);
+ var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
+ var OCT4 rctxS0 := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
+
/* activate SG-role ASP (ASP on STP) */
f_init_m3ua_srv();
f_M3UA_CLNT_asp_up_act(M3UA_SRV(0), rctx := rctxS0);
@@ -1024,8 +1052,6 @@
/* Test if DUPU sent from SG to ASP-role STP gets forwarded to other ASP */
testcase TC_ssnm_distribution_dupu() runs on RAW_M3UA_CT {
- var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
- var OCT4 rctxS0 := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
/* some random point code whose availability we advertise */
var template (value) M3UA_Point_Code adv_pc := ts_M3UA_PC(1234, 0);
@@ -1034,6 +1060,9 @@
/* activate the first ASP */
f_M3UA_asp_up_act(0);
+ var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
+ var OCT4 rctxS0 := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
+
/* activate SG-role ASP (ASP on STP) */
f_init_m3ua_srv();
f_M3UA_CLNT_asp_up_act(M3UA_SRV(0), rctx := rctxS0);
@@ -1046,8 +1075,6 @@
/* Test if SCON sent from SG to ASP-role STP gets forwarded to other ASP */
testcase TC_ssnm_distribution_scon() runs on RAW_M3UA_CT {
- var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
- var OCT4 rctxS0 := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
/* some random point code whose availability we advertise */
var template (value) M3UA_Point_Code adv_pc := ts_M3UA_PC(1234, 0);
@@ -1056,6 +1083,9 @@
/* activate the first ASP */
f_M3UA_asp_up_act(0);
+ var OCT4 rctx0 := int2oct(f_m3ua_cli_config(0).routing_ctx, 4);
+ var OCT4 rctxS0 := int2oct(f_m3ua_srv_config(0).routing_ctx, 4);
+
/* activate SG-role ASP (ASP on STP) */
f_init_m3ua_srv();
f_M3UA_CLNT_asp_up_act(M3UA_SRV(0), rctx := rctxS0);
@@ -1189,30 +1219,30 @@
}
private function f_TC_m3ua_tcp(integer idx_a, integer idx_b) runs on RAW_M3UA_CT {
- var M3uaConfig cfg_a := mp_m3ua_configs[idx_a];
- var M3uaConfig cfg_b := mp_m3ua_configs[idx_b];
+ var M3uaConfig cfg_a := g_m3ua_configs[idx_a];
+ var M3uaConfig cfg_b := g_m3ua_configs[idx_b];
var OCT4 rctx_a := int2oct(cfg_a.routing_ctx, 4);
var OCT4 rctx_b := int2oct(cfg_b.routing_ctx, 4);
var OCT4 pc_a := int2oct(cfg_a.point_code, 4);
var OCT4 pc_b := int2oct(cfg_b.point_code, 4);
/* establish connection with ASP 'A' */
- if (idx_a < NR_M3UA) {
+ if (idx_a < g_m3ua_num_clients) {
f_M3UA_asp_up_act(idx_a, rctx := rctx_a);
} else {
f_M3UA_CLNT_asp_up_act(idx_a, rctx := rctx_a);
}
/* establish connection with ASP 'B' */
- if (idx_b < NR_M3UA) {
+ if (idx_b < g_m3ua_num_clients) {
f_M3UA_asp_up_act(idx_b, rctx := rctx_b);
} else {
f_M3UA_CLNT_asp_up_act(idx_b, rctx := rctx_b);
}
/* In the case when ASP[idx_b] is configured as the client (i.e. osmo-stp connects to
- * the testsuite; idx_b >= NR_M3UA), in f_M3UA_CLNT_asp_up_act() we're expecting to
- * receive ASPACT and then sending ASPACT_ACK to it. Right after that, we're sending
+ * the testsuite; idx_b >= g_m3ua_num_clients), in f_M3UA_CLNT_asp_up_act() we're expecting
+ * to receive ASPACT and then sending ASPACT_ACK to it. Right after that, we're sending
* some random data via ASP[idx_a], which we then expect to receive via ASP[idx_b].
*
* There is a chance that the random data sent via ASP[idx_a] would reach osmo-stp
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39641?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I0a875bac5e9506be9140d5afa28da25bdc99a5a6
Gerrit-Change-Number: 39641
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: laforge.
falconia has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmo-abis/+/39623?usp=email )
Change subject: rtp2trau HR: remove broken TRAU-16k-UL support
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
> Since you originally wrote this TRAU<->RTP code in 2020 and since you chose back then to implement H […]
Upon further thought, I can produce a blind (no testing) patch that would bring HR-16k in line with HR-8k, for both DL and UL. But I am not going to implement unit tests for HR-16k format if there are no actual BTS that use it. Basically, either have code present (but untested) for HR-16k that matches the actually used (exercised, tested) HR-8k logic, or remove it - I am fine either way, and since I am not the project owner here, I'll follow those who are.
I am going to mark the present patch as WIP, then submit an alternative patch that brings HR-16k in line with HR-8k. Then both patches will be here in Gerrit, and you higher-ups can decide which one you would rather merge.
Unless someone shows me a counterexample, I am going to *assume* that the 16 kbit/s option in GSM 08.61 is a paper-only spec that was *never* implemented in physical reality by any GSM BSS vendor.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/39623?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: If50036c4de9a11db524abffcd87d053878104982
Gerrit-Change-Number: 39623
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Thu, 27 Feb 2025 18:32:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: falconia <falcon(a)freecalypso.org>
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Attention is currently required from: pespin.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-sigtran/+/39638?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: m3ua: Log Tx NOTIFY msg
......................................................................
m3ua: Log Tx NOTIFY msg
Change-Id: Iae3f0922bd924e1472d551c8a3144b203da21f79
---
M src/m3ua.c
M src/xua_as_fsm.c
M src/xua_internal.h
3 files changed, 24 insertions(+), 14 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/38/39638/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39638?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Iae3f0922bd924e1472d551c8a3144b203da21f79
Gerrit-Change-Number: 39638
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39639?usp=email )
Change subject: xua_rkm: Make sure existing AS gets added in list to receive ASP-INACTIVE.ind event
......................................................................
xua_rkm: Make sure existing AS gets added in list to receive ASP-INACTIVE.ind event
Eg. if a 2nd ASP tries to register against a given AS (RFC 4666 5.1.3),
it should still update the AS to tell it the ASP is in ASP-INACTIVE
state. This way depending on traffic mode, the AS state may change as
well.
Change-Id: I85948ab98623a8a53521eb2d2e84244011b39a93
---
M src/xua_rkm.c
1 file changed, 18 insertions(+), 11 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/39/39639/1
diff --git a/src/xua_rkm.c b/src/xua_rkm.c
index dd07db2..f616a3a 100644
--- a/src/xua_rkm.c
+++ b/src/xua_rkm.c
@@ -221,6 +221,14 @@
as = osmo_ss7_as_find_by_rctx(asp->inst, rctx);
if (as) {
LOGPASP(asp, DLSS7, LOGL_NOTICE, "RKM: Found existing AS for RCTX %u\n", rctx);
+ /* Early return before allocating stuff if no space left: */
+ if (*nas_idx >= max_nas_idx) {
+ LOGPASP(asp, DLSS7, LOGL_ERROR, "RKM: not enough room for newly assigned AS (max %u AS)\n",
+ max_nas_idx+1);
+ msgb_append_reg_res(resp, rk_id, M3UA_RKM_REG_ERR_INSUFF_RESRC, 0);
+ return -1;
+ }
+
if (as->cfg.routing_key.pc != dpc) {
LOGPASP(asp, DLSS7, LOGL_ERROR, "RKM: DPC doesn't match, rejecting AS (%u != %u)\n",
as->cfg.routing_key.pc, dpc);
@@ -244,6 +252,14 @@
as->cfg.mode_set_by_peer = true;
}
} else if (asp->inst->cfg.permit_dyn_rkm_alloc) {
+ /* Early return before allocating stuff if no space left: */
+ if (*nas_idx >= max_nas_idx) {
+ LOGPASP(asp, DLSS7, LOGL_ERROR, "RKM: not enough room for newly assigned AS (max %u AS)\n",
+ max_nas_idx+1);
+ msgb_append_reg_res(resp, rk_id, M3UA_RKM_REG_ERR_INSUFF_RESRC, 0);
+ return -1;
+ }
+
/* Create an AS for this routing key */
snprintf(namebuf, sizeof(namebuf), "as-rkm-%u", rctx);
as = osmo_ss7_as_find_or_create(asp->inst, namebuf, OSMO_SS7_ASP_PROT_M3UA);
@@ -272,17 +288,6 @@
msgb_append_reg_res(resp, rk_id, M3UA_RKM_REG_ERR_CANT_SUPP_UNQ_RT, 0);
return -1;
}
-
- /* append to list of newly assigned as */
- if (*nas_idx >= max_nas_idx) {
- ss7_route_destroy(rt);
- osmo_ss7_as_destroy(as);
- LOGPASP(asp, DLSS7, LOGL_ERROR, "RKM: not enough room for newly assigned AS (max %u AS)\n",
- max_nas_idx+1);
- msgb_append_reg_res(resp, rk_id, M3UA_RKM_REG_ERR_INSUFF_RESRC, 0);
- return -1;
- }
- newly_assigned_as[(*nas_idx)++] = as;
} else {
/* not permitted to create dynamic RKM entries */
LOGPASP(asp, DLSS7, LOGL_NOTICE, "RKM: RCTX %u not found in configuration, and "
@@ -294,6 +299,8 @@
/* Success: Add just-create AS to connected ASP + report success */
osmo_ss7_as_add_asp(as, asp->cfg.name);
msgb_append_reg_res(resp, rk_id, M3UA_RKM_REG_SUCCESS, rctx);
+ /* append to list of newly assigned as */
+ newly_assigned_as[(*nas_idx)++] = as;
return 0;
}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39639?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I85948ab98623a8a53521eb2d2e84244011b39a93
Gerrit-Change-Number: 39639
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
falconia has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/39622?usp=email )
Change subject: rtp2trau HR: add support for TRAU-8k-UL frame output
......................................................................
rtp2trau HR: add support for TRAU-8k-UL frame output
When osmo_rtp2trau() function is used to pass traffic to an E1 BTS,
it only needs to generate TRAU-DL frames, not TRAU-UL. OTOH,
ability to generate TRAU-UL frames is needed for TFO, i.e., for
software implementation of TFO-capable speech transcoders.
osmo_rtp2trau() already supports TRAU-UL frame output for FR and
EFR codecs, but not for HR codec in TRAU-8k framing - add the
missing support. (Out of the two possible TRAU frame formats for
GSM-HR codec, TFO always uses TRAU-8k format.)
Change-Id: I288cfa7d467125f7732ef1d0ef83b933e41da536
---
M src/trau/trau_rtp_conv.c
M tests/Makefile.am
M tests/testsuite.at
A tests/trau_conv/hr_speech_invsid_bits.hex
A tests/trau_conv/hr_speech_twts002.hex
A tests/trau_conv/rtp2trau_hr_ul1.ok
A tests/trau_conv/rtp2trau_hr_ul2.ok
A tests/trau_conv/rtp2trau_hr_ul3.ok
8 files changed, 241 insertions(+), 11 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
falconia: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/trau/trau_rtp_conv.c b/src/trau/trau_rtp_conv.c
index 328221e..d5ac1fa 100644
--- a/src/trau/trau_rtp_conv.c
+++ b/src/trau/trau_rtp_conv.c
@@ -756,7 +756,7 @@
return 0;
}
-static int rtp2trau_hr8(struct osmo_trau_frame *tf, const uint8_t *data, size_t data_len)
+static int rtp2trau_hr8_dl(struct osmo_trau_frame *tf, const uint8_t *data, size_t data_len)
{
/* accept both TS 101 318 and RFC 5993 payloads */
switch (data_len) {
@@ -773,12 +773,6 @@
return -EINVAL;
}
- /* FIXME: implement TRAU-UL frame generation if and when
- * someone actually needs it in a program that uses
- * this library. */
- if (tf->dir != OSMO_TRAU_DIR_DL)
- return -ENOTSUP;
-
tf->type = OSMO_TRAU8_SPEECH;
/* C1..C5 */
@@ -819,6 +813,130 @@
return 0;
}
+/* compute the odd parity bit of the given input bit sequence */
+static ubit_t compute_odd_parity(const ubit_t *in, unsigned int num_bits)
+{
+ int i;
+ unsigned int sum = 0;
+
+ for (i = 0; i < num_bits; i++) {
+ if (in[i])
+ sum++;
+ }
+ return !(sum & 1);
+}
+
+static int rtp2trau_hr8_ul(struct osmo_trau_frame *tf, const uint8_t *data, size_t data_len)
+{
+ uint8_t ft, xc1_4;
+ bool data_bits_req, have_taf;
+
+ /* In TRAU-UL direction we require/expect TW-TS-002 RTP payload format;
+ * RFC 5993 is also accepted because it is a subset of TW-TS-002.
+ * TS 101 318 input is not supported for TRAU-UL output! */
+ if (data_len < 1)
+ return -EINVAL;
+ ft = data[0] >> 4;
+ switch (ft) {
+ case FT_GOOD_SPEECH:
+ xc1_4 = 0;
+ data_bits_req = true;
+ have_taf = false;
+ break;
+ case FT_INVALID_SID:
+ xc1_4 = 4;
+ data_bits_req = false;
+ have_taf = true;
+ break;
+ case FT_GOOD_SID:
+ xc1_4 = 1;
+ data_bits_req = true;
+ have_taf = false;
+ break;
+ case FT_BFI_WITH_DATA:
+ xc1_4 = 6;
+ data_bits_req = true;
+ have_taf = true;
+ break;
+ case FT_NO_DATA:
+ xc1_4 = 6;
+ data_bits_req = false;
+ have_taf = true;
+ break;
+ default:
+ return -EINVAL;
+ }
+ /* If the frame type is one that includes data bits, the payload length
+ * per RFC 5993 and TW-TS-002 is 15 bytes. If the frame type is one
+ * that does not include data bits, then the payload length per the
+ * same specs is only 1 byte - but we also accept 15-byte payloads
+ * in this case to make life easier for applications that pass the
+ * content of a buffer.
+ *
+ * When we make a TRAU-UL frame from FT=1 or FT=7, we fill all Dn bits
+ * with zeros if we got a short (1 byte) payload. However, if the
+ * application passed us a long (15 byte) payload despite FT being
+ * 1 or 7, we fill Dn bits with application-provided payload.
+ */
+ switch (data_len) {
+ case GSM_HR_BYTES_RTP_RFC5993:
+ break;
+ case 1:
+ if (data_bits_req)
+ return -EINVAL;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ tf->type = OSMO_TRAU8_SPEECH;
+
+ /* C1..C5 */
+ tf->c_bits[0] = 0;
+ tf->c_bits[1] = 0;
+ tf->c_bits[2] = 0;
+ tf->c_bits[3] = 1;
+ tf->c_bits[4] = 0;
+ /* C6..C8: spare bits */
+ memset(tf->c_bits + 5, 1, 3);
+ /* C9 is DTXd */
+ tf->c_bits[8] = (data[0] & 0x08) >> 3;
+
+ /* XC1..XC6 */
+ tf->xc_bits[0] = (xc1_4 >> 3) & 1;
+ tf->xc_bits[1] = (xc1_4 >> 2) & 1;
+ tf->xc_bits[2] = (xc1_4 >> 1) & 1;
+ if (have_taf)
+ tf->xc_bits[3] = (data[0] & 0x01) >> 0;
+ else
+ tf->xc_bits[3] = (xc1_4 >> 0) & 1;
+ tf->xc_bits[4] = (data[0] & 0x02) >> 1; /* UFI */
+ tf->xc_bits[5] = compute_odd_parity(tf->xc_bits, 5);
+
+ memset(&tf->t_bits[0], 1, 2);
+
+ if (data_len > 1)
+ osmo_pbit2ubit(tf->d_bits, data + 1, GSM_HR_BYTES * 8);
+ else
+ memset(tf->d_bits, 0, GSM_HR_BYTES * 8);
+ /* CRC is *not* computed by TRAU frame encoder - we have to do it */
+ osmo_crc8gen_set_bits(&gsm0860_efr_crc3, tf->d_bits, 44, tf->crc_bits);
+
+ return 0;
+}
+
+static int rtp2trau_hr8(struct osmo_trau_frame *tf, const uint8_t *data, size_t data_len)
+{
+ switch (tf->dir) {
+ case OSMO_TRAU_DIR_DL:
+ return rtp2trau_hr8_dl(tf, data, data_len);
+ case OSMO_TRAU_DIR_UL:
+ return rtp2trau_hr8_ul(tf, data, data_len);
+ default:
+ return -EINVAL;
+ }
+}
+
/* TS 48.060 Section 5.5.1.1.2 */
static int rtp2trau_efr(struct osmo_trau_frame *tf, const uint8_t *data, size_t data_len)
{
@@ -1571,9 +1689,9 @@
* TRAU-UL (TFO) is TW-TS-001 - the basic RTP format of TS 101 318 or
* RFC 3551 lacks the necessary metadata flags.
*
- * - TRAU-UL output for HR codec is not currently implemented; when we do
- * implement it in the future, TW-TS-002 will be required in this path
- * for the same reason as above.
+ * - For HRv1 codec, for the same reason as above, the only correct RTP
+ * format for conversion to TRAU-UL is TW-TS-002. RFC 5993 payloads are
+ * also accepted (because it is a subset of TW-TS-002), but not TS 101 318.
*
* - TRAU-UL output for CSD 14.4 kbit/s mode is not currently implemented
* (C-bits are always set according to the rules for TRAU-DL) - but the
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4645b7e..73341a2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -99,13 +99,15 @@
trau_conv/fr_speech_basic.hex trau_conv/fr_speech_twts001_good.hex \
trau_conv/fr_speech_twts001_mix.hex \
trau_conv/hr_speech_rfc5993.hex trau_conv/hr_speech_ts101318.hex \
+ trau_conv/hr_speech_twts002.hex trau_conv/hr_speech_invsid_bits.hex \
trau_conv/rtp2trau_efr_dl1.ok trau_conv/rtp2trau_efr_dl2.ok \
trau_conv/rtp2trau_efr_ul1.ok trau_conv/rtp2trau_efr_ul2.ok \
trau_conv/rtp2trau_efr_ul3.ok \
trau_conv/rtp2trau_fr_dl1.ok trau_conv/rtp2trau_fr_dl2.ok \
trau_conv/rtp2trau_fr_ul1.ok trau_conv/rtp2trau_fr_ul2.ok \
trau_conv/rtp2trau_fr_ul3.ok \
- trau_conv/rtp2trau_hr_dl.ok \
+ trau_conv/rtp2trau_hr_dl.ok trau_conv/rtp2trau_hr_ul1.ok \
+ trau_conv/rtp2trau_hr_ul2.ok trau_conv/rtp2trau_hr_ul3.ok \
trau_conv/trau16_efr.in trau_conv/trau16_efr_std.ok \
trau_conv/trau16_efr_twts001.ok \
trau_conv/trau16_fr.in trau_conv/trau16_fr_std.ok \
diff --git a/tests/testsuite.at b/tests/testsuite.at
index a5cf070..b3c2764 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -162,3 +162,21 @@
cat $abs_srcdir/trau_conv/rtp2trau_hr_dl.ok > expout
AT_CHECK([$abs_top_builddir/tests/trau_conv/rtp2trau_gen $abs_srcdir/trau_conv/hr_speech_rfc5993.hex hr dl], [0], [expout], [ignore])
AT_CLEANUP
+
+AT_SETUP([rtp2trau_hr_ul1])
+AT_KEYWORDS([rtp2trau_hr_ul1])
+cat $abs_srcdir/trau_conv/rtp2trau_hr_ul1.ok > expout
+AT_CHECK([$abs_top_builddir/tests/trau_conv/rtp2trau_gen $abs_srcdir/trau_conv/hr_speech_rfc5993.hex hr ul], [0], [expout], [ignore])
+AT_CLEANUP
+
+AT_SETUP([rtp2trau_hr_ul2])
+AT_KEYWORDS([rtp2trau_hr_ul2])
+cat $abs_srcdir/trau_conv/rtp2trau_hr_ul2.ok > expout
+AT_CHECK([$abs_top_builddir/tests/trau_conv/rtp2trau_gen $abs_srcdir/trau_conv/hr_speech_twts002.hex hr ul], [0], [expout], [ignore])
+AT_CLEANUP
+
+AT_SETUP([rtp2trau_hr_ul3])
+AT_KEYWORDS([rtp2trau_hr_ul3])
+cat $abs_srcdir/trau_conv/rtp2trau_hr_ul3.ok > expout
+AT_CHECK([$abs_top_builddir/tests/trau_conv/rtp2trau_gen $abs_srcdir/trau_conv/hr_speech_invsid_bits.hex hr ul], [0], [expout], [ignore])
+AT_CLEANUP
diff --git a/tests/trau_conv/hr_speech_invsid_bits.hex b/tests/trau_conv/hr_speech_invsid_bits.hex
new file mode 100644
index 0000000..3ac5172
--- /dev/null
+++ b/tests/trau_conv/hr_speech_invsid_bits.hex
@@ -0,0 +1,14 @@
+# This TW-TS-005 hex file contains an input to osmo_rtp2trau() for GSM-HR
+# codec that is *not* a valid RTP payload per TW-TS-002: an invalid SID
+# frame for conversion to TRAU-UL that begins as defined in TW-TS-002
+# (FT=1 to signify invalid SID), but then contrary to the spec, does
+# include the payload data bits. Such concoction is not valid in RTP
+# flight between network elements, but osmo_rtp2trau() supports such
+# extended usage in order to allow TFO applications to set the fill bit
+# pattern in the TRAU-UL frame to something other than all zeros.
+#
+# In the present example, this fill bit pattern consists of R0+LPC
+# parameters (33 bits) from a valid SID frame, followed by alternating
+# 1s and 0s in the 79-bit SID field.
+
+1000D9EA65D5555555555555555555
diff --git a/tests/trau_conv/hr_speech_twts002.hex b/tests/trau_conv/hr_speech_twts002.hex
new file mode 100644
index 0000000..e0e6321
--- /dev/null
+++ b/tests/trau_conv/hr_speech_twts002.hex
@@ -0,0 +1,43 @@
+# This hex file (TW-TS-005 Annex B format) contains some RTP payloads for
+# GSM-HR codec, using the super-5993 RTP payload format of TW-TS-002,
+# semantically corresponding to the uplink direction of a GSM call leg.
+#
+# The present example contains a mix of good and bad frames, the same kind
+# of mix that can be represented in a TRAU-UL frame stream. This example
+# has been constructed by hand: some frames were taken from GSM 06.07 test
+# sequences and then tweaked, other are outright concoctions. The setting
+# of DTXd bit is also exercised.
+
+# good speech frame (DHF)
+000371AF61C8F2802531C000000000
+
+# good speech frame (regular)
+00B77916FC7D902F9372B569F5D17F
+# same with TAF
+01B77916FC7D902F9372B569F5D17F
+# same with UFI
+02B77916FC7D902F9372B569F5D17F
+
+# valid SID frame (first SID from dtx06.cod)
+2000D9EA65FFFFFFFFFFFFFFFFFFFF
+# same with TAF
+2100D9EA65FFFFFFFFFFFFFFFFFFFF
+# same with UFI
+2200D9EA65FFFFFFFFFFFFFFFFFFFF
+
+# BFI with data
+608FE9B77000000000000000000000
+# same with TAF
+618FE9B77000000000000000000000
+
+# short TW-TS-002 payloads (ToC octet only)
+10 # invalid SID frame
+11 # same with TAF
+13 # TAF+UFI
+70 # BFI-no-data
+71 # same with TAF
+
+# some of these same frames with DTXd=1
+08B77916FC7D902F9372B569F5D17F
+2800D9EA65FFFFFFFFFFFFFFFFFFFF
+688FE9B77000000000000000000000
diff --git a/tests/trau_conv/rtp2trau_hr_ul1.ok b/tests/trau_conv/rtp2trau_hr_ul1.ok
new file mode 100644
index 0000000..1fd3f3b
--- /dev/null
+++ b/tests/trau_conv/rtp2trau_hr_ul1.ok
@@ -0,0 +1,17 @@
+00884486f1d7d8b98ff2c089a69c8080808080bb
+00884486f1d7d8b98ff2c089a69c8080808080bb
+0088469fe9dbdc8080d0808080808080808080bb
+0088469fe3eedf90dd9c9dddc7f193a9e5c587bb
+008845fef4fd9ba986ddabfceac589d38ab3febb
+008846bfe3eedab7e4aed7eb88b4a4a4f997ccfb
+008846eef98bbf8fd9a097e4eeababa7ebd1bffb
+00884486f1d7d8b98ff2c089a69c8080808080bb
+00884486f1d7d8b98ff2c089a69c8080808080bb
+00884481d9f599b9c9cce0b8ccb6c099e9f1f6fb
+00884481d9f599b18c9df0b0cdb68099d9f5f6fb
+00884481d9f599b18c9df0b2cdb28099d9f5f6fb
+00884481d9f599b18c9df0b2cdb28099d9f5f6fb
+00884481d9f599b18c9df0b2cdb28099d9f5f6fb
+00884481d9f599b18c9df0b2cdb28099d9f5f6fb
+00884481d9f599b18c9df0b2cdb28099d9f5f6fb
+00885081d9f599bffffffffffffffffffffffffb
diff --git a/tests/trau_conv/rtp2trau_hr_ul2.ok b/tests/trau_conv/rtp2trau_hr_ul2.ok
new file mode 100644
index 0000000..01ba3e4
--- /dev/null
+++ b/tests/trau_conv/rtp2trau_hr_ul2.ok
@@ -0,0 +1,17 @@
+00884486f1d7d8b98ff2c089a69c8080808080bb
+008846eef98bbf8fd9a097e4eeababa7ebd1bffb
+008846eef98bbf8fd9a097e4eeababa7ebd1bffb
+00884aeef98bbf8fd9a097e4eeababa7ebd1bffb
+00885081d9f599bffffffffffffffffffffffffb
+00885081d9f599bffffffffffffffffffffffffb
+00885c81d9f599bffffffffffffffffffffffffb
+0089669fe9dbdc8080d0808080808080808080bb
+0089729fe9dbdc8080d0808080808080808080bb
+008940808080808080f0808080808080808080bb
+008954808080808080f0808080808080808080bb
+008958808080808080f0808080808080808080bb
+008964808080808080f0808080808080808080bb
+008970808080808080f0808080808080808080bb
+008846eef98bbf8fd9a097e4eeababa7ebd1bfff
+00885081d9f599bfffffffffffffffffffffffff
+0089669fe9dbdc8080d0808080808080808080bf
diff --git a/tests/trau_conv/rtp2trau_hr_ul3.ok b/tests/trau_conv/rtp2trau_hr_ul3.ok
new file mode 100644
index 0000000..a6d657c
--- /dev/null
+++ b/tests/trau_conv/rtp2trau_hr_ul3.ok
@@ -0,0 +1 @@
+00894081d9f599bad5a5aad5aad5aad5aad5aafb
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/39622?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I288cfa7d467125f7732ef1d0ef83b933e41da536
Gerrit-Change-Number: 39622
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>