Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte2018-03-27 17:00:50 +0000
committerHarald Welte2018-04-14 20:05:42 +0000
commitdfa7a7ee25d3bf4544943042cfb1b9c2c8a39613 (patch)
tree77f040be73491c048282f25e306106ae14cfd233
parent1ba0d3b81dbdd2a09267b14686b3450cbf055ff3 (diff)
downloadtitan.ProtocolEmulations.M3UA-dfa7a7ee25d3bf4544943042cfb1b9c2c8a39613.tar.gz
titan.ProtocolEmulations.M3UA-dfa7a7ee25d3bf4544943042cfb1b9c2c8a39613.tar.xz
titan.ProtocolEmulations.M3UA-dfa7a7ee25d3bf4544943042cfb1b9c2c8a39613.zip
Make M3UA Routing Context / Routing Key configurable
The existing M3UA emulation didn't use any routing context IE, and rather let the STP/peer implicitly chose it. With this patch, it's possible to explicitly specify a routing context, which will then be used in the ASPAC and TRANSFER messages. Change-Id: I82d03cda2072b364782723b47d82c3074db4a1c7 Signed-off-by: Harald Welte <laforge@gnumonks.org>
-rw-r--r--src/M3UA_Emulation.ttcn21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/M3UA_Emulation.ttcn b/src/M3UA_Emulation.ttcn
index 8c73a26..314908e 100644
--- a/src/M3UA_Emulation.ttcn
+++ b/src/M3UA_Emulation.ttcn
@@ -53,6 +53,7 @@ type record M3UA_Entity
{
M3UA_CommStatus commStatus optional,
integer sCTP_Assoc_ID optional,
+ M3UA_Routing_Context rctx optional,
SCTP_Association_Address assoc
}
@@ -461,11 +462,23 @@ template M3UA_Protocol_Data t_M3UA_Protocol_Data
// Dynamic part of the M3UA emulation
//***********************************
-function f_M3UA_Emulation(SCTP_Association_Address pl_Boot) runs on M3UA_CT
+private template (value) M3UA_Routing_Context t_RoutingContext(OCT4 rctx) := {
+ tag := '0006'O,
+ lengthInd := 8,
+ routingContext := rctx
+}
+
+function f_M3UA_Emulation(SCTP_Association_Address pl_Boot,
+ template (omit) integer rctx := omit) runs on M3UA_CT
{
// Initialize parameters from the test case.
v_Entity.assoc := pl_Boot;
v_Entity.commStatus := aSP_Down_initial_State;
+ if (istemplatekind(rctx, "omit")) {
+ v_Entity.rctx := omit;
+ } else {
+ v_Entity.rctx := valueof(t_RoutingContext(int2oct(valueof(rctx), 4)));
+ }
// At this point, we assume that the ports are already connected and mapped
// properly by the user.
@@ -581,7 +594,7 @@ function f_Send_MTP3_TRANSFERreq(ASP_MTP3_TRANSFERreq pl_ASP_MTP3_TRANSFERreq)
(valueof
(t_PDU_M3UA_DATA
(omit,
- omit,
+ v_Entity.rctx,
t_M3UA_Protocol_Data
(int2oct(pl_ASP_MTP3_TRANSFERreq.opc, 4), // OPC
int2oct(pl_ASP_MTP3_TRANSFERreq.dpc, 4), // DPC
@@ -871,7 +884,7 @@ altstep as_handleM3UA_timers() runs on M3UA_CT
(t_S_SCTP_Send
(v_Entity.sCTP_Assoc_ID,
0,
- enc_PDU_M3UA(valueof(t_PDU_M3UA_ASPAC(omit, omit, omit))),
+ enc_PDU_M3UA(valueof(t_PDU_M3UA_ASPAC(omit, v_Entity.rctx, omit))),
tsp_SCTP_PayloadProtocolID));
v_Entity.commStatus := aSP_Inact_ASPAC_Sent;
if (tsp_logVerbose) {
@@ -1136,7 +1149,7 @@ function f_handle_M3UA_msg(PDU_M3UA pl_PDU_M3UA) runs on M3UA_CT
(t_S_SCTP_Send
(v_Entity.sCTP_Assoc_ID,
0,
- enc_PDU_M3UA(valueof(t_PDU_M3UA_ASPAC(omit, omit, omit))),
+ enc_PDU_M3UA(valueof(t_PDU_M3UA_ASPAC(omit, v_Entity.rctx, omit))),
tsp_SCTP_PayloadProtocolID));
// The state changes again after sending the M3UA_ASPAC message.
v_Entity.commStatus := aSP_Inact_ASPAC_Sent;

Back to the top