Loading LibGtpv2C_Configuration.ttcn +95 −29 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ module LibGtpv2C_Configuration { // LibGtpv2C import from LibGtpv2C_TypesAndValues all; import from LibGtpv2C_TestSystem all; import from LibGtpv2C_Templates all; import from LibGtpv2C_Pics all; group configurationFunctions { Loading @@ -32,6 +31,10 @@ module LibGtpv2C_Configuration { * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 1: Test configuration CF_MME */ function f_cf01_S11Up_MME() runs on Gtpv2CComponent { // Create component vc_sgw := Gtpv2CComponent.create; // Map ports map(vc_sgw:acPort, system:acPort); map(vc_sgw:s11Port, system:s11Port); Loading @@ -42,10 +45,9 @@ module LibGtpv2C_Configuration { // Activate sync default for MTC activate(a_mtc_shutdown()); vc_sgw := Gtpv2CComponent.create; vc_sequenceNumber := 0; vc_restartCounter := 0; vc_teidGreCounter := 0; } // End of function f_cf01_S11Up_MME /** Loading @@ -60,6 +62,13 @@ module LibGtpv2C_Configuration { * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 2: Test configuration CF_MME_ENB */ function f_cf02_S11Up_MME() runs on Gtpv2CComponent { // Create components vc_sgw := Gtpv2CComponent.create; if (PICS_SUPPORT_S1_MME_TRIGGERS) { vc_s1mme := Gtpv2CComponent.create; } // Map ports map(vc_sgw:acPort, system:acPort); map(vc_sgw:s11Port, system:s11Port); Loading @@ -76,11 +85,9 @@ module LibGtpv2C_Configuration { activate(a_s1mme_default()); } vc_sgw := Gtpv2CComponent.create; vc_s1mme := Gtpv2CComponent.create; vc_sequenceNumber := 0; vc_restartCounter := 0; vc_teidGreCounter := 0; } // End of function f_cf02_S11Up_MME /** Loading @@ -97,9 +104,10 @@ module LibGtpv2C_Configuration { f_disconnect4SelfOrClientSync(); // Unmap ports unmap(self:acPort, system:acPort); unmap(self:s11Port, system:s11Port); unmap(vc_sgw:acPort, system:acPort); unmap(vc_sgw:s11Port, system:s11Port); // Terminate component vc_sgw.done; } // End of function f_cf01_S11Down_MME Loading @@ -124,8 +132,12 @@ module LibGtpv2C_Configuration { unmap(vc_s1mme:s1MmePort, system:s11Port); } // Terminate components vc_sgw.done; if (PICS_SUPPORT_S1_MME_TRIGGERS) { vc_s1mme.done; } } // End of function f_cf01_S11Down_MME Loading @@ -140,6 +152,10 @@ module LibGtpv2C_Configuration { * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 3: Test configuration CF_SGW */ function f_cf01_S11Up_SGW() runs on Gtpv2CComponent { // Create component vc_mme := Gtpv2CComponent.create; // Map ports map(vc_mme:acPort, system:acPort); map(vc_mme:s11Port, system:s11Port); Loading @@ -150,10 +166,9 @@ module LibGtpv2C_Configuration { // Activate sync default for MTC activate(a_mtc_shutdown()); vc_mme := Gtpv2CComponent.create; vc_sequenceNumber := 0; vc_restartCounter := 0; vc_teidGreCounter := 0; } // End of function f_cf01_S11Up_SGW /** Loading @@ -168,6 +183,11 @@ module LibGtpv2C_Configuration { * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 4: Test configuration CF_SGW_PGW */ function f_cf02_S11Up_SGW() runs on Gtpv2CComponent { // Create components vc_s5 := Gtpv2CComponent.create; vc_mme := Gtpv2CComponent.create; // Map ports map(vc_mme:acPort, system:acPort); map(vc_mme:s11Port, system:s11Port); Loading @@ -180,11 +200,9 @@ module LibGtpv2C_Configuration { activate(a_mtc_shutdown()); activate(a_s5_default()); vc_s5 := Gtpv2CComponent.create; vc_mme := Gtpv2CComponent.create; vc_sequenceNumber := 0; vc_restartCounter := 0; vc_teidGreCounter := 0; } // End of function f_cf02_S11Up_SGW /** Loading @@ -200,6 +218,12 @@ module LibGtpv2C_Configuration { * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 5: Test configuration CF_SGW_PGW_SGSN */ function f_cf03_S11Up_SGW() runs on Gtpv2CComponent { // Create components vc_mme := Gtpv2CComponent.create; vc_s4 := Gtpv2CComponent.create; vc_s5 := Gtpv2CComponent.create; // Map ports map(vc_mme:acPort, system:acPort); map(vc_mme:s11Port, system:s11Port); Loading @@ -214,12 +238,9 @@ module LibGtpv2C_Configuration { activate(a_s4_default()); activate(a_s5_default()); vc_s4 := Gtpv2CComponent.create; vc_s5 := Gtpv2CComponent.create; vc_mme := Gtpv2CComponent.create; vc_sequenceNumber := 0; vc_restartCounter := 0; vc_teidGreCounter := 0; } // End of function f_cf03_S11Up_SGW /** Loading @@ -239,6 +260,7 @@ module LibGtpv2C_Configuration { unmap(vc_mme:acPort, system:acPort); unmap(vc_mme:s11Port, system:s11Port); // Terminate component vc_mme.done; } // End of function f_cf01_S11Down_SGW Loading @@ -261,6 +283,7 @@ module LibGtpv2C_Configuration { unmap(vc_mme:s11Port, system:s11Port); unmap(vc_s5:s5Port, system:s5Port); // Terminate components vc_s5.done; vc_mme.done; Loading @@ -285,9 +308,10 @@ module LibGtpv2C_Configuration { unmap(vc_s4:s4Port, system:s4Port); unmap(vc_s5:s5Port, system:s5Port); // Terminate components vc_mme.done; vc_s4.done; vc_s5.done; vc_mme.done; } // End of function f_cf03_S11Down_SGW Loading Loading @@ -354,20 +378,62 @@ module LibGtpv2C_Configuration { return vc_restartCounter; } // End of function f_getNextRestartCounter /** * @desc Increment and return the TEID/GRE counter * @return The new restart counter value * @verdict Unchanged */ function f_getNextTeidGre() runs on Gtpv2CComponent return UInt32 { vc_teidGreCounter := (vc_teidGreCounter + 1) mod c_uInt32Max; return vc_teidGreCounter; } // End of function f_getNextTeidGre group extractInformationElementFunctions { function f_extract_teid(in Gtpv2CPdu p_gtpv2Pdu) return Oct4 { // Sanity check if (not(ispresent(p_gtpv2Pdu.extHeader.teid))) { return '00000000'O; } group headers { function f_extract_teid(in Gtpv2CPdu p_gtpv2Pdu) return Oct4 { return p_gtpv2Pdu.extHeader.teid; } } // End of function f_extract_teid function f_extract_sequenceNumber(in Gtpv2CPdu p_gtpv2Pdu) return UInt24 { return p_gtpv2Pdu.extHeader.sequenceNumber; } } // End of function f_extract_sequenceNumber } // End of group headers group ieCreateSessionRequest { function f_extract_recovery(in Gtpv2CPdu p_gtpv2Pdu) return template (omit) Recovery { // Sanity check // if (not(ispresent(p_gtpv2Pdu.payload.ieCreateSessionRequest.recovery))) { // return omit; // } // return p_gtpv2Pdu.payload.ieCreateSessionRequest.recovery; } // End of function f_extract_recovery function f_extract_epsBearerId_from_createdBearerContext(in Gtpv2CPdu p_gtpv2Pdu) return template (omit) EpsBearerId { return p_gtpv2Pdu.payload.ieCreateSessionRequest.bearerContextsCreated.groupedIes.createdContextWithinCreateSessionRequest.linkedEpsBearerId; } // End of function f_extract_epsBearerId_from_createdBearerContext } // End of group ieCreateSessionRequest group ieCreateSessionResponse { function f_extract_chargingId_from_createdBearerContext(in Gtpv2CPdu p_gtpv2Pdu) return template (omit) ChargingId { return p_gtpv2Pdu.payload.ieCreateSessionResponse.bearerContextsCreated.groupedIes.createdContextWithinCreateSessionResponse.chargingId; } // End of function f_extract_chargingId_from_createdBearerContext function f_extract_s5_S8UPgw_from_createdBearerContext(in Gtpv2CPdu p_gtpv2Pdu) return template (omit) FullyQualifiedTeid { return p_gtpv2Pdu.payload.ieCreateSessionResponse.bearerContextsCreated.groupedIes.createdContextWithinCreateSessionResponse.s5_S8UPgw; } // End of function f_extract_chargingId_from_createdBearerContext } // End of group ieCreateSessionResponse function f_extract_digit(bitstring p_value, integer p_index) return Bit4 { return (p_value >> (p_index - 1) * 4) and4b '1111'B; } // End of function f_extract_digit } // End of group extractInformationElementFunctions Loading Loading
LibGtpv2C_Configuration.ttcn +95 −29 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ module LibGtpv2C_Configuration { // LibGtpv2C import from LibGtpv2C_TypesAndValues all; import from LibGtpv2C_TestSystem all; import from LibGtpv2C_Templates all; import from LibGtpv2C_Pics all; group configurationFunctions { Loading @@ -32,6 +31,10 @@ module LibGtpv2C_Configuration { * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 1: Test configuration CF_MME */ function f_cf01_S11Up_MME() runs on Gtpv2CComponent { // Create component vc_sgw := Gtpv2CComponent.create; // Map ports map(vc_sgw:acPort, system:acPort); map(vc_sgw:s11Port, system:s11Port); Loading @@ -42,10 +45,9 @@ module LibGtpv2C_Configuration { // Activate sync default for MTC activate(a_mtc_shutdown()); vc_sgw := Gtpv2CComponent.create; vc_sequenceNumber := 0; vc_restartCounter := 0; vc_teidGreCounter := 0; } // End of function f_cf01_S11Up_MME /** Loading @@ -60,6 +62,13 @@ module LibGtpv2C_Configuration { * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 2: Test configuration CF_MME_ENB */ function f_cf02_S11Up_MME() runs on Gtpv2CComponent { // Create components vc_sgw := Gtpv2CComponent.create; if (PICS_SUPPORT_S1_MME_TRIGGERS) { vc_s1mme := Gtpv2CComponent.create; } // Map ports map(vc_sgw:acPort, system:acPort); map(vc_sgw:s11Port, system:s11Port); Loading @@ -76,11 +85,9 @@ module LibGtpv2C_Configuration { activate(a_s1mme_default()); } vc_sgw := Gtpv2CComponent.create; vc_s1mme := Gtpv2CComponent.create; vc_sequenceNumber := 0; vc_restartCounter := 0; vc_teidGreCounter := 0; } // End of function f_cf02_S11Up_MME /** Loading @@ -97,9 +104,10 @@ module LibGtpv2C_Configuration { f_disconnect4SelfOrClientSync(); // Unmap ports unmap(self:acPort, system:acPort); unmap(self:s11Port, system:s11Port); unmap(vc_sgw:acPort, system:acPort); unmap(vc_sgw:s11Port, system:s11Port); // Terminate component vc_sgw.done; } // End of function f_cf01_S11Down_MME Loading @@ -124,8 +132,12 @@ module LibGtpv2C_Configuration { unmap(vc_s1mme:s1MmePort, system:s11Port); } // Terminate components vc_sgw.done; if (PICS_SUPPORT_S1_MME_TRIGGERS) { vc_s1mme.done; } } // End of function f_cf01_S11Down_MME Loading @@ -140,6 +152,10 @@ module LibGtpv2C_Configuration { * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 3: Test configuration CF_SGW */ function f_cf01_S11Up_SGW() runs on Gtpv2CComponent { // Create component vc_mme := Gtpv2CComponent.create; // Map ports map(vc_mme:acPort, system:acPort); map(vc_mme:s11Port, system:s11Port); Loading @@ -150,10 +166,9 @@ module LibGtpv2C_Configuration { // Activate sync default for MTC activate(a_mtc_shutdown()); vc_mme := Gtpv2CComponent.create; vc_sequenceNumber := 0; vc_restartCounter := 0; vc_teidGreCounter := 0; } // End of function f_cf01_S11Up_SGW /** Loading @@ -168,6 +183,11 @@ module LibGtpv2C_Configuration { * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 4: Test configuration CF_SGW_PGW */ function f_cf02_S11Up_SGW() runs on Gtpv2CComponent { // Create components vc_s5 := Gtpv2CComponent.create; vc_mme := Gtpv2CComponent.create; // Map ports map(vc_mme:acPort, system:acPort); map(vc_mme:s11Port, system:s11Port); Loading @@ -180,11 +200,9 @@ module LibGtpv2C_Configuration { activate(a_mtc_shutdown()); activate(a_s5_default()); vc_s5 := Gtpv2CComponent.create; vc_mme := Gtpv2CComponent.create; vc_sequenceNumber := 0; vc_restartCounter := 0; vc_teidGreCounter := 0; } // End of function f_cf02_S11Up_SGW /** Loading @@ -200,6 +218,12 @@ module LibGtpv2C_Configuration { * @reference ETSI TS 103 202-3 V0.0.2 (2015-06) Figure 5: Test configuration CF_SGW_PGW_SGSN */ function f_cf03_S11Up_SGW() runs on Gtpv2CComponent { // Create components vc_mme := Gtpv2CComponent.create; vc_s4 := Gtpv2CComponent.create; vc_s5 := Gtpv2CComponent.create; // Map ports map(vc_mme:acPort, system:acPort); map(vc_mme:s11Port, system:s11Port); Loading @@ -214,12 +238,9 @@ module LibGtpv2C_Configuration { activate(a_s4_default()); activate(a_s5_default()); vc_s4 := Gtpv2CComponent.create; vc_s5 := Gtpv2CComponent.create; vc_mme := Gtpv2CComponent.create; vc_sequenceNumber := 0; vc_restartCounter := 0; vc_teidGreCounter := 0; } // End of function f_cf03_S11Up_SGW /** Loading @@ -239,6 +260,7 @@ module LibGtpv2C_Configuration { unmap(vc_mme:acPort, system:acPort); unmap(vc_mme:s11Port, system:s11Port); // Terminate component vc_mme.done; } // End of function f_cf01_S11Down_SGW Loading @@ -261,6 +283,7 @@ module LibGtpv2C_Configuration { unmap(vc_mme:s11Port, system:s11Port); unmap(vc_s5:s5Port, system:s5Port); // Terminate components vc_s5.done; vc_mme.done; Loading @@ -285,9 +308,10 @@ module LibGtpv2C_Configuration { unmap(vc_s4:s4Port, system:s4Port); unmap(vc_s5:s5Port, system:s5Port); // Terminate components vc_mme.done; vc_s4.done; vc_s5.done; vc_mme.done; } // End of function f_cf03_S11Down_SGW Loading Loading @@ -354,20 +378,62 @@ module LibGtpv2C_Configuration { return vc_restartCounter; } // End of function f_getNextRestartCounter /** * @desc Increment and return the TEID/GRE counter * @return The new restart counter value * @verdict Unchanged */ function f_getNextTeidGre() runs on Gtpv2CComponent return UInt32 { vc_teidGreCounter := (vc_teidGreCounter + 1) mod c_uInt32Max; return vc_teidGreCounter; } // End of function f_getNextTeidGre group extractInformationElementFunctions { function f_extract_teid(in Gtpv2CPdu p_gtpv2Pdu) return Oct4 { // Sanity check if (not(ispresent(p_gtpv2Pdu.extHeader.teid))) { return '00000000'O; } group headers { function f_extract_teid(in Gtpv2CPdu p_gtpv2Pdu) return Oct4 { return p_gtpv2Pdu.extHeader.teid; } } // End of function f_extract_teid function f_extract_sequenceNumber(in Gtpv2CPdu p_gtpv2Pdu) return UInt24 { return p_gtpv2Pdu.extHeader.sequenceNumber; } } // End of function f_extract_sequenceNumber } // End of group headers group ieCreateSessionRequest { function f_extract_recovery(in Gtpv2CPdu p_gtpv2Pdu) return template (omit) Recovery { // Sanity check // if (not(ispresent(p_gtpv2Pdu.payload.ieCreateSessionRequest.recovery))) { // return omit; // } // return p_gtpv2Pdu.payload.ieCreateSessionRequest.recovery; } // End of function f_extract_recovery function f_extract_epsBearerId_from_createdBearerContext(in Gtpv2CPdu p_gtpv2Pdu) return template (omit) EpsBearerId { return p_gtpv2Pdu.payload.ieCreateSessionRequest.bearerContextsCreated.groupedIes.createdContextWithinCreateSessionRequest.linkedEpsBearerId; } // End of function f_extract_epsBearerId_from_createdBearerContext } // End of group ieCreateSessionRequest group ieCreateSessionResponse { function f_extract_chargingId_from_createdBearerContext(in Gtpv2CPdu p_gtpv2Pdu) return template (omit) ChargingId { return p_gtpv2Pdu.payload.ieCreateSessionResponse.bearerContextsCreated.groupedIes.createdContextWithinCreateSessionResponse.chargingId; } // End of function f_extract_chargingId_from_createdBearerContext function f_extract_s5_S8UPgw_from_createdBearerContext(in Gtpv2CPdu p_gtpv2Pdu) return template (omit) FullyQualifiedTeid { return p_gtpv2Pdu.payload.ieCreateSessionResponse.bearerContextsCreated.groupedIes.createdContextWithinCreateSessionResponse.s5_S8UPgw; } // End of function f_extract_chargingId_from_createdBearerContext } // End of group ieCreateSessionResponse function f_extract_digit(bitstring p_value, integer p_index) return Bit4 { return (p_value >> (p_index - 1) * 4) and4b '1111'B; } // End of function f_extract_digit } // End of group extractInformationElementFunctions Loading