laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34087 )
Change subject: GTP_Templates: add template restriction qualifiers ......................................................................
GTP_Templates: add template restriction qualifiers
The GTP Templates lack the template restriction qualifiers (present, value, omit) in many places.
Related: OS#6095 Change-Id: Ic439b4ae85b417fde0ddfb8fa00758d6486b57c8 --- M library/GTP_Templates.ttcn 1 file changed, 195 insertions(+), 177 deletions(-)
Approvals: pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn index ebd9142..5ead042 100644 --- a/library/GTP_Templates.ttcn +++ b/library/GTP_Templates.ttcn @@ -64,7 +64,7 @@ }
/* generalized GTP-C receive template */ - template PDU_GTPC tr_GTP1C_PDU(template OCT1 msg_type, template OCT4 teid, template GTPC_PDUs pdu := ?) := { + template (present) PDU_GTPC tr_GTP1C_PDU(template (present) OCT1 msg_type, template (present) OCT4 teid, template (present) GTPC_PDUs pdu := ?) := { /* 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, @@ -84,7 +84,7 @@ }
/* generalized GTP-C send template */ - template PDU_GTPC ts_GTP1C_PDU(OCT1 msg_type, OCT4 teid, GTPC_PDUs pdu, uint16_t seq_nr) := { + template (value) PDU_GTPC ts_GTP1C_PDU(OCT1 msg_type, OCT4 teid, GTPC_PDUs pdu, 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, @@ -109,18 +109,18 @@ }
/* recovery IE */ - template Recovery_gtpc ts_Recovery(OCT1 restart_counter) := { + template (value) Recovery_gtpc ts_Recovery(OCT1 restart_counter) := { type_gtpc := '0E'O, restartCounter := restart_counter }
- template Recovery_gtpc tr_Recovery(template OCT1 restart_counter) := { + template (present) Recovery_gtpc tr_Recovery(template (present) OCT1 restart_counter) := { type_gtpc := '0E'O, restartCounter := restart_counter }
/* IMEI(SV) IE TS 29.060 7.7.53 */ - template IMEISV_gtpc ts_IMEISV(template (value) OCT8 imeisv) := { + template (value) IMEISV_gtpc ts_IMEISV(template (value) OCT8 imeisv) := { type_gtpc := '9A'O, lengthf := 8, imeisv := imeisv @@ -133,7 +133,7 @@ return ts_IMEISV(imeisv); }
- template IMEISV_gtpc tr_IMEISV(template (present) OCT8 imeisv) := { + template (present) IMEISV_gtpc tr_IMEISV(template (present) OCT8 imeisv) := { type_gtpc := '9A'O, lengthf := 8, imeisv := imeisv @@ -176,7 +176,7 @@ }
/* Charging Characteristics IE TS 29.060 7.7.23 */ - template ChargingCharacteristics_GTPC ts_ChargingCharacteristics(template (value) OCT2 chargingChar) := { + template (value) ChargingCharacteristics_GTPC ts_ChargingCharacteristics(template (value) OCT2 chargingChar) := { type_gtpc := '1A'O, chargingChar := chargingChar } @@ -188,22 +188,25 @@ return ts_ChargingCharacteristics(chargingChar); }
- template ChargingCharacteristics_GTPC tr_ChargingCharacteristics(template (present) OCT2 chargingChar) := { + template (present) ChargingCharacteristics_GTPC tr_ChargingCharacteristics(template (present) OCT2 chargingChar) := { type_gtpc := '1A'O, chargingChar := chargingChar }
/* template matching reception of GTP-C unit-data */ - template Gtp1cUnitdata tr_GTPC_MsgType(template GtpPeer peer, template OCT1 msg_type, template OCT4 teid, template GTPC_PDUs pdus := ?) := { + template (present) Gtp1cUnitdata tr_GTPC_MsgType(template (present) GtpPeer peer, + template (present) OCT1 msg_type, + template (present) OCT4 teid, + template (present) GTPC_PDUs pdus := ?) := { peer := peer, gtpc := tr_GTP1C_PDU(msg_type, teid, pdus) }
/* template matching reception of GTP-C echo-request */ - template Gtp1cUnitdata tr_GTPC_PING(template GtpPeer peer) := tr_GTPC_MsgType(peer, echoRequest, '00000000'O); + template (present) Gtp1cUnitdata tr_GTPC_PING(template (present) GtpPeer peer) := tr_GTPC_MsgType(peer, echoRequest, '00000000'O);
- template GTPC_PDUs tr_EchoRespPDU(template OCT1 restart_counter) := { + template (present) GTPC_PDUs tr_EchoRespPDU(template (present) OCT1 restart_counter) := { echoResponse := { recovery := tr_Recovery(restart_counter), private_extension_gtpc := * @@ -211,9 +214,9 @@ }
/* template matching reception of GTP-C echo-response */ - template Gtp1cUnitdata tr_GTPC_PONG(template GtpPeer peer) := tr_GTPC_MsgType(peer, echoResponse, '00000000'O, tr_EchoRespPDU(?)); + template (present) Gtp1cUnitdata tr_GTPC_PONG(template (present) GtpPeer peer) := tr_GTPC_MsgType(peer, echoResponse, '00000000'O, tr_EchoRespPDU(?));
- template GTPC_PDUs ts_EchoRespPDU(OCT1 restart_counter) := { + template (value) GTPC_PDUs ts_EchoRespPDU(OCT1 restart_counter) := { echoResponse := { recovery := ts_Recovery(restart_counter), private_extension_gtpc := omit @@ -221,24 +224,24 @@ }
/* master template for senidng a GTP-C echo response */ - template Gtp1cUnitdata ts_GTPC_PONG(GtpPeer peer, uint16_t seq, OCT1 rest_ctr) := { + template (value) Gtp1cUnitdata ts_GTPC_PONG(GtpPeer peer, uint16_t seq, OCT1 rest_ctr) := { peer := peer, gtpc := ts_GTP1C_PDU(echoResponse, '00000000'O, valueof(ts_EchoRespPDU(rest_ctr)), seq) }
- template GTPC_PDUs ts_EchoReqPDU := { + template (value) GTPC_PDUs ts_EchoReqPDU := { echoRequest := { private_extension_gtpc := omit } }
/* master template for sending a GTP-C echo request */ - template Gtp1cUnitdata ts_GTPC_PING(GtpPeer peer, uint16_t seq) := { + template (value) Gtp1cUnitdata ts_GTPC_PING(GtpPeer peer, uint16_t seq) := { peer := peer, gtpc := ts_GTP1C_PDU(echoRequest, '00000000'O, valueof(ts_EchoReqPDU), seq) }
- private function f_eua_ipv4_len(template OCT4 ip_addr) return template integer { + private function f_eua_ipv4_len(template (present) OCT4 ip_addr) return template integer { if (istemplatekind(ip_addr, "omit")) { return 2; } else if (istemplatekind(ip_addr, "*")) { @@ -249,7 +252,7 @@ return 6; }
- private function f_eua_ipv6_len(template OCT16 ip_addr) return template integer { + private function f_eua_ipv6_len(template (omit) OCT16 ip_addr) return template (present) integer { if (istemplatekind(ip_addr, "omit")) { return 2; } else if (istemplatekind(ip_addr, "*")) { @@ -260,7 +263,7 @@ return 18; }
- private function f_eua_ipv4v6_len(template OCT4 ip_addr4, template OCT16 ip_addr6) return template integer { + private function f_eua_ipv4v6_len(template (omit) OCT4 ip_addr4, template (omit) OCT16 ip_addr6) return template (present) integer { var integer len := 2; if (istemplatekind(ip_addr4, "*") or istemplatekind(ip_addr6, "*")) { @@ -288,7 +291,7 @@ } } template EndUserAddress t_EuaIPv4Dyn := t_EuaIPv4(omit); - template EndUserAddress tr_EuaIPv4(template OCT4 ip_addr) modifies t_EuaIPv4 := { + template (present) EndUserAddress tr_EuaIPv4(template (present) OCT4 ip_addr) modifies t_EuaIPv4 := { endUserAddress := { endUserAddressIPv4 := { lengthf := f_eua_ipv4_len(ip_addr) @@ -309,7 +312,7 @@ } } template EndUserAddress t_EuaIPv6Dyn := t_EuaIPv6(omit); - template EndUserAddress tr_EuaIPv6(template OCT16 ip_addr) modifies t_EuaIPv6 := { + template (present) EndUserAddress tr_EuaIPv6(template (present) OCT16 ip_addr) modifies t_EuaIPv6 := { endUserAddress := { endUserAddressIPv6 := { lengthf := f_eua_ipv6_len(ip_addr) @@ -332,7 +335,8 @@ } } template EndUserAddress t_EuaIPv4Dynv6Dyn := t_EuaIPv4v6(omit, omit); - template EndUserAddress tr_EuaIPv4v6(template OCT4 ip_addr4, template OCT16 ip_addr6) modifies t_EuaIPv4v6 := { + template (present) EndUserAddress tr_EuaIPv4v6(template (present) OCT4 ip_addr4, + template (present) OCT16 ip_addr6) modifies t_EuaIPv4v6 := { endUserAddress := { endUserAddressIPv4andIPv6 := { lengthf := f_eua_ipv4v6_len(ip_addr4, ip_addr6) @@ -340,25 +344,25 @@ } }
- template AccessPointName ts_APN(octetstring apn) := { + template (value) AccessPointName ts_APN(octetstring apn) := { type_gtpc := '83'O, lengthf := lengthof(apn), apn_value := apn }
- template GSN_Address_GTPC ts_GsnAddr(octetstring ip_addr) := { + template (value) GSN_Address_GTPC ts_GsnAddr(octetstring ip_addr) := { type_gtpc := '85'O, lengthf := lengthof(ip_addr), addressf := ip_addr }
- template MSISDN ts_Msisdn(octetstring msisdn) := { + template (value) MSISDN ts_Msisdn(octetstring msisdn) := { type_gtpc := '86'O, lengthf := lengthof(msisdn), msisdn := msisdn }
- template QualityOfServiceProfile ts_QosDefault := { + template (value) QualityOfServiceProfile ts_QosDefault := { type_gtpc := '87'O, lengthf := 17, allocRetensionPrio := '00'O, @@ -393,7 +397,7 @@ } }
- template IMSI_gtpc ts_Imsi(hexstring digits) := { + template (value) IMSI_gtpc ts_Imsi(hexstring digits) := { type_gtpc := '02'O, digits := digits, padding := 'F'H @@ -415,9 +419,9 @@
template (value) GeographicLocationCGI ts_GeographicLocationCGI(template (value) hexstring mcc, - template (value) hexstring mnc, - template (value) OCT2 lac, - template (value) OCT2 cI_value) := + template (value) hexstring mnc, + template (value) OCT2 lac, + template (value) OCT2 cI_value) := { mccDigit1 := mcc[0], mccDigit2 := mcc[1], @@ -429,15 +433,15 @@ cI_value := cI_value }
- template GTPC_PDUs ts_CreatePdpPDU(hexstring imsi, OCT1 restart_ctr, OCT4 teid_data, OCT4 teid_ctrl, - BIT4 nsapi, EndUserAddress eua, octetstring apn, - octetstring sgsn_ip_sign, octetstring sgsn_ip_data, - octetstring msisdn, template ProtConfigOptions pco := omit, - template (omit) OCT1 ratType := omit, - template (omit) UserLocationInformation uli := omit, - template (omit) OCT2 charging_char := omit, - template (omit) OCT8 imeisv := omit, - template(omit) MS_TimeZone ms_tz := omit) := { + template (value) GTPC_PDUs ts_CreatePdpPDU(hexstring imsi, OCT1 restart_ctr, OCT4 teid_data, OCT4 teid_ctrl, + BIT4 nsapi, EndUserAddress eua, octetstring apn, + octetstring sgsn_ip_sign, octetstring sgsn_ip_data, + octetstring msisdn, template (omit) ProtConfigOptions pco := omit, + template (omit) OCT1 ratType := omit, + template (omit) UserLocationInformation uli := omit, + template (omit) OCT2 charging_char := omit, + template (omit) OCT8 imeisv := omit, + template (omit) MS_TimeZone ms_tz := omit) := { createPDPContextRequest := { imsi := ts_Imsi(imsi), rai := omit, @@ -493,17 +497,17 @@ } }
- template Gtp1cUnitdata ts_GTPC_CreatePDP(GtpPeer peer, uint16_t seq, hexstring imsi, - OCT1 restart_ctr, OCT4 teid_data, - OCT4 teid_ctrl, BIT4 nsapi, EndUserAddress eua, - octetstring apn, octetstring sgsn_ip_sign, - octetstring sgsn_ip_data, octetstring msisdn, - template ProtConfigOptions pco := omit, - template (omit) OCT1 ratType := omit, - template (omit) UserLocationInformation uli := omit, - template (omit) OCT2 charging_char := omit, - template (omit) OCT8 imeisv := omit, - template(omit) MS_TimeZone ms_tz := omit) := { + template (value) Gtp1cUnitdata ts_GTPC_CreatePDP(GtpPeer peer, uint16_t seq, hexstring imsi, + OCT1 restart_ctr, OCT4 teid_data, + OCT4 teid_ctrl, BIT4 nsapi, EndUserAddress eua, + octetstring apn, octetstring sgsn_ip_sign, + octetstring sgsn_ip_data, octetstring msisdn, + template (omit) ProtConfigOptions pco := omit, + template (omit) OCT1 ratType := omit, + template (omit) UserLocationInformation uli := omit, + template (omit) OCT2 charging_char := omit, + template (omit) OCT8 imeisv := omit, + template (omit) MS_TimeZone ms_tz := omit) := { peer := peer, gtpc := ts_GTP1C_PDU(createPDPContextRequest, '00000000'O, valueof(ts_CreatePdpPDU(imsi, restart_ctr, teid_data, teid_ctrl, @@ -513,12 +517,12 @@ }
- template GTPC_PDUs ts_UpdatePdpPDU(hexstring imsi, OCT1 restart_ctr, OCT4 teid_data, OCT4 teid_ctrl, - BIT4 nsapi, - octetstring sgsn_ip_sign, octetstring sgsn_ip_data, - template ProtConfigOptions pco := omit, - template (omit) OCT1 ratType := omit, - template (omit) UserLocationInformation uli := omit) := { + template (value) GTPC_PDUs ts_UpdatePdpPDU(hexstring imsi, OCT1 restart_ctr, OCT4 teid_data, OCT4 teid_ctrl, + BIT4 nsapi, + octetstring sgsn_ip_sign, octetstring sgsn_ip_data, + template (omit) ProtConfigOptions pco := omit, + template (omit) OCT1 ratType := omit, + template (omit) UserLocationInformation uli := omit) := { updatePDPContextRequest := { updatePDPContextRequestSGSN := { imsi := ts_Imsi(imsi), @@ -565,13 +569,13 @@ } }
- template Gtp1cUnitdata ts_GTPC_UpdatePDP(GtpPeer peer, OCT4 teid, uint16_t seq, hexstring imsi, - OCT1 restart_ctr, OCT4 teid_data, - OCT4 teid_ctrl, BIT4 nsapi, octetstring sgsn_ip_sign, - octetstring sgsn_ip_data, - template ProtConfigOptions pco := omit, - template (omit) OCT1 ratType := omit, - template (omit) UserLocationInformation uli := omit) := { + template (value) Gtp1cUnitdata ts_GTPC_UpdatePDP(GtpPeer peer, OCT4 teid, uint16_t seq, hexstring imsi, + OCT1 restart_ctr, OCT4 teid_data, + OCT4 teid_ctrl, BIT4 nsapi, octetstring sgsn_ip_sign, + octetstring sgsn_ip_data, + template (omit) ProtConfigOptions pco := omit, + template (omit) OCT1 ratType := omit, + template (omit) UserLocationInformation uli := omit) := { peer := peer, gtpc := ts_GTP1C_PDU(updatePDPContextRequest, teid, valueof(ts_UpdatePdpPDU(imsi, restart_ctr, teid_data, teid_ctrl, @@ -580,23 +584,23 @@ }
- template NSAPI_GTPC ts_NSAPI(BIT4 nsapi) := { + template (value) NSAPI_GTPC ts_NSAPI(BIT4 nsapi) := { type_gtpc := '14'O, nsapi := nsapi, unused := '0000'B }
- template ReorderingRequired ts_ReorderReq(boolean req := false) := { + template (value) ReorderingRequired ts_ReorderReq(boolean req := false) := { type_gtpc := '08'O, reordreq := bool2bit(req), spare := '0000000'B }
- template GTPC_PDUs ts_CreatePdpRespPDU(OCT1 cause, OCT4 teid_data, OCT4 teid_ctrl, BIT4 nsapi, - octetstring ggsn_ip_sign, octetstring ggsn_ip_data, - OCT4 chg_id, template EndUserAddress eua := omit, - template Recovery_gtpc recovery := omit, - template ProtConfigOptions pco := omit) := { + template (value) GTPC_PDUs ts_CreatePdpRespPDU(OCT1 cause, OCT4 teid_data, OCT4 teid_ctrl, BIT4 nsapi, + octetstring ggsn_ip_sign, octetstring ggsn_ip_data, + OCT4 chg_id, template (omit) EndUserAddress eua := omit, + template (omit) Recovery_gtpc recovery := omit, + template (omit) ProtConfigOptions pco := omit) := { createPDPContextResponse := { cause := { '00'O, cause }, reorderingRequired := ts_ReorderReq(false), @@ -634,14 +638,14 @@ } }
- template Gtp1cUnitdata ts_GTPC_CreatePdpResp(GtpPeer peer, uint16_t seq, OCT4 teid, - OCT1 cause, - OCT4 teid_ctrl, OCT4 teid_data, - BIT4 nsapi, octetstring ggsn_ip_sign, - octetstring ggsn_ip_data, OCT4 chg_id, - template EndUserAddress eua := omit, - template Recovery_gtpc recovery := omit, - template ProtConfigOptions pco := omit) := { + template (value) Gtp1cUnitdata ts_GTPC_CreatePdpResp(GtpPeer peer, uint16_t seq, OCT4 teid, + OCT1 cause, + OCT4 teid_ctrl, OCT4 teid_data, + BIT4 nsapi, octetstring ggsn_ip_sign, + octetstring ggsn_ip_data, OCT4 chg_id, + template (omit) EndUserAddress eua := omit, + template (omit) Recovery_gtpc recovery := omit, + template (omit) ProtConfigOptions pco := omit) := { peer := peer, gtpc := ts_GTP1C_PDU(createPDPContextResponse, teid, valueof(ts_CreatePdpRespPDU(cause, teid_data, teid_ctrl, nsapi, @@ -650,7 +654,7 @@ }
/* PCO send base template */ - template ProtConfigOptions ts_PCO := { + template (value) ProtConfigOptions ts_PCO := { type_gtpc := '84'O, lengthf := 0, configProtocol := '000'B, @@ -659,7 +663,7 @@ protocols := {} } /* PCO receive base template */ - template ProtConfigOptions tr_PCO := { + template (present) ProtConfigOptions tr_PCO := { type_gtpc := '84'O, lengthf := ?, configProtocol := '000'B, @@ -668,18 +672,18 @@ protocols := {} }
- template ProtConfigOptions ts_PCO_IPv6_DNS modifies ts_PCO := { + template (value) ProtConfigOptions ts_PCO_IPv6_DNS modifies ts_PCO := { protocols := { { protocolID := '0003'O, lengthProtoID := 0, protoIDContents := ''O } } } - template ProtConfigOptions tr_PCO_IPv6_DNS_resp(template OCT16 contents) modifies tr_PCO := { + template (present) ProtConfigOptions tr_PCO_IPv6_DNS_resp(template (present) OCT16 contents) modifies tr_PCO := { protocols := { *, { protocolID := '0003'O, lengthProtoID := 16, protoIDContents := contents }, * } }
- template ProtConfigOptions ts_PCO_IPv4_DNS_IPCP modifies ts_PCO := { + template (value) ProtConfigOptions ts_PCO_IPv4_DNS_IPCP modifies ts_PCO := { protocols := { /* dummy PAP entry to check if our parser in the GGSN can properly iterate over * the list of protocols, see Change-Id Icc2e6716c33d78d3c3e000f529806228d8aa155e */ @@ -689,7 +693,7 @@ } }
- template ProtConfigOptions ts_PCO_IPv4_PRI_DNS_IPCP modifies ts_PCO := { + template (value) ProtConfigOptions ts_PCO_IPv4_PRI_DNS_IPCP modifies ts_PCO := { protocols := { /* dummy PAP entry to check if our parser can cope with a single primary DNS entry * see Change-Id Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5 and OS#3288 */ @@ -698,7 +702,7 @@ enc_IpcpPacket(valueof(ts_IPCP_ReqDNS_Primary)) } } } - template ProtConfigOptions ts_PCO_IPv4_SEC_DNS_IPCP modifies ts_PCO := { + template (value) ProtConfigOptions ts_PCO_IPv4_SEC_DNS_IPCP modifies ts_PCO := { protocols := { /* dummy PAP entry to check if our parser can cope with a single secondary DNS entry * see Change-Id Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5 and OS#3288 */ @@ -707,7 +711,7 @@ enc_IpcpPacket(valueof(ts_IPCP_ReqDNS_Secondary)) } } } - template ProtConfigOptions ts_PCO_IPv4_SEPARATE_DNS_IPCP modifies ts_PCO := { + template (value) ProtConfigOptions ts_PCO_IPv4_SEPARATE_DNS_IPCP modifies ts_PCO := { protocols := { /* dummy PAP entry to check if our parser can cope with a primary and secondary DNS * in separate IPCP containers OS#3381 */ @@ -719,33 +723,33 @@ } }
- template ProtocolElement tr_PCO_Proto(OCT2 prot_id) := { + template (present) ProtocolElement tr_PCO_Proto(OCT2 prot_id) := { protocolID := prot_id, lengthProtoID := ?, protoIDContents := ? } - template ProtocolElement ts_PCOelem_PAP_broken := { + template (value) ProtocolElement ts_PCOelem_PAP_broken := { protocolID := 'C023'O, lengthProtoID := 60, /* PPP Password Authentication Protocol containing incorrect Peer-Id-Length set to 4 (6-7 should be the valid one), see OS#3914. */ protoIDContents := '0100003c'O & '0444435338323700bc1c08087c1508083e00790000150808fd06000001000000000000000000000000000000000000000000000000000000'O } - template ProtConfigOptions ts_PCO_PAP_IPv4_DNS modifies ts_PCO := { + template (value) ProtConfigOptions ts_PCO_PAP_IPv4_DNS modifies ts_PCO := { protocols := { ts_PCOelem_PAP_broken, { protocolID := '8021'O, lengthProtoID := 16, protoIDContents := enc_IpcpPacket(valueof(ts_IPCP_ReqDNS)) } } } - template ProtConfigOptions tr_PCO_Contains(OCT2 prot_id) modifies tr_PCO := { + template (present) ProtConfigOptions tr_PCO_Contains(OCT2 prot_id) modifies tr_PCO := { protocols := { *, tr_PCO_Proto(prot_id), * } }
- template ProtConfigOptions ts_PCO_IPv4_DNS_CONT modifies ts_PCO := { + template (value) ProtConfigOptions ts_PCO_IPv4_DNS_CONT modifies ts_PCO := { protocols := { { protocolID := '000d'O, lengthProtoID := 0, protoIDContents := ''O } } } - template ProtConfigOptions tr_PCO_IPv4_DNS_CONT_resp(template OCT4 contents) modifies tr_PCO := { + template (present) ProtConfigOptions tr_PCO_IPv4_DNS_CONT_resp(template (present) OCT4 contents) modifies tr_PCO := { protocols := { *, { protocolID := '000d'O, lengthProtoID := 4, protoIDContents := contents }, * } @@ -768,42 +772,43 @@ return ''O; }
- template IpcpPacket tr_IPCP(template LcpCode code, template uint8_t identifier, - template IpcpOptionList opts) := { + template (present) IpcpPacket tr_IPCP(template (present) LcpCode code, template (present)uint8_t identifier, + template (present) IpcpOptionList opts) := { code := code, identifier := identifier, len := ?, options := opts } - template IpcpOption tr_IPCP_PrimaryDns(template OCT4 addr) := { + template (present) IpcpOption tr_IPCP_PrimaryDns(template (present) OCT4 addr) := { code := IPCP_OPT_PrimaryDNS, len := 6, data := addr } - template IpcpOption tr_IPCP_SecondaryDns(template OCT4 addr) := { + template (present) IpcpOption tr_IPCP_SecondaryDns(template (present) OCT4 addr) := { code := IPCP_OPT_SecondaryDNS, len := 6, data := addr } - template IpcpPacket tr_IPCP_Ack_DNS(template uint8_t identifier := ?, template OCT4 dns1 := ?, - template OCT4 dns2 := ?) := + template (present) IpcpPacket tr_IPCP_Ack_DNS(template (present) uint8_t identifier := ?, + template (present) OCT4 dns1 := ?, + template (present) OCT4 dns2 := ?) := tr_IPCP(LCP_Configure_Ack, identifier, { *, tr_IPCP_PrimaryDns(dns1), *, tr_IPCP_SecondaryDns(dns2), * });
- template IpcpPacket ts_IPCP(LcpCode code, uint8_t identifier, template IpcpOptionList opts) := { + template (value) IpcpPacket ts_IPCP(LcpCode code, uint8_t identifier, template (value) IpcpOptionList opts) := { code := code, identifier := identifier, len := 0, /* overwritten */ options := opts } - template IpcpPacket ts_IPCP_ReqDNS(uint8_t identifier := 0) := + template (value) IpcpPacket ts_IPCP_ReqDNS(uint8_t identifier := 0) := ts_IPCP(LCP_Configure_Request, identifier, { tr_IPCP_PrimaryDns('00000000'O), tr_IPCP_SecondaryDns('00000000'O) });
- template IpcpPacket ts_IPCP_ReqDNS_Primary(uint8_t identifier := 0) := + template (value) IpcpPacket ts_IPCP_ReqDNS_Primary(uint8_t identifier := 0) := ts_IPCP(LCP_Configure_Request, identifier, { tr_IPCP_PrimaryDns('00000000'O) }); - template IpcpPacket ts_IPCP_ReqDNS_Secondary(uint8_t identifier := 0) := + template (value) IpcpPacket ts_IPCP_ReqDNS_Secondary(uint8_t identifier := 0) := ts_IPCP(LCP_Configure_Request, identifier, { tr_IPCP_SecondaryDns('00000000'O) });
@@ -819,7 +824,7 @@ return ret; }
- template GTPC_PDUs ts_DeletePdpPDU(BIT4 nsapi, template (omit) BIT1 teardown_ind) := { + template (value) GTPC_PDUs ts_DeletePdpPDU(BIT4 nsapi, template (omit) BIT1 teardown_ind) := { deletePDPContextRequest := { cause := omit, tearDownIndicator := f_teardown_ind_IE(teardown_ind), @@ -837,15 +842,15 @@ } }
- template Gtp1cUnitdata ts_GTPC_DeletePDP(GtpPeer peer, uint16_t seq, OCT4 teid, - BIT4 nsapi, template (omit) BIT1 teardown_ind) := { + template (value) Gtp1cUnitdata ts_GTPC_DeletePDP(GtpPeer peer, uint16_t seq, OCT4 teid, + BIT4 nsapi, template (omit) BIT1 teardown_ind) := { peer := peer, gtpc := ts_GTP1C_PDU(deletePDPContextRequest, teid, valueof(ts_DeletePdpPDU(nsapi, teardown_ind)), seq) }
- template GTPC_PDUs ts_DeletePdpRespPDU(OCT1 cause, - template ProtConfigOptions pco := omit) := { + template (value) GTPC_PDUs ts_DeletePdpRespPDU(OCT1 cause, + template (omit) ProtConfigOptions pco := omit) := { deletePDPContextResponse := { cause := { '00'O, cause }, protConfigOptions := pco, @@ -856,9 +861,9 @@ } }
- template Gtp1cUnitdata ts_GTPC_DeletePdpResp(GtpPeer peer, uint16_t seq, OCT4 teid, - OCT1 cause, - template ProtConfigOptions pco := omit) := { + template (value) Gtp1cUnitdata ts_GTPC_DeletePdpResp(GtpPeer peer, uint16_t seq, OCT4 teid, + OCT1 cause, + template (omit) ProtConfigOptions pco := omit) := { peer := peer, gtpc := ts_GTP1C_PDU(deletePDPContextResponse, teid, valueof(ts_DeletePdpRespPDU(cause, pco)), seq) @@ -903,7 +908,7 @@ }, rIMProtocolVersionNumber := int2oct(ver, 1) } - function tr_GTPC_Cell_Identifier_V(template GTP_CellId cid) return template Cell_Identifier_V_GTPC { + function tr_GTPC_Cell_Identifier_V(template (present) GTP_CellId cid) return template (present) Cell_Identifier_V_GTPC { var template Cell_Identifier_V_GTPC ret := { mccDigit1 := ?, mccDigit2 := ?, @@ -915,11 +920,7 @@ rac := ?, cI_value := ? } - if (istemplatekind(cid, "omit")) { - return omit; - } else if (istemplatekind(cid, "*")) { - return *; - } else if (istemplatekind(cid, "?")) { + if (istemplatekind(cid, "?")) { return ?; } if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) { @@ -954,11 +955,13 @@ rac := int2oct(cid.ra_id.rac, 1), cI_value := int2oct(cid.cell_id, 2) } - template RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_cid(GTP_CellId cid) := { - cell_Identifier := ts_GTPC_Cell_Identifier_V(cid) + template (value) RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_cid(GTP_CellId cid) := { + cell_Identifier := ts_GTPC_Cell_Identifier_V(cid) } - function tr_GTPC_ENB_Identifier(template GTP_CellId cid, template integer tac, template octetstring gnbid) return template ENB_Identifier { - var template ENB_Identifier ret := { + function tr_GTPC_ENB_Identifier(template (present) GTP_CellId cid, + template (present) integer tac, + template (present) octetstring gnbid) return template (present) ENB_Identifier { + var template (present) ENB_Identifier ret := { mccDigit1 := ?, mccDigit2 := ?, mccDigit3 := ?, @@ -968,11 +971,7 @@ tAC := ?, globalENB_ID := ? } - if (istemplatekind(cid, "omit") and istemplatekind(tac, "omit") and istemplatekind(gnbid, "omit")) { - return omit; - } else if (istemplatekind(cid, "*") and istemplatekind(tac, "*") and istemplatekind(gnbid, "*")) { - return *; - } else if (istemplatekind(cid, "?") and istemplatekind(tac, "?") and istemplatekind(gnbid, "?")) { + if (istemplatekind(cid, "?") and istemplatekind(tac, "?") and istemplatekind(gnbid, "?")) { return ?; } if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) { @@ -1004,11 +1003,11 @@ tAC := int2oct(tac, 2), globalENB_ID := gnbid } - template RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_enbid(GTP_CellId cid, integer tac, octetstring gnbid) := { - eNB_Identifier := ts_GTPC_ENB_Identifier(cid, tac, gnbid) + template (value) RIM_Routing_Address_GTPC t_GTPC_RIM_Routing_Address_enbid(GTP_CellId cid, integer tac, octetstring gnbid) := { + eNB_Identifier := ts_GTPC_ENB_Identifier(cid, tac, gnbid) } - template RIM_Routing_Information_GTPC - tr_GTPC_RIM_Routing_Information(HEX1 addr_discr, template RIM_Routing_Address_GTPC addr) := { + template (present) RIM_Routing_Information_GTPC + tr_GTPC_RIM_Routing_Information(HEX1 addr_discr, template (present) RIM_Routing_Address_GTPC addr) := { iEI := '54'O, ext := '1'B, lengthIndicator := { @@ -1030,8 +1029,8 @@ rIM_Routing_Address := addr } /* 3GPP TS 48.018 11.3.63.1.1 */ - template RAN_Information_Request_Application_Container_NACC_GTPC - tr_GTPC_RAN_Information_Request_Application_Container_NACC(template GTP_CellId cid) := { + template (present) RAN_Information_Request_Application_Container_NACC_GTPC + tr_GTPC_RAN_Information_Request_Application_Container_NACC(template (present) GTP_CellId cid) := { iEI := '4D'O, ext := '1'B, lengthIndicator := { @@ -1049,8 +1048,8 @@ reporting_Cell_Identifier := ts_GTPC_Cell_Identifier_V(cid) } /* 3GPP TS 48.018 11.3.63.1 */ - template RAN_Information_Request_Application_Container_GTPC - tru_GTPC_RAN_Information_Request_Application_Container_NACC(template GTP_CellId cid) := { + template (present) RAN_Information_Request_Application_Container_GTPC + tru_GTPC_RAN_Information_Request_Application_Container_NACC(template (present) GTP_CellId cid) := { nacc := tr_GTPC_RAN_Information_Request_Application_Container_NACC(cid) } template (value) RAN_Information_Request_Application_Container_GTPC @@ -1058,8 +1057,8 @@ nacc := ts_GTPC_RAN_Information_Request_Application_Container_NACC(cid) } /* 3GPP TS 48.018 11.3.63.2.1 */ - template RAN_Information_Application_Container_NACC_GTPC - tr_GTPC_RAN_Information_Application_Container_NACC(template GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { + template (present) RAN_Information_Application_Container_NACC_GTPC + tr_GTPC_RAN_Information_Application_Container_NACC(template (present) GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { iEI := '4E'O, ext := '1'B, lengthIndicator := { @@ -1116,10 +1115,10 @@ source_Cell_Identifier := src, rIM_Container := cont } - template PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC - tr_GTPC_RAN_Information_Request(template RIM_Routing_Information_GTPC dest := ?, - template RIM_Routing_Information_GTPC src := ?, - template RAN_Information_Request_RIM_Container_GTPC cont := ?) := { + template (present) PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC + tr_GTPC_RAN_Information_Request(template (present) RIM_Routing_Information_GTPC dest := ?, + template (present) RIM_Routing_Information_GTPC src := ?, + template (present) RAN_Information_Request_RIM_Container_GTPC cont := ?) := { bssgpPduType := '71'O, destination_Cell_Identifier := dest, source_Cell_Identifier := src, @@ -1133,7 +1132,7 @@ pDU_BSSGP_RAN_INFORMATION_REQUEST := pdu } } - template RANTransparentContainer tr_RANTransparentContainer_RAN_INFO_REQ(template PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC pdu := ?) := { + template (present) RANTransparentContainer tr_RANTransparentContainer_RAN_INFO_REQ(template (present) PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC pdu := ?) := { type_gtpc := '90'O, lengthf := ?, rANTransparentContainerField := { @@ -1142,7 +1141,7 @@ }
/* RAN_Information */ - template ApplContainer_or_ApplErrContainer_NACC_GTPC + template (present) ApplContainer_or_ApplErrContainer_NACC_GTPC tru_GTPC_ApplContainer_NACC(GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { application_Container := tr_GTPC_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi) } @@ -1150,21 +1149,21 @@ tsu_GTPC_ApplContainer_NACC(GTP_CellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { application_Container := ts_GTPC_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi) } - template ApplContainer_or_ApplErrContainer_GTPC - tru_GTPC_ApplContainer_or_ApplErrContainer_NACC(template ApplContainer_or_ApplErrContainer_NACC_GTPC cont) := { + template (present) ApplContainer_or_ApplErrContainer_GTPC + tru_GTPC_ApplContainer_or_ApplErrContainer_NACC(template (present) ApplContainer_or_ApplErrContainer_NACC_GTPC cont) := { nacc := cont } template (value) ApplContainer_or_ApplErrContainer_GTPC tsu_GTPC_ApplContainer_or_ApplErrContainer_NACC(template (value) ApplContainer_or_ApplErrContainer_NACC_GTPC cont) := { nacc := cont } - template RAN_Information_RIM_Container_GTPC - tr_GTPC_RAN_Information_RIM_Container(template RIM_Application_Identity_GTPC app_id, - template RIM_Sequence_Number_GTPC seq, - template RIM_PDU_Indications_GTPC ind, - template RIM_Protocol_Version_Number_GTPC ver := omit, - template ApplContainer_or_ApplErrContainer_GTPC app_cont := omit, - template SON_TransferApplicationIdentity son_app_id := omit) := { + template (present) RAN_Information_RIM_Container_GTPC + tr_GTPC_RAN_Information_RIM_Container(template (present) RIM_Application_Identity_GTPC app_id, + template (present) RIM_Sequence_Number_GTPC seq, + template (present) RIM_PDU_Indications_GTPC ind, + template RIM_Protocol_Version_Number_GTPC ver := *, + template ApplContainer_or_ApplErrContainer_GTPC app_cont := *, + template SON_TransferApplicationIdentity son_app_id := *) := { iEI := '58'O, ext := '1'B, lengthIndicator := { @@ -1196,10 +1195,10 @@ applContainer_or_ApplErrContainer := app_cont, sON_TransferApplicationIdentity := son_app_id } - template PDU_BSSGP_RAN_INFORMATION_GTPC - tr_GTPC_RAN_Information(template RIM_Routing_Information_GTPC dest, - template RIM_Routing_Information_GTPC src, - template RAN_Information_RIM_Container_GTPC cont) := { + template (present) PDU_BSSGP_RAN_INFORMATION_GTPC + tr_GTPC_RAN_Information(template (present) RIM_Routing_Information_GTPC dest, + template (present) RIM_Routing_Information_GTPC src, + template (present) RAN_Information_RIM_Container_GTPC cont) := { bssgpPduType := '70'O, destination_Cell_Identifier := dest, source_Cell_Identifier := src, @@ -1214,7 +1213,7 @@ source_Cell_Identifier := src, rIM_Container := cont } - template RANTransparentContainer tr_RANTransparentContainer_RAN_INFO(template PDU_BSSGP_RAN_INFORMATION_GTPC pdu) := { + template (present) RANTransparentContainer tr_RANTransparentContainer_RAN_INFO(template (present) PDU_BSSGP_RAN_INFORMATION_GTPC pdu) := { type_gtpc := '90'O, lengthf := ?, rANTransparentContainerField := { @@ -1229,7 +1228,7 @@ } }
- template RANTransparentContainer tr_RANTransparentContainer(template RANTransparentContainerField rANTransparentContainerField) := { + template (present) RANTransparentContainer tr_RANTransparentContainer(template (present) RANTransparentContainerField rANTransparentContainerField) := { type_gtpc := '90'O, lengthf := ?, rANTransparentContainerField := rANTransparentContainerField @@ -1239,7 +1238,7 @@ lengthf := 0, /* overwritten */ rANTransparentContainerField := rANTransparentContainerField } - template GTPC_PDUs tr_RANInfoRelay(template RANTransparentContainer transparentContainer) := { + template (present) GTPC_PDUs tr_RANInfoRelay(template (present) RANTransparentContainer transparentContainer) := { ranInformationRelay := { transparentContainer := transparentContainer, rIM_RoutingAddress := *, @@ -1257,9 +1256,9 @@ private_extension_gtpc := omit } } - template Gtp1cUnitdata - tr_GTPC_RANInfoRelay(template GtpPeer peer, - template RANTransparentContainer transparentContainer) := { + template (present) Gtp1cUnitdata + tr_GTPC_RANInfoRelay(template (present) GtpPeer peer, + template (present) RANTransparentContainer transparentContainer) := { peer := peer, gtpc := tr_GTP1C_PDU(rANInformationRelay, '00000000'O, tr_RANInfoRelay(transparentContainer)) } @@ -1273,10 +1272,10 @@ }
- template RAN_Information_Request_RIM_Container_GTPC - tr_GTPC_RAN_Information_Request_RIM_Container(template RIM_Application_Identity_GTPC app_id := ?, - template RIM_Sequence_Number_GTPC seq := ?, - template RIM_PDU_Indications_GTPC ind := ?, + template (present) RAN_Information_Request_RIM_Container_GTPC + tr_GTPC_RAN_Information_Request_RIM_Container(template (present) RIM_Application_Identity_GTPC app_id := ?, + template (present) RIM_Sequence_Number_GTPC seq := ?, + template (present) RIM_PDU_Indications_GTPC ind := ?, template RIM_Protocol_Version_Number_GTPC ver := *, template RAN_Information_Request_Application_Container_GTPC app_cont := *, template SON_TransferApplicationIdentity son_app_id := *) := { @@ -1295,7 +1294,9 @@
/* GTP-U */
- template PDU_GTPU tr_GTP1U_PDU(template OCT1 msg_type, template OCT4 teid, template GTPU_IEs ies := ?) := { + template (present) PDU_GTPU tr_GTP1U_PDU(template (present) OCT1 msg_type, + template (present) OCT4 teid, + template (present) GTPU_IEs ies := ?) := { pn_bit := ?, s_bit := ?, e_bit := ?, @@ -1358,28 +1359,32 @@ gtpu_IEs := ies }
- template Gtp1uUnitdata tr_GTPU_MsgType(template GtpPeer peer, template OCT1 msg_type, template OCT4 teid) := { + template (present) Gtp1uUnitdata tr_GTPU_MsgType(template (present) GtpPeer peer, + template (present) OCT1 msg_type, + template (present) OCT4 teid) := { peer := peer, gtpu := tr_GTP1U_PDU(msg_type, teid) }
/* template matching reception of GTP-U echo-request/response */ - template Gtp1uUnitdata tr_GTPU_PING(template GtpPeer peer) := tr_GTPU_MsgType(peer, echoRequest, '00000000'O); - template Gtp1uUnitdata tr_GTPU_PONG(template GtpPeer peer) := tr_GTPU_MsgType(peer, echoResponse, '00000000'O); + template (present) Gtp1uUnitdata tr_GTPU_PING(template (present) GtpPeer peer) := tr_GTPU_MsgType(peer, echoRequest, '00000000'O); + template (present) Gtp1uUnitdata tr_GTPU_PONG(template (present) GtpPeer peer) := tr_GTPU_MsgType(peer, echoResponse, '00000000'O);
/* template matching reception of GTP-U GPDU */ - template GTPU_IEs t_GPDU(template octetstring data) := { + template GTPU_IEs t_GPDU(template (present) octetstring data) := { g_PDU_IEs := { data := data } } - template Gtp1uUnitdata tr_GTPU_GPDU(template GtpPeer peer, template OCT4 teid, template octetstring data := ?) := { + template (present) Gtp1uUnitdata tr_GTPU_GPDU(template (present) GtpPeer peer, + template (present) OCT4 teid, + template (present) octetstring data := ?) := { peer := peer, gtpu := tr_GTP1U_PDU('FF'O, teid, t_GPDU(data)) }
- template GTPU_IEs ts_UEchoReqPDU := { + template (present) GTPU_IEs ts_UEchoReqPDU := { echoRequest_IEs := { private_extension_gtpu := omit } @@ -1402,23 +1407,23 @@ }
/* master template for sending a GTP-U echo response */ - template Gtp1uUnitdata ts_GTPU_PONG(GtpPeer peer, uint16_t seq, OCT1 rest_ctr) := { + template (present) Gtp1uUnitdata ts_GTPU_PONG(GtpPeer peer, uint16_t seq, OCT1 rest_ctr) := { peer := peer, gtpu := ts_GTP1U_PDU(echoResponse, seq, '00000000'O, valueof(ts_UEchoRespPDU(rest_ctr))) }
- template GSNAddress_gtpu ts_UGsnAddr(octetstring ip_addr) := { + template (value) GSNAddress_gtpu ts_UGsnAddr(octetstring ip_addr) := { type_gtpu := '85'O, lengthf := lengthof(ip_addr), gSNAddressValue := ip_addr }
- template TeidDataI_gtpu ts_UteidDataI(OCT4 teid) := { + template (value) TeidDataI_gtpu ts_UteidDataI(OCT4 teid) := { type_gtpu := '10'O, teidDataI := teid }
- template GTPU_IEs ts_UErrorIndication(OCT4 teid, octetstring gsn_addr) := { + template (value) GTPU_IEs ts_UErrorIndication(OCT4 teid, octetstring gsn_addr) := { errorIndication_IEs := { teidDataI_gtpu := ts_UteidDataI(teid), gSNAddress_gtpu := ts_UGsnAddr(gsn_addr), @@ -1427,13 +1432,13 @@ }
/* master template for sending a GTP-U Error indication */ - template Gtp1uUnitdata ts_GTPU_ErrorIndication(GtpPeer peer, uint16_t seq, OCT4 teid, octetstring gsn_addr) := { + template (value) Gtp1uUnitdata ts_GTPU_ErrorIndication(GtpPeer peer, uint16_t seq, OCT4 teid, octetstring gsn_addr) := { peer := peer, gtpu := ts_GTP1U_PDU('1A'O, seq, '00000000'O, valueof(ts_UErrorIndication(teid, gsn_addr))) }
/* master template for sending a GTP-U user plane data */ - template Gtp1uUnitdata ts_GTP1U_GPDU(GtpPeer peer, template (omit) uint16_t seq, OCT4 teid, octetstring data) := { + template (value) Gtp1uUnitdata ts_GTP1U_GPDU(GtpPeer peer, template (omit) uint16_t seq, OCT4 teid, octetstring data) := { peer := peer, gtpu := ts_GTP1U_PDU('FF'O, seq, teid, { g_PDU_IEs := { data := data }}) }