pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37645?usp=email )
Change subject: library/GTPv1U_Templates: Mark parameters as templates ......................................................................
library/GTPv1U_Templates: Mark parameters as templates
Change-Id: I278f7dbc64704c1ba2b8a75d6f540ac52b067598 --- M library/GTPv1C_Templates.ttcn M library/GTPv1U_Templates.ttcn 2 files changed, 44 insertions(+), 31 deletions(-)
Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve
diff --git a/library/GTPv1C_Templates.ttcn b/library/GTPv1C_Templates.ttcn index 33efb3a..893ab01 100644 --- a/library/GTPv1C_Templates.ttcn +++ b/library/GTPv1C_Templates.ttcn @@ -129,7 +129,10 @@ }
/* generalized GTP-C send template */ - template (value) PDU_GTPC ts_GTP1C_PDU(OCT1 msg_type, OCT4 teid, GTPC_PDUs pdu, uint16_t seq_nr) := { + template (value) PDU_GTPC ts_GTP1C_PDU(template (value) OCT1 msg_type, + template (value) OCT4 teid, + template (value) GTPC_PDUs pdu, + template (value) uint16_t seq_nr) := { /* N-PDU Number flag (PN) shall be set to '0'. A GTP-C receiver shall not return an * error if this flag is set to '1'. */ pn_bit := '0'B, @@ -145,7 +148,7 @@ lengthf := 0, /* we assume encoder overwrites this */ teid := teid, opt_part := { - sequenceNumber := int2oct(seq_nr, 2), + sequenceNumber := int2oct(valueof(seq_nr), 2), npduNumber := '00'O, nextExtHeader := '00'O, gTPC_extensionHeader_List := omit @@ -783,11 +786,7 @@ type_gtpc := '00'O, teidControlPlane := teid_ctrl }, - nsapi := { - type_gtpc := '00'O, - nsapi := nsapi, - unused := '0000'B - }, + nsapi := ts_NSAPI(nsapi), linked_nsapi := omit, charging_char := f_ts_ChargingCharacteristics(charging_char), trace_ref := omit, @@ -860,11 +859,7 @@ type_gtpc := '00'O, teidControlPlane := teid_ctrl }, - nsapi := { - type_gtpc := '00'O, - nsapi := nsapi, - unused := '0000'B - }, + nsapi := ts_NSAPI(nsapi), trace_ref := omit, trace_type := omit, protConfigOptions := pco, @@ -908,7 +903,7 @@ }
- template (value) NSAPI_GTPC ts_NSAPI(BIT4 nsapi) := { + template (value) NSAPI_GTPC ts_NSAPI(template (value) BIT4 nsapi) := { type_gtpc := '14'O, nsapi := nsapi, unused := '0000'B @@ -1209,11 +1204,7 @@ deletePDPContextRequest := { cause := omit, tearDownIndicator := f_teardown_ind_IE(teardown_ind), - nsapi := { - type_gtpc := '14'O, - nsapi := nsapi, - unused := '0000'B - }, + nsapi := ts_NSAPI(nsapi), protConfigOptions := omit, userLocationInformation := omit, mS_TimeZone := omit, diff --git a/library/GTPv1U_Templates.ttcn b/library/GTPv1U_Templates.ttcn index a31e1d2..86d2401 100644 --- a/library/GTPv1U_Templates.ttcn +++ b/library/GTPv1U_Templates.ttcn @@ -55,7 +55,10 @@ }
/* generalized GTP-U send template */ - template (value) PDU_GTPU ts_GTP1U_PDU(OCT1 msg_type, template (omit) uint16_t seq, OCT4 teid, GTPU_IEs ies) := { + template (value) PDU_GTPU ts_GTP1U_PDU(template (value) OCT1 msg_type, + template (omit) uint16_t seq, + template (value) OCT4 teid, + template (value) GTPU_IEs ies) := { /* N-PDU Number flag (PN): the GTP-U header contains a meaningful N-PDU Number field if the PN * flag is set to 1. */ pn_bit := '0'B, /* we assume the encoder overwrites this if an optional part is given */ @@ -113,12 +116,13 @@ }
/* master template for sending a GTP-C echo request */ - template (value) Gtp1uUnitdata ts_GTPU_PING(Gtp1uPeer peer, uint16_t seq) := { + template (value) Gtp1uUnitdata ts_GTPU_PING(template (value) Gtp1uPeer peer, + template (value) uint16_t seq) := { peer := peer, - gtpu := ts_GTP1U_PDU('01'O, seq, '00000000'O, valueof(ts_UEchoReqPDU)) + gtpu := ts_GTP1U_PDU('01'O, seq, '00000000'O, ts_UEchoReqPDU) }
- template GTPU_IEs ts_UEchoRespPDU(OCT1 restart_counter) := { + template GTPU_IEs ts_UEchoRespPDU(template (value) OCT1 restart_counter) := { echoResponse_IEs := { recovery_gtpu := { type_gtpu := '00'O, /* we assume encoder fixes? */ @@ -129,23 +133,26 @@ }
/* master template for sending a GTP-U echo response */ - template (present) Gtp1uUnitdata ts_GTPU_PONG(Gtp1uPeer peer, uint16_t seq, OCT1 rest_ctr) := { + template (present) Gtp1uUnitdata ts_GTPU_PONG(template (value) Gtp1uPeer peer, + template (value) uint16_t seq, + template (value) OCT1 rest_ctr) := { peer := peer, - gtpu := ts_GTP1U_PDU('02'O, seq, '00000000'O, valueof(ts_UEchoRespPDU(rest_ctr))) + gtpu := ts_GTP1U_PDU('02'O, seq, '00000000'O, ts_UEchoRespPDU(rest_ctr)) }
- template (value) GSNAddress_gtpu ts_UGsnAddr(octetstring ip_addr) := { + template (value) GSNAddress_gtpu ts_UGsnAddr(template (value) octetstring ip_addr) := { type_gtpu := '85'O, - lengthf := lengthof(ip_addr), + lengthf := lengthof(valueof(ip_addr)), gSNAddressValue := ip_addr }
- template (value) TeidDataI_gtpu ts_UteidDataI(OCT4 teid) := { + template (value) TeidDataI_gtpu ts_UteidDataI(template (value) OCT4 teid) := { type_gtpu := '10'O, teidDataI := teid }
- template (value) GTPU_IEs ts_UErrorIndication(OCT4 teid, octetstring gsn_addr) := { + template (value) GTPU_IEs ts_UErrorIndication(template (value) OCT4 teid, + template (value) octetstring gsn_addr) := { errorIndication_IEs := { teidDataI_gtpu := ts_UteidDataI(teid), gSNAddress_gtpu := ts_UGsnAddr(gsn_addr), @@ -154,13 +161,19 @@ }
/* master template for sending a GTP-U Error indication */ - template (value) Gtp1uUnitdata ts_GTPU_ErrorIndication(Gtp1uPeer peer, uint16_t seq, OCT4 teid, octetstring gsn_addr) := { + template (value) Gtp1uUnitdata ts_GTPU_ErrorIndication(template (value) Gtp1uPeer peer, + template (value) uint16_t seq, + template (value) OCT4 teid, + template (value) octetstring gsn_addr) := { peer := peer, - gtpu := ts_GTP1U_PDU('1A'O, seq, '00000000'O, valueof(ts_UErrorIndication(teid, gsn_addr))) + gtpu := ts_GTP1U_PDU('1A'O, seq, '00000000'O, ts_UErrorIndication(teid, gsn_addr)) }
/* master template for sending a GTP-U user plane data */ - template (value) Gtp1uUnitdata ts_GTP1U_GPDU(Gtp1uPeer peer, template (omit) uint16_t seq, OCT4 teid, octetstring data) := { + template (value) Gtp1uUnitdata ts_GTP1U_GPDU(template (value) Gtp1uPeer peer, + template (omit) uint16_t seq, + template (value) OCT4 teid, + template (value) octetstring data) := { peer := peer, gtpu := ts_GTP1U_PDU('FF'O, seq, teid, { g_PDU_IEs := { data := data }}) }