pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37953?usp=email )
Change subject: PFCP_Emulation: respond to incoming Heartbeat Req ......................................................................
PFCP_Emulation: respond to incoming Heartbeat Req
This is a mandatory procedure that every 3GPP TS 29.244 compliant peer shall support.
Change-Id: I93990feb1864701e2903af85480093ef751bafe5 Related: SYS#6772 --- M library/PFCP_CodecPort.ttcn M library/PFCP_Emulation.ttcn 2 files changed, 16 insertions(+), 1 deletion(-)
Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved laforge: Looks good to me, but someone else must approve
diff --git a/library/PFCP_CodecPort.ttcn b/library/PFCP_CodecPort.ttcn index 8d4078d..783ffb0 100644 --- a/library/PFCP_CodecPort.ttcn +++ b/library/PFCP_CodecPort.ttcn @@ -26,6 +26,12 @@ PDU_PFCP pdu }
+template (present) PFCP_Unitdata +tr_PFCP_UD(template (present) PDU_PFCP pdu := ?) := { + peer := ?, + pdu := pdu +} + /* Translation port on top of IPL4asp; ASP_Event passed through transparently */ type port PFCP_PT message { out PFCP_Unitdata; diff --git a/library/PFCP_Emulation.ttcn b/library/PFCP_Emulation.ttcn index d872367..2fb3a8a 100644 --- a/library/PFCP_Emulation.ttcn +++ b/library/PFCP_Emulation.ttcn @@ -15,6 +15,7 @@ import from General_Types all; import from Osmocom_Types all; import from PFCP_Types all; +import from PFCP_Templates all; import from PFCP_CodecPort all; import from PFCP_CodecPort_CtrlFunct all;
@@ -123,7 +124,15 @@
while (true) { alt { - [] PFCP.receive(PFCP_Unitdata:?) -> value ud { + [] PFCP.receive(tr_PFCP_UD(tr_PFCP_Heartbeat_Req)) -> value ud { + log("Rx Heartbeat Req: ", ud.pdu); + pdu := valueof(ts_PFCP_Heartbeat_Resp(g_recovery_timestamp)); + pdu.sequence_number := ud.pdu.sequence_number; + ud.pdu := pdu; + PFCP.send(ud); + } + + [] PFCP.receive(tr_PFCP_UD(?)) -> value ud { log("PFCP_Emulation main() PFCP.receive: ", ud); vc_conn := null; if (ud.pdu.s_flag == '1'B) {