summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-05-24 22:27:58 +0200
committerHarald Welte <laforge@gnumonks.org>2018-05-25 20:56:47 +0200
commited848519f0b31cf7afde4c288cfb83606bc67cc7 (patch)
treedcc3b757315d40db24b1471eb99a03e477c43a49
parentf82bbb6829afbc341e34e4a8f736c7e15e723cc4 (diff)
bsc: Alter Assignment Req + Complete depending on AoIP or SCCPlite
When sending BSSMAP Assignment Request, we need to decide if we want to fill in the AoIP TransportIdentifier or the CIC. The former is needed in AoIP, the latter is needed for SCCPlite and classic SCCP. Related: OS#2544 Change-Id: I8aa0cf2189101de49a6da81625226bdcbbaff027
-rw-r--r--bsc/BSC_Tests.ttcn60
1 files changed, 39 insertions, 21 deletions
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 762b5a2..95b7625 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -558,6 +558,32 @@ testcase TC_assignment_cic_only() runs on test_CT {
}
}
+/* generate an assignment request for either AoIP or SCCPlite */
+private function f_gen_ass_req() return PDU_BSSAP {
+ var PDU_BSSAP ass_cmd;
+ if (mp_bssap_cfg.transport == BSSAP_TRANSPORT_AoIP) {
+ var BSSMAP_IE_AoIP_TransportLayerAddress tla :=
+ valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342));
+ ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla));
+ } else {
+ var BSSMAP_IE_CircuitIdentityCode cic := valueof(ts_BSSMAP_IE_CIC(0,1));
+ ass_cmd := valueof(ts_BSSMAP_AssignmentReq(cic, omit));
+ }
+ return ass_cmd;
+}
+
+/* generate an assignment complete template for either AoIP or SCCPlite */
+private function f_gen_exp_compl() return template PDU_BSSAP {
+ var template PDU_BSSAP exp_compl;
+ if (mp_bssap_cfg.transport == BSSAP_TRANSPORT_AoIP) {
+ exp_compl := tr_BSSMAP_AssignmentComplete(omit, ?);
+ } else {
+ /* CIC is optional "*" as the MSC allocated it */
+ exp_compl := tr_BSSMAP_AssignmentComplete(*, omit);
+ }
+ return exp_compl;
+}
+
/* Run everything required up to sending a caller-specified assignment command and expect response */
function f_assignment_exp(PDU_BSSAP ass_cmd, template PDU_BSSAP exp, charstring fail_text)
runs on test_CT {
@@ -590,8 +616,7 @@ runs on test_CT {
}
testcase TC_assignment_csd() runs on test_CT {
var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail;
- var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342));
- var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla));
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelTypeCSD);
//exp_fail.pdu.bssmap.assignmentFailure.cause.causeValue := int2bit(enum2int(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL), 7);
f_assignment_exp(ass_cmd, exp_fail, "BSC accepted Assignment for CSD");
@@ -599,8 +624,7 @@ testcase TC_assignment_csd() runs on test_CT {
testcase TC_assignment_ctm() runs on test_CT {
var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail;
- var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342));
- var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla));
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelTypeCTM);
//exp_fail.pdu.bssmap.assignmentFailure.cause.causeValue := int2bit(enum2int(GSM0808_CAUSE_REQ_CODEC_TYPE_OR_CONFIG_UNAVAIL), 7);
f_assignment_exp(ass_cmd, exp_fail, "BSC accepted Assignment for Speech+CTM");
@@ -1436,9 +1460,8 @@ runs on MSC_ConnHdlr {
/* Establish signalling channel (non-assignment case) followed by cipher mode */
private function f_tc_ciph_mode_a5(charstring id) runs on MSC_ConnHdlr {
- var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, ?);
- var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342));
- var template PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla));
+ var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelTypeSIGNAL);
// Disable generation of ASSIGNMENT CMD, as OsmoBSC currently performs MODE MODFIY sign->sign (OS#2936)
@@ -1479,9 +1502,8 @@ testcase TC_ciph_mode_a5_3() runs on test_CT {
/* establish initial channel, enable ciphering followed by assignment to ciphered channel */
private function f_tc_assignment_fr_a5(charstring id) runs on MSC_ConnHdlr {
- var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, ?);
- var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342));
- var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla));
+ var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
ass_cmd.pdu.bssmap.assignmentRequest.codecList := valueof(ts_BSSMAP_IE_CodecList({ts_CodecFR}));
@@ -1523,8 +1545,7 @@ testcase TC_assignment_fr_a5_3() runs on test_CT {
private function f_tc_assignment_fr_a5_1_codec_missing(charstring id) runs on MSC_ConnHdlr {
g_pars := valueof(t_def_TestHdlrPars);
var template PDU_BSSAP exp_fail := tr_BSSMAP_AssignmentFail;
- var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342));
- var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla));
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
const OCT8 kc := '0001020304050607'O;
ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);
@@ -1542,9 +1563,8 @@ testcase TC_assignment_fr_a5_1_codec_missing() runs on test_CT {
private function f_tc_assignment_fr_a5_4(charstring id) runs on MSC_ConnHdlr {
g_pars := valueof(t_def_TestHdlrPars);
- var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, ?);
- var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342));
- var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla));
+ var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
const OCT8 kc := '0001020304050607'O;
const OCT16 kc128 := kc & kc;
@@ -1713,9 +1733,8 @@ type record CodecListTest {
type record of CodecListTest CodecListTests
private function f_TC_assignment_codec(charstring id) runs on MSC_ConnHdlr {
- var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342));
- var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla));
- var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, ?);
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
+ var template PDU_BSSAP exp_compl := f_gen_exp_compl();
/* puzzle together the ASSIGNMENT REQ for given codec[s] */
ass_cmd.pdu.bssmap.assignmentRequest.codecList := g_pars.ass_codec_list;
@@ -1970,9 +1989,8 @@ runs on MSC_ConnHdlr {
/* intra-BSC hand-over between BTS0 and BTS1 */
private function f_tc_ho_int(charstring id) runs on MSC_ConnHdlr {
g_pars := valueof(t_def_TestHdlrPars);
- var template PDU_BSSAP exp_compl := tr_BSSMAP_AssignmentComplete(omit, ?);
- var BSSMAP_IE_AoIP_TransportLayerAddress tla := valueof(ts_BSSMAP_IE_AoIP_TLA4('01020304'O, 2342));
- var PDU_BSSAP ass_cmd := valueof(ts_BSSMAP_AssignmentReq(omit, tla));
+ var template PDU_BSSAP exp_compl := f_gen_exp_compl();
+ var PDU_BSSAP ass_cmd := f_gen_ass_req();
const OCT8 kc := '0001020304050607'O;
ass_cmd.pdu.bssmap.assignmentRequest.channelType := valueof(ts_BSSMAP_IE_ChannelType);