summaryrefslogtreecommitdiffstats
path: root/bsc
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-09-03 19:10:55 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-09-09 12:48:28 +0200
commit078666329d111ed3825c72b4f3a2a1554fb8ea09 (patch)
tree213d67571ccc58f48dce6e6957eae07803bd798c /bsc
parent7a04cdd9aa111ad60e3b120d19d64dfe155fbfec (diff)
bsc: Introduce test TC_assignment_aoip_tla_v6 and TC_ho_into_this_bsc_tla_v6
Diffstat (limited to 'bsc')
-rw-r--r--bsc/BSC_Tests.ttcn49
-rw-r--r--bsc/MSC_ConnectionHandler.ttcn26
2 files changed, 63 insertions, 12 deletions
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index f16fab4..d32f202 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1397,12 +1397,12 @@ testcase TC_assignment_cic_only(integer bssap_idx := 0) runs on test_CT {
}
/* generate an assignment request for either AoIP or SCCPlite */
-function f_gen_ass_req(boolean osmux_enabled := false, integer bssap_idx := 0) return PDU_BSSAP {
+function f_gen_ass_req(boolean osmux_enabled := false, integer bssap_idx := 0, charstring aoip_tla := "1.2.3.4") return PDU_BSSAP {
var PDU_BSSAP ass_cmd;
var BSSMAP_IE_Osmo_OsmuxCID osmux_cid := valueof(ts_OsmuxCID(0));
if (mp_bssap_cfg[bssap_idx].transport == BSSAP_TRANSPORT_AoIP) {
var BSSMAP_IE_AoIP_TransportLayerAddress tla :=
- valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342));
+ valueof(f_ts_BSSMAP_IE_AoIP_TLA(aoip_tla, 2342));
if (osmux_enabled) {
ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla, osmux_cid));
} else {
@@ -1415,11 +1415,11 @@ function f_gen_ass_req(boolean osmux_enabled := false, integer bssap_idx := 0) r
return ass_cmd;
}
-function f_gen_handover_req(integer bssap_idx := 0) return PDU_BSSAP {
+function f_gen_handover_req(integer bssap_idx := 0, charstring aoip_tla := "1.2.3.4") return PDU_BSSAP {
var PDU_BSSAP ho_req;
if (mp_bssap_cfg[bssap_idx].transport == BSSAP_TRANSPORT_AoIP) {
var BSSMAP_IE_AoIP_TransportLayerAddress tla :=
- valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342));
+ valueof(f_ts_BSSMAP_IE_AoIP_TLA(aoip_tla, 2342));
ho_req := valueof(ts_BSSMAP_HandoverRequest(omit, tla));
} else {
var BSSMAP_IE_CircuitIdentityCode cic := valueof(ts_BSSMAP_IE_CIC(0,1));
@@ -3093,6 +3093,25 @@ testcase TC_ciph_mode_a5_3() runs on test_CT {
vc_conn.done;
}
+/* establish initial channel, enable ciphering followed by assignment to ciphered channel */
+private function f_tc_assignment_aoip_tla_v6(charstring id) runs on MSC_ConnHdlr {
+ var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+ var PDU_BSSAP ass_cmd := f_gen_ass_req(aoip_tla := "::3");
+ ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
+ ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR}));
+
+ f_establish_fully(ass_cmd, exp_compl);
+}
+testcase TC_assignment_aoip_tla_v6() runs on test_CT {
+ var MSC_ConnHdlr vc_conn;
+ var TestHdlrParams pars := f_gen_test_hdlr_pars();
+
+ f_init(1, true);
+ f_sleep(1.0);
+ vc_conn := f_start_handler(refers(f_tc_assignment_aoip_tla_v6), pars);
+ vc_conn.done;
+}
+
/* establish initial channel, enable ciphering followed by assignment to ciphered channel */
private function f_tc_assignment_fr_a5(charstring id) runs on MSC_ConnHdlr {
@@ -4628,7 +4647,7 @@ private function f_tc_ho_into_this_bsc(charstring id) runs on MSC_ConnHdlr {
activate(as_Media());
BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_bsc, g_pars.sccp_addr_msc,
- f_gen_handover_req()));
+ f_gen_handover_req(aoip_tla := g_pars.host_aoip_tla)));
BSSAP.receive(RAN_Conn_Prim:MSC_CONN_PRIM_CONF_IND);
/* The RSL Emulation magically accepts the Chan Activ behind the scenes. */
@@ -4675,9 +4694,8 @@ private function f_tc_ho_into_this_bsc(charstring id) runs on MSC_ConnHdlr {
BSSAP.receive(tr_BSSMAP_HandoverComplete);
setverdict(pass);
}
-testcase TC_ho_into_this_bsc() runs on test_CT {
+function f_tc_ho_into_this_bsc_main(TestHdlrParams pars) runs on test_CT {
var MSC_ConnHdlr vc_conn;
- var TestHdlrParams pars := f_gen_test_hdlr_pars();
f_init(1, true);
f_sleep(1.0);
@@ -4697,6 +4715,17 @@ testcase TC_ho_into_this_bsc() runs on test_CT {
f_ctrs_bsc_and_bts_verify();
}
+testcase TC_ho_into_this_bsc() runs on test_CT {
+ var TestHdlrParams pars := f_gen_test_hdlr_pars();
+ f_tc_ho_into_this_bsc_main(pars);
+}
+
+testcase TC_ho_into_this_bsc_tla_v6() runs on test_CT {
+ var TestHdlrParams pars := f_gen_test_hdlr_pars();
+ pars.host_aoip_tla := "::6";
+ f_tc_ho_into_this_bsc_main(pars);
+}
+
private function f_tc_ho_in_fail_msc_clears(charstring id) runs on MSC_ConnHdlr {
var RslChannelNr new_chan_nr := valueof(t_RslChanNr0(1, RSL_CHAN_NR_Bm_ACCH));
f_rslem_register(0, new_chan_nr);
@@ -7390,6 +7419,9 @@ control {
execute( TC_assignment_csd() );
execute( TC_assignment_ctm() );
execute( TC_assignment_sign() );
+ if (mp_bssap_cfg[0].transport == BSSAP_TRANSPORT_AoIP) {
+ execute( TC_assignment_aoip_tla_v6() );
+ }
execute( TC_assignment_fr_a5_0() );
execute( TC_assignment_fr_a5_1() );
if (mp_bssap_cfg[0].transport == BSSAP_TRANSPORT_AoIP) {
@@ -7498,6 +7530,9 @@ control {
execute( TC_ho_out_fail_no_result_after_ho_cmd() );
execute( TC_ho_into_this_bsc() );
+ if (mp_bssap_cfg[0].transport == BSSAP_TRANSPORT_AoIP) {
+ execute( TC_ho_into_this_bsc_tla_v6() );
+ }
execute( TC_ho_in_fail_msc_clears() );
execute( TC_ho_in_fail_msc_clears_after_ho_detect() );
execute( TC_ho_in_fail_no_detect() );
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index bf96eff..76a56fc 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -279,6 +279,7 @@ function f_rx_crcx(MgcpCommand mgcp_cmd)
var MgcpOsmuxCID osmux_cid;
var SDP_Message sdp;
var integer cid := f_get_free_mgcp_conn();
+ var charstring local_rtp_addr := host_mgw_rtp_v6; /* Use IPv6 by default if no remote addr is provided by client */
if (match(mgcp_cmd.line.ep, t_MGCP_EP_wildcard)) {
if (cid != 0) {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "MGCP wildcard EP only works in first CRCX");
@@ -292,9 +293,14 @@ function f_rx_crcx(MgcpCommand mgcp_cmd)
sdp := mgcp_cmd.sdp;
g_media.mgcp_conn[cid].peer.host := sdp.connection.conn_addr.addr;
g_media.mgcp_conn[cid].peer.port_nr := sdp.media_list[0].media_field.ports.port_number;
+ if (sdp.connection.addr_type == "IP6") {
+ local_rtp_addr := host_mgw_rtp_v6;
+ } else {
+ local_rtp_addr := host_mgw_rtp_v4;
+ }
}
var MgcpConnState mgcp_conn := g_media.mgcp_conn[cid];
- sdp := valueof(ts_SDP(mgcp_conn.mgw.host, mgcp_conn.mgw.host, "foo", "21",
+ sdp := valueof(ts_SDP(mgcp_conn.mgw.host, local_rtp_addr, "foo", "21",
mgcp_conn.mgw.port_nr, { int2str(mgcp_conn.rtp_pt) },
{valueof(ts_SDP_rtpmap(mgcp_conn.rtp_pt,
mgcp_conn.mime_type & "/" &
@@ -316,15 +322,21 @@ function f_rx_mdcx(MgcpCommand mgcp_cmd)
runs on MSC_ConnHdlr return template MgcpResponse {
var SDP_Message sdp;
var integer cid := f_get_mgcp_conn(f_MgcpCmd_extract_conn_id(mgcp_cmd));
+ var charstring local_rtp_addr;
if (isvalue(mgcp_cmd.sdp)) {
sdp := mgcp_cmd.sdp;
g_media.mgcp_conn[cid].peer.host := sdp.connection.conn_addr.addr;
g_media.mgcp_conn[cid].peer.port_nr := sdp.media_list[0].media_field.ports.port_number;
+ if (sdp.connection.addr_type == "IP6") {
+ local_rtp_addr := host_mgw_rtp_v6;
+ } else {
+ local_rtp_addr := host_mgw_rtp_v4;
+ }
} else {
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "MDCX has no [recognizable] SDP");
}
var MgcpConnState mgcp_conn := g_media.mgcp_conn[cid];
- sdp := valueof(ts_SDP(mgcp_conn.peer.host, mgcp_conn.peer.host, "foo", "21",
+ sdp := valueof(ts_SDP(mgcp_conn.peer.host, local_rtp_addr, "foo", "21",
mgcp_conn.peer.port_nr, { int2str(mgcp_conn.rtp_pt) },
{valueof(ts_SDP_rtpmap(mgcp_conn.rtp_pt,
mgcp_conn.mime_type & "/" &
@@ -427,7 +439,9 @@ type component MSC_ConnHdlr extends RAN_ConnHdlr, RSL_DchanHdlr, MGCP_ConnHdlr,
var TestHdlrParams g_pars;
var charstring host_bts := "127.0.0.2";
- var charstring host_mgw := "127.0.0.3";
+ var charstring host_mgw_mgcp := "127.0.0.3";
+ var charstring host_mgw_rtp_v4 := "127.0.0.5";
+ var charstring host_mgw_rtp_v6 := "::1";
var charstring host_msc := "127.0.0.4";
var boolean g_vty_initialized := false;
@@ -538,6 +552,7 @@ type record TestHdlrParams {
boolean exp_ms_power_params,
boolean aoip,
boolean use_osmux,
+ charstring host_aoip_tla,
TestHdlrParamsMSCPool mscpool
};
@@ -567,6 +582,7 @@ template (value) TestHdlrParams t_def_TestHdlrPars := {
exp_ms_power_params := false,
aoip := true,
use_osmux := false,
+ host_aoip_tla := "1.2.3.4",
mscpool := {
bssap_idx := 0,
rsl_idx := 0,
@@ -1015,7 +1031,7 @@ runs on MSC_ConnHdlr {
codecType := FR_AMR;
}
- f_MscConnHdlr_init(g_pars.media_nr, host_bts, host_mgw, codecType);
+ f_MscConnHdlr_init(g_pars.media_nr, host_bts, host_mgw_mgcp, codecType);
/* patch in the LCLS related items, as needed */
f_ass_patch_lcls(ass_tpl, exp_ass_cpl);
@@ -1184,7 +1200,7 @@ runs on MSC_ConnHdlr {
cmd := ts_CRCX(get_next_trans_id(), ep, "sendrecv", call_id);
resp := tr_CRCX_ACK;
}
- cmd.sdp := ts_SDP(host_msc, host_mgw, "23", "42",
+ cmd.sdp := ts_SDP(host_msc, host_mgw_rtp_v4, "23", "42",
14000, { int2str(g_media.mgcp_conn[1].rtp_pt) },
{ valueof(ts_SDP_ptime(20)) });
mgcp_transceive_mgw(cmd, resp);