///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2000-2019 Ericsson Telecom AB
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v2.0
// which accompanies this distribution, and is available at
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
///////////////////////////////////////////////////////////////////////////////
//
//  File:               PFCP_Types.ttcn
//  Description:        PFCP protocol module
//  Rev:                <RnXnn>
//  Prodnr:             CNL 113 875
//  Contact:            http://ttcn.ericsson.se
//  Reference:          3GPP TS 29.244 v15.1.0
//

module PFCP_Types{

import from General_Types all;

external function enc_PDU_PFCP(in PDU_PFCP pdu) return octetstring
with { extension "prototype(convert)" extension "encode(RAW)" }

external function dec_PDU_PFCP(in octetstring stream) return PDU_PFCP
with { extension "prototype(convert)" extension "decode(RAW)" }

external function enc_PDU_PFCP_fast(in PDU_PFCP pdu, out octetstring stream)
with { extension "prototype(fast) encode(RAW)" }

external function dec_PDU_PFCP_backtrack(in octetstring stream, out PDU_PFCP pdu) return integer
with { extension "prototype(backtrack) decode(RAW)" }


// Information Elements

// 8.2.1	Cause
type record Cause {
  LIN2_BO_LAST      elementIdentifier(19),
  LIN2_BO_LAST      lengthIndicator,
  OCT1              causeValue
} with {
  variant "PRESENCE (elementIdentifier = 19; )"
  variant (lengthIndicator) "LENGTHTO(causeValue )"
}

//8.2.2	Source Interface
type record Source_Interface {
  LIN2_BO_LAST      elementIdentifier(20),
  LIN2_BO_LAST      lengthIndicator,
  INT4b             interfacevalue,
  BIT4              spare
} with {
  variant "PRESENCE (elementIdentifier = 20; )"
  variant (lengthIndicator) "LENGTHTO(interfacevalue, spare)"
}

// 8.2.3 F-TEID
type record F_TEID {
  LIN2_BO_LAST      elementIdentifier(21),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              v4,
  BIT1              v6,
  BIT1              ch,
  BIT1              chid,
  BIT4              spare,
  OCT4              teid optional,
  OCT4              ipv4_address optional,
  OCT16             ipv6_address optional,
  OCT1              choose_id optional
} with {
  variant (ipv4_address) "PRESENCE (v4 = '1'B )"
  variant (ipv6_address) "PRESENCE (v6 = '1'B )"
  variant (choose_id) "PRESENCE (chid = '1'B )"
  variant "PRESENCE (elementIdentifier = 21; )"
  variant (lengthIndicator) "LENGTHTO(v4,v6,ch,chid,spare,teid,ipv4_address,ipv6_address,choose_id)"
}

// 8.2.4 PDN Instance
type Network_Instance PDN_Instance 
type record Network_Instance {
  LIN2_BO_LAST      elementIdentifier(22),
  LIN2_BO_LAST      lengthIndicator,
  octetstring       pdn_instance
} with {
  variant "PRESENCE (elementIdentifier = 22; )"
  variant (lengthIndicator) "LENGTHTO(pdn_instance )"
}

// 8.2.5 SDF Filter
type record SDF_Filter {
  LIN2_BO_LAST      elementIdentifier(23),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              fd,
  BIT1              ttc,
  BIT1              spi,
  BIT1              fl,
  BIT1              bid,
  BIT11             spare,
  LIN2_BO_LAST      lengthFlowDesc optional,
  octetstring       flow_description optional,
  OCT2              ToS_Traffic_Class optional,
  OCT4              security_parameter_index optional,
  OCT3              flow_label optional,
  LIN4_BO_LAST      SDF_filter_id optional
} with {
  variant "PRESENCE (elementIdentifier = 23; )"
  variant (lengthFlowDesc) "PRESENCE (fd = '1'B )"
  variant (flow_description) "PRESENCE (fd = '1'B )"
  variant (ToS_Traffic_Class) "PRESENCE (ttc = '1'B )"
  variant (SDF_filter_id) "PRESENCE (bid = '1'B )"
  variant (security_parameter_index) "PRESENCE (spi = '1'B )"
  variant (flow_label) "PRESENCE (fl = '1'B )"
  variant (lengthFlowDesc) "LENGTHTO(flow_description)"
  variant (lengthIndicator) "LENGTHTO(fd,ttc,spi,fl,bid,spare,lengthFlowDesc,flow_description,ToS_Traffic_Class,security_parameter_index,flow_label, SDF_filter_id)"
}

type record of SDF_Filter SDF_Filter_list;

// 8.2.6	Application ID
type record Application_ID {
  LIN2_BO_LAST      elementIdentifier(24),
  LIN2_BO_LAST      lengthIndicator,
  octetstring       application_id
} with {
  variant "PRESENCE (elementIdentifier = 24; )"
  variant (lengthIndicator) "LENGTHTO(application_id )"
}

// 8.2.7 Gate Status
type record Gate_Status {
  LIN2_BO_LAST      elementIdentifier(25),
  LIN2_BO_LAST      lengthIndicator,
  INT2b             dl_gate,
  INT2b             ul_gate,
  BIT4              spare
} with {
  variant "PRESENCE (elementIdentifier = 25; )"
  variant (lengthIndicator) "LENGTHTO(dl_gate,ul_gate,spare )"
}

// 8.2.8 MBR
type record MBR {
  LIN2_BO_LAST      elementIdentifier(26),
  LIN2_BO_LAST      lengthIndicator,
  OCT5              ul_mbr,
  OCT5              dl_mbr
} with {
  variant "PRESENCE (elementIdentifier = 26; )"
  variant (lengthIndicator) "LENGTHTO(ul_mbr,dl_mbr )"
}

// 8.2.9 GBR
type record GBR {
  LIN2_BO_LAST      elementIdentifier(27),
  LIN2_BO_LAST      lengthIndicator,
  OCT5              ul_gbr,
  OCT5              dl_gbr
} with {
  variant "PRESENCE (elementIdentifier = 27; )"
  variant (lengthIndicator) "LENGTHTO(ul_gbr,dl_gbr )"
}


// 8.2.10	QER Correlation ID
type record QER_Correlation_ID {
  LIN2_BO_LAST      elementIdentifier(28),
  LIN2_BO_LAST      lengthIndicator,
  octetstring       qer
} with {
  variant "PRESENCE (elementIdentifier = 28; )"
  variant (lengthIndicator) "LENGTHTO(qer )"
}

// 8.2.11 Precedence
type record Precedence {
  LIN2_BO_LAST      elementIdentifier(29),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      precedence_value
} with {
  variant "PRESENCE (elementIdentifier = 29; )"
  variant (lengthIndicator) "LENGTHTO(precedence_value )"
}

// 8.2.12 DL Transport Level Marking
type record DL_Transport_Level_Marking {
  LIN2_BO_LAST      elementIdentifier(30),
  LIN2_BO_LAST      lengthIndicator,
  OCT2              ToS_traffic_class
} with {
  variant "PRESENCE (elementIdentifier = 30; )"
  variant (lengthIndicator) "LENGTHTO( ToS_traffic_class)"
}

// 8.2.13 Volume Threshold
type record Volume_Threshold {
  LIN2_BO_LAST      elementIdentifier(31),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              tovol,
  BIT1              ulvol,
  BIT1              dlvol,
  BIT5              spare,
  LIN8_BO_LAST      total_volume optional,
  LIN8_BO_LAST      uplink_volume optional,
  LIN8_BO_LAST      downlink_volume optional
} with {
  variant "PRESENCE (elementIdentifier = 31; )"
  variant (total_volume) "PRESENCE ( tovol= '1'B )"
  variant (uplink_volume) "PRESENCE ( ulvol= '1'B )"
  variant (downlink_volume) "PRESENCE ( dlvol= '1'B )"
  variant (lengthIndicator) "LENGTHTO(tovol,ulvol,dlvol,spare,total_volume,uplink_volume,downlink_volume )"
}

// 8.2.14 Time Threshold
type record Time_Threshold {
  LIN2_BO_LAST      elementIdentifier(32),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      time_threshold
} with {
  variant "PRESENCE (elementIdentifier = 32; )"
  variant (lengthIndicator) "LENGTHTO(time_threshold )"
}

// 8.2.15 Monitoring Time
type record Monitoring_Time {
  LIN2_BO_LAST      elementIdentifier(33),
  LIN2_BO_LAST      lengthIndicator,
  OCT4              monitoring_time
} with {
  variant "PRESENCE (elementIdentifier = 33; )"
  variant (lengthIndicator) "LENGTHTO(monitoring_time )"
}

// 8.2.16 Subsequent Volume Threshold
type record Subsequent_Volume_Threshold {
  LIN2_BO_LAST      elementIdentifier(34),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              tovol,
  BIT1              ulvol,
  BIT1              dlvol,
  BIT5              spare,
  LIN8_BO_LAST      total_volume optional,
  LIN8_BO_LAST      uplink_volume optional,
  LIN8_BO_LAST      downlink_volume optional
} with {
  variant "PRESENCE (elementIdentifier = 34; )"
  variant (total_volume) "PRESENCE ( tovol= '1'B )"
  variant (uplink_volume) "PRESENCE ( ulvol= '1'B )"
  variant (downlink_volume) "PRESENCE ( dlvol= '1'B )"
  variant (lengthIndicator) "LENGTHTO(tovol,ulvol,dlvol,spare,total_volume,uplink_volume,downlink_volume )"
}

// 8.2.17 Subsequent Time Threshold
type record Subsequent_Time_Threshold {
  LIN2_BO_LAST      elementIdentifier(35),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      time_threshold
} with {
  variant "PRESENCE (elementIdentifier = 35; )"
  variant (lengthIndicator) "LENGTHTO(time_threshold )"
}

// 8.2.18 Inactivity Detection Time
type record Inactivity_Detection_Time {
  LIN2_BO_LAST      elementIdentifier(36),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      inactivity_detection_time
} with {
  variant "PRESENCE (elementIdentifier = 36; )"
  variant (lengthIndicator) "LENGTHTO(inactivity_detection_time )"
}

// 8.2.19 Reporting Triggers
type record Reporting_Triggers {
  LIN2_BO_LAST      elementIdentifier(37),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              perio,
  BIT1              volth,
  BIT1              timth,
  BIT1              quhti,
  BIT1              start_,
  BIT1              stop_,
  BIT1              droth,
  BIT1              liusa,
  BIT1              volqu,
  BIT1              timqu,
  BIT1              envcl,
  BIT5              spare

} with {
  variant "PRESENCE (elementIdentifier = 37; )"
  variant (lengthIndicator) "LENGTHTO( perio,volth,timth,quhti,start_,stop_,droth,liusa,volqu,timqu,envcl,spare)"
}

// 8.2.20 Redirect Information
type record Redirect_Information {
  LIN2_BO_LAST      elementIdentifier(38),
  LIN2_BO_LAST      lengthIndicator,
  INT4b             redirect_address_type,
  LIN2_BO_LAST      addresslength,
  octetstring       redirect_server_address
} with {
  variant "PRESENCE (elementIdentifier = 38; )"
  variant (addresslength) "LENGTHTO(redirect_server_address)"
  variant (lengthIndicator) "LENGTHTO( redirect_address_type,addresslength,redirect_server_address)"
}

// 8.2.21 Report Type
type record Report_Type {
  LIN2_BO_LAST      elementIdentifier(39),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              dldr,
  BIT1              usar,
  BIT1              erir,
  BIT1              upir,
  BIT4              spare

} with {
  variant "PRESENCE (elementIdentifier = 39; )"
  variant (lengthIndicator) "LENGTHTO( dldr,usar,erir,upir,spare)"
}

//8.2.22 Offending IE
type record Offending_IE {
  LIN2_BO_LAST      elementIdentifier(40),
  LIN2_BO_LAST      lengthIndicator,
  LIN2_BO_LAST      offendingIE
} with {
  variant "PRESENCE (elementIdentifier = 40; )"
  variant (lengthIndicator) "LENGTHTO( offendingIE)"
}

// 8.2.23 Forwarding Policy
type record Forwarding_Policy {
  LIN2_BO_LAST      elementIdentifier(41),
  LIN2_BO_LAST      lengthIndicator,
  LIN1              policyIdlength,
  octetstring       forwarding_policy_id length(0..255)
} with {
  variant "PRESENCE (elementIdentifier = 41; )"
  variant (policyIdlength) "LENGTHTO( forwarding_policy_id)"
  variant (lengthIndicator) "LENGTHTO( policyIdlength,forwarding_policy_id)"
}

// 8.2.24 Destination Interface
type record Destination_Interface {
  LIN2_BO_LAST      elementIdentifier(42),
  LIN2_BO_LAST      lengthIndicator,
  INT4b             interface_value,
  BIT4              spare
} with {
  variant "PRESENCE (elementIdentifier = 42; )"
  variant (lengthIndicator) "LENGTHTO(interface_value,spare )"
}

// 8.2.25 UP Function Features
type record UP_Function_Features {
  LIN2_BO_LAST      elementIdentifier(43),
  LIN2_BO_LAST      lengthIndicator,
  BIT8              oct5,
  BIT8              oct6
} with {
  variant "PRESENCE (elementIdentifier = 43; )"
  variant (lengthIndicator) "LENGTHTO(oct5,oct6 )"
}

// 8.2.26 Apply Action
type record Apply_Action {
  LIN2_BO_LAST      elementIdentifier(44),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              drop,
  BIT1              forw,
  BIT1              buff,
  BIT1              nocp,
  BIT1              dupl,
  BIT3              spare
} with {
  variant "PRESENCE (elementIdentifier = 44; )"
  variant (lengthIndicator) "LENGTHTO(drop,forw,buff,nocp,dupl,spare)"
}

// 8.2.27 Downlink Data Service
type record Downlink_Data_Service_Information {
  LIN2_BO_LAST      elementIdentifier(45),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              ppi,
  BIT7              spare,
  BIT6              ppi_value optional,
  BIT2              spare2 optional
} with {
  variant "PRESENCE (elementIdentifier = 45; )"
  variant (ppi_value) "PRESENCE(ppi = '1'B)"
  variant (spare) "PRESENCE(ppi = '1'B)"
  variant (lengthIndicator) "LENGTHTO(ppi,spare,ppi_value,spare2)"
}

// 8.2.28 Downlink Data Notification Delay
type record Downlink_Data_Notification_Delay {
  LIN2_BO_LAST      elementIdentifier(46),
  LIN2_BO_LAST      lengthIndicator,
  INT1              delay_value
} with {
  variant "PRESENCE (elementIdentifier = 46; )"
  variant (lengthIndicator) "LENGTHTO(delay_value)"
}

// 8.2.29 DL Buffering Duration
type record DL_Buffering_Duration {
  LIN2_BO_LAST      elementIdentifier(47),
  LIN2_BO_LAST      lengthIndicator,
  BIT5              timer_value,
  BIT3              timer_unit
} with {
  variant "PRESENCE (elementIdentifier = 47; )"
  variant (lengthIndicator) "LENGTHTO(timer_value,timer_unit)"
}

// 8.2.30 DL Buffering Suggested Packet Count
type record DL_Buffering_Suggested_Packet_Count {
  LIN2_BO_LAST      elementIdentifier(48),
  LIN2_BO_LAST      lengthIndicator,
  octetstring       packet_count_value
} with {
  variant "PRESENCE (elementIdentifier = 48; )"
  variant (lengthIndicator) "LENGTHTO(packet_count_value)"
}

// 8.2.31 PFCPSMReq-Flags
type record PFCPSMReq_Flags {
  LIN2_BO_LAST      elementIdentifier(49),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              drobu,
  BIT1              sndem,
  BIT1              qaurr,
  BIT5              spare
} with {
  variant "PRESENCE (elementIdentifier = 49; )"
  variant (lengthIndicator) "LENGTHTO(drobu,sndem,qaurr,spare)"
}

// 8.2.32 PFCPSMRsp-Flags
type record PFCPSMRsp_Flags {
  LIN2_BO_LAST      elementIdentifier(50),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              drobu,
  BIT7              spare
} with {
  variant "PRESENCE (elementIdentifier = 50; )"
  variant (lengthIndicator) "LENGTHTO(drobu,spare)"
}

// 8.2.33 Sequence Number
type record Sequence_Number {
  LIN2_BO_LAST      elementIdentifier(52),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      sequence_number
} with {
  variant "PRESENCE (elementIdentifier = 52; )"
  variant (lengthIndicator) "LENGTHTO(sequence_number)"
}

// 8.2.34 Metric
type record Metric {
  LIN2_BO_LAST      elementIdentifier(53),
  LIN2_BO_LAST      lengthIndicator,
  OCT1              metric
} with {
  variant "PRESENCE (elementIdentifier = 53; )"
  variant (lengthIndicator) "LENGTHTO(metric)"
}

// 8.2.35 Timer
type record Timer_IE {
  LIN2_BO_LAST      elementIdentifier(55),
  LIN2_BO_LAST      lengthIndicator,
  BIT5              timer_value,
  BIT3              timer_unit
} with {
  variant "PRESENCE (elementIdentifier = 55; )"
  variant (lengthIndicator) "LENGTHTO(timer_value,timer_unit)"
}

// 8.2.36 PDR ID
type record PDR_ID {
  LIN2_BO_LAST      elementIdentifier(56),
  LIN2_BO_LAST      lengthIndicator,
  OCT2              rule_id
} with {
  variant "PRESENCE (elementIdentifier = 56; )"
  variant (lengthIndicator) "LENGTHTO(rule_id)"
}

// 8.2.37 F-SEID
type record F_SEID {
  LIN2_BO_LAST      elementIdentifier(57),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              v6,
  BIT1              v4,
  BIT6              spare,
  OCT8              seid,
  OCT4              ipv4_address optional,
  OCT16             ipv6_address optional
} with {
  variant (ipv4_address) "PRESENCE (v4 = '1'B )"
  variant (ipv6_address) "PRESENCE (v6 = '1'B )"
  variant "PRESENCE (elementIdentifier = 57; )"
  variant (lengthIndicator) "LENGTHTO(v4,v6,spare,seid,ipv4_address,ipv6_address)"
}

// 8.2.38 Node ID
type record Node_ID {
  LIN2_BO_LAST      elementIdentifier(60),
  LIN2_BO_LAST      lengthIndicator,
  INT4b             node_id_type,
  BIT4              spare,
  octetstring       node_id_value
} with {
  variant "PRESENCE (elementIdentifier = 60; )"
  variant (lengthIndicator) "LENGTHTO(node_id_type,spare,node_id_value)"
}

// 8.2.39 PFD Contents
type record PFD_Contents {
  LIN2_BO_LAST      elementIdentifier(61),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              fd,
  BIT1              url_flag,
  BIT1              dn,
  BIT1              cp,
  BIT12             spare,
  LIN2_BO_LAST      lengthFlowDesc optional,
  octetstring       flow_description optional,
  LIN2_BO_LAST      lengthurl optional,
  octetstring       url optional,
  LIN2_BO_LAST      lengthdomain_name optional,
  octetstring       domain_name optional,
  LIN2_BO_LAST      lengthcustom_pfd optional,
  octetstring       custom_pfd optional
} with {
  variant "PRESENCE (elementIdentifier = 61; )"

  variant (lengthFlowDesc) "PRESENCE (fd = '1'B )"
  variant (flow_description) "PRESENCE (fd = '1'B )"
  variant (lengthFlowDesc) "LENGTHTO(flow_description)"

  variant (lengthurl) "PRESENCE (url_flag = '1'B )"
  variant (url) "PRESENCE (url_flag = '1'B )"
  variant (lengthurl) "LENGTHTO(url)"

  variant (lengthdomain_name) "PRESENCE (dn = '1'B )"
  variant (domain_name) "PRESENCE (dn = '1'B )"
  variant (lengthdomain_name) "LENGTHTO(domain_name)"

  variant (lengthcustom_pfd) "PRESENCE (cp = '1'B )"
  variant (custom_pfd) "PRESENCE (cp = '1'B )"
  variant (lengthcustom_pfd) "LENGTHTO(custom_pfd)"

  variant (lengthIndicator) "LENGTHTO(fd,url_flag,dn,cp,spare,lengthFlowDesc,flow_description,lengthurl,url,lengthdomain_name,domain_name,lengthcustom_pfd,custom_pfd )"
}

// 8.2.40  Measurement Method
type record Measurement_Method {
  LIN2_BO_LAST      elementIdentifier(62),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              durat,
  BIT1              volum,
  BIT1              event,
  BIT5              spare
} with {
  variant "PRESENCE (elementIdentifier = 62; )"
  variant (lengthIndicator) "LENGTHTO(durat,volum,event,spare)"
}

// 8.2.41 Usage Report Trigger
type record Usage_Report_Trigger {
  LIN2_BO_LAST      elementIdentifier(63),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              perio,
  BIT1              volth,
  BIT1              timth,
  BIT1              quhti,
  BIT1              start_,
  BIT1              stop_,
  BIT1              droth,
  BIT1              immer,
  BIT1              volqu,
  BIT1              timqu,
  BIT1              liusa,
  BIT1              termr,
  BIT1              monit,
  BIT1              envcl,
  BIT2              spare

} with {
  variant "PRESENCE (elementIdentifier = 63; )"
  variant (lengthIndicator) "LENGTHTO( perio,volth,timth,quhti,start_,stop_,droth,immer,volqu,timqu,liusa,termr,monit,envcl,spare)"
}


// 8.2.42 Measurement Period
type record Measurement_Period {
  LIN2_BO_LAST      elementIdentifier(64),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      period
} with {
  variant "PRESENCE (elementIdentifier = 64; )"
  variant (lengthIndicator) "LENGTHTO(period)"
}

// 8.2.43 Fully qualified PDN Connection Set Identifier (FQ-CSID)
type record FQ_CSID {
  LIN2_BO_LAST      elementIdentifier(65),
  LIN2_BO_LAST      lengthIndicator,
  INT4b             num_of_CSIDs,
  INT4b             node_id_type,
  union {
    OCT4         ipv4,
    OCT16        ipv6,
    OCT4         addr
  } node_address,
  record of OCT2 pdn_id_list
} with {
  variant "PRESENCE (elementIdentifier = 65; )"
  variant (node_address) "CROSSTAG(ipv4,node_id_type=0; ipv6,node_id_type=1;addr,node_id_type=2; )"
  variant (num_of_CSIDs) "LENGTHTO(pdn_id_list),UNIT(elements)"
  variant (lengthIndicator) "LENGTHTO(num_of_CSIDs,node_id_type,node_address,pdn_id_list)"
}

type record of FQ_CSID FQ_CSID_list;

// 8.2.44 Volume Measurement
type record Volume_Measurement {
  LIN2_BO_LAST      elementIdentifier(66),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              tovol,
  BIT1              ulvol,
  BIT1              dlvol,
  BIT5              spare,
  LIN8_BO_LAST      total_volume optional,
  LIN8_BO_LAST      uplink_volume optional,
  LIN8_BO_LAST      downlink_volume optional
} with {
  variant "PRESENCE (elementIdentifier = 66; )"
  variant (total_volume) "PRESENCE ( tovol= '1'B )"
  variant (uplink_volume) "PRESENCE ( ulvol= '1'B )"
  variant (downlink_volume) "PRESENCE ( dlvol= '1'B )"
  variant (lengthIndicator) "LENGTHTO(tovol,ulvol,dlvol,spare,total_volume,uplink_volume,downlink_volume )"
}

// 8.2.45 Duration Measurement
type record Duration_Measurement {
  LIN2_BO_LAST      elementIdentifier(67),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      duration
} with {
  variant "PRESENCE (elementIdentifier = 67; )"
  variant (lengthIndicator) "LENGTHTO(duration )"
}

// 8.2.46 Time of First Packet
type record Time_of_First_Packet {
  LIN2_BO_LAST      elementIdentifier(69),
  LIN2_BO_LAST      lengthIndicator,
  OCT4              time_of_packet
} with {
  variant "PRESENCE (elementIdentifier = 69; )"
  variant (lengthIndicator) "LENGTHTO(time_of_packet )"
}

// 8.2.47 Time of Last Packet
type record Time_of_Last_Packet {
  LIN2_BO_LAST      elementIdentifier(70),
  LIN2_BO_LAST      lengthIndicator,
  OCT4              time_of_packet
} with {
  variant "PRESENCE (elementIdentifier = 70; )"
  variant (lengthIndicator) "LENGTHTO(time_of_packet )"
}

// 8.2.48 Quota Holding Time
type record Quota_Holding_Time {
  LIN2_BO_LAST      elementIdentifier(71),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      time_value
} with {
  variant "PRESENCE (elementIdentifier = 71; )"
  variant (lengthIndicator) "LENGTHTO(time_value )"
}

// 8.2.49 Dropped DL Traffic Threshold
type record Dropped_DL_Traffic_Threshold {
  LIN2_BO_LAST      elementIdentifier(72),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              dlpa,
  BIT7              spare,
  LIN8_BO_LAST      packets optional
} with {
  variant "PRESENCE (elementIdentifier = 72; )"
  variant (packets) "PRESENCE (dlpa = '1'B; )"
  variant (lengthIndicator) "LENGTHTO( dlpa,spare,packets)"
}

// 8.2.50 Volume Quota
type record Volume_Quota {
  LIN2_BO_LAST      elementIdentifier(73),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              tovol,
  BIT1              ulvol,
  BIT1              dlvol,
  BIT5              spare,
  LIN8_BO_LAST      total_volume optional,
  LIN8_BO_LAST      uplink_volume optional,
  LIN8_BO_LAST      downlink_volume optional
} with {
  variant "PRESENCE (elementIdentifier = 73; )"
  variant (total_volume) "PRESENCE ( tovol= '1'B )"
  variant (uplink_volume) "PRESENCE ( ulvol= '1'B )"
  variant (downlink_volume) "PRESENCE ( dlvol= '1'B )"
  variant (lengthIndicator) "LENGTHTO(tovol,ulvol,dlvol,spare,total_volume,uplink_volume,downlink_volume )"
}

// 8.2.51 Time Quota
type record Time_Quota {
  LIN2_BO_LAST      elementIdentifier(74),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      time_value
} with {
  variant "PRESENCE (elementIdentifier = 74; )"
  variant (lengthIndicator) "LENGTHTO(time_value )"
}

// 8.2.52 Start Time
type record Start_Time {
  LIN2_BO_LAST      elementIdentifier(75),
  LIN2_BO_LAST      lengthIndicator,
  OCT4              start_time
} with {
  variant "PRESENCE (elementIdentifier = 75; )"
  variant (lengthIndicator) "LENGTHTO(start_time )"
}

// 8.2.53 End Time
type record End_Time {
  LIN2_BO_LAST      elementIdentifier(76),
  LIN2_BO_LAST      lengthIndicator,
  OCT4              end_time
} with {
  variant "PRESENCE (elementIdentifier = 76; )"
  variant (lengthIndicator) "LENGTHTO(end_time )"
}

// 8.2.54 URR ID
type record URR_ID {
  LIN2_BO_LAST      elementIdentifier(81),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      id_value
} with {
  variant "PRESENCE (elementIdentifier = 81; )"
  variant (lengthIndicator) "LENGTHTO(id_value )"
}

type record of URR_ID URR_ID_list;

// 8.2.55 Linked URR ID
type record Linked_URR_ID {
  LIN2_BO_LAST      elementIdentifier(82),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      id_value
} with {
  variant "PRESENCE (elementIdentifier = 82; )"
  variant (lengthIndicator) "LENGTHTO(id_value )"
}

// 8.2.56 Outer Header Creation
type record Outer_Header_Creation {
  LIN2_BO_LAST      elementIdentifier(84),
  LIN2_BO_LAST      lengthIndicator,
  BIT8              ohc_description_oct5,
  BIT8              ohc_description_oct6,
  OCT4              teid optional,
  OCT4              ipv4 optional,
  OCT16             ipv6 optional,
  OCT2              udp_port optional
} with {
  variant "PRESENCE (elementIdentifier = 84; )"
  variant (teid) "PRESENCE({ohc_description_oct5 = '00000001'B, ohc_description_oct5 = '00000010'B, ohc_description_oct5 = '00000011'B})"
  variant (ipv4) "PRESENCE({ohc_description_oct5 = '00000001'B, ohc_description_oct5 = '00000100'B, ohc_description_oct5 = '00000011'B})"
  variant (ipv6) "PRESENCE({ohc_description_oct5 = '00000010'B, ohc_description_oct5 = '00001000'B, ohc_description_oct5 = '00000011'B})"
  variant (lengthIndicator) "LENGTHTO(ohc_description_oct5,ohc_description_oct6,teid,ipv4,ipv6,udp_port )"
}

// 8.2.57 BAR ID
type record BAR_ID {
  LIN2_BO_LAST      elementIdentifier(88),
  LIN2_BO_LAST      lengthIndicator,
  OCT1              id_value
} with {
  variant "PRESENCE (elementIdentifier = 88; )"
  variant (lengthIndicator) "LENGTHTO(id_value )"
}

// 8.2.58 CP Function Features
type record CP_Function_Features {
  LIN2_BO_LAST      elementIdentifier(89),
  LIN2_BO_LAST      lengthIndicator,
  OCT1              features
} with {
  variant "PRESENCE (elementIdentifier = 89; )"
  variant (lengthIndicator) "LENGTHTO( features)"
}

// 8.2.59 Usage Information
type record Usage_Information {
  LIN2_BO_LAST      elementIdentifier(90),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              bef,
  BIT1              aft,
  BIT1              uae,
  BIT1              ube,
  BIT4              spare
} with {
  variant "PRESENCE (elementIdentifier = 90; )"
  variant (lengthIndicator) "LENGTHTO(bef,aft,uae,ube,spare)"
}

// 8.2.60 Application Instance ID
type record Application_Instance_ID {
  LIN2_BO_LAST      elementIdentifier(91),
  LIN2_BO_LAST      lengthIndicator,
  octetstring       id_value
} with {
  variant "PRESENCE (elementIdentifier = 91; )"
  variant (lengthIndicator) "LENGTHTO(id_value )"
}

// 8.2.61 Flow Information
type record Flow_Information {
  LIN2_BO_LAST      elementIdentifier(92),
  LIN2_BO_LAST      lengthIndicator,
  INT3b             flow_direction,
  BIT5              spare,
  LIN2_BO_LAST      lengthFlowDesc,
  octetstring       flow_description
} with {
  variant "PRESENCE (elementIdentifier = 92; )"
  variant (lengthFlowDesc) "LENGTHTO(flow_description)"
  variant (lengthIndicator) "LENGTHTO(flow_direction,spare,lengthFlowDesc,flow_description )"
}

// 8.2.62 UE IP Address
type record UE_IP_Address {
  LIN2_BO_LAST      elementIdentifier(93),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              v6,
  BIT1              v4,
  BIT1              sd,
  BIT5              spare,
  OCT4              ipv4_address optional,
  OCT16             ipv6_address optional
} with {
  variant (ipv4_address) "PRESENCE (v4 = '1'B )"
  variant (ipv6_address) "PRESENCE (v6 = '1'B )"
  variant "PRESENCE (elementIdentifier = 93; )"
  variant (lengthIndicator) "LENGTHTO(v4,v6,sd,spare,ipv4_address,ipv6_address)"
}

// 8.2.63 Packet Rate
type record Packet_Rate {
  LIN2_BO_LAST      elementIdentifier(94),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              ulpr,
  BIT1              dlpr,
  BIT6              spare,
  BIT3              uplink_time_unit optional,
  BIT5              spare2 optional,
  LIN2_BO_LAST      max_uplink_rate optional,
  BIT3              downlink_time_unit optional,
  BIT5              spare3 optional,
  LIN2_BO_LAST      max_donwlink_rate optional
} with {
  variant (uplink_time_unit,spare2,max_uplink_rate) "PRESENCE (ulpr = '1'B )"
  variant (downlink_time_unit,spare3,max_donwlink_rate) "PRESENCE (dlpr = '1'B )"
  variant "PRESENCE (elementIdentifier = 94; )"
  variant (lengthIndicator) "LENGTHTO(ulpr,dlpr,spare,uplink_time_unit,spare2,max_uplink_rate,downlink_time_unit,spare3,max_donwlink_rate)"
}

// 8.2.64 Outer Header Removal
type record Outer_Header_Removal {
  LIN2_BO_LAST      elementIdentifier(95),
  LIN2_BO_LAST      lengthIndicator,
  INT1              ohc_description
} with {
  variant "PRESENCE (elementIdentifier = 95; )"
  variant (lengthIndicator) "LENGTHTO(ohc_description )"
}

// 8.2.65 Recovery Time Stamp
type record Recovery_Time_Stamp {
  LIN2_BO_LAST      elementIdentifier(96),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      time_value
} with {
  variant "PRESENCE (elementIdentifier = 96; )"
  variant (lengthIndicator) "LENGTHTO(time_value )"
}

// 8.2.66 DL Flow Level Marking
type record DL_Flow_Level_Marking {
  LIN2_BO_LAST      elementIdentifier(97),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              ttc,
  BIT1              sci,
  BIT6              spare,
  OCT2              tos optional,
  OCT2              sci_val optional
} with {
  variant (tos) "PRESENCE (ttc = '1'B )"
  variant (sci_val) "PRESENCE (sci = '1'B )"
  variant "PRESENCE (elementIdentifier = 97; )"
  variant (lengthIndicator) "LENGTHTO(ttc,sci,spare,tos,sci_val)"
}

// 8.2.67 Header Enrichment
type record Header_Enrichment {
  LIN2_BO_LAST      elementIdentifier(98),
  LIN2_BO_LAST      lengthIndicator,
  INT5b             header_type,
  BIT3              spare,
  INT1              header_name_length,
  octetstring       header_name,
  INT1              header_val_length,
  octetstring       header_val
} with {
  variant "PRESENCE (elementIdentifier = 98; )"
  variant (header_val_length) "LENGTHTO( header_val)"
  variant (header_name_length) "LENGTHTO( header_name)"
  variant (lengthIndicator) "LENGTHTO(header_type,spare,header_name_length,header_name,header_val_length,header_val)"
}

// 8.2.68 Measurement Information
type record Measurement_Information {
  LIN2_BO_LAST      elementIdentifier(100),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              mbqe,
  BIT1              inam,
  BIT1              radi,
  BIT5              spare
} with {
  variant "PRESENCE (elementIdentifier = 100; )"
  variant (lengthIndicator) "LENGTHTO(mbqe,inam,radi,spare)"
}

// 8.2.69 Node Report Type
type record Node_Report_Type {
  LIN2_BO_LAST      elementIdentifier(101),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              upfr,
  BIT7              spare
} with {
  variant "PRESENCE (elementIdentifier = 101; )"
  variant (lengthIndicator) "LENGTHTO(upfr,spare)"
}

// 8.2.70 Remote GTP-U Peer
type record Remote_GTP_U_Peer {
  LIN2_BO_LAST      elementIdentifier(103),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              v4,
  BIT1              v6,
  BIT6              spare,
  OCT4              ipv4_address optional,
  OCT16             ipv6_address optional
} with {
  variant (ipv4_address) "PRESENCE (v4 = '1'B )"
  variant (ipv6_address) "PRESENCE (v6 = '1'B )"
  variant "PRESENCE (elementIdentifier = 103; )"
  variant (lengthIndicator) "LENGTHTO(v4,v6,spare,ipv4_address,ipv6_address)"
}

// 8.2.71 UR-SEQN
type record UR_SEQN {
  LIN2_BO_LAST      elementIdentifier(104),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      ur_seqn
} with {
  variant "PRESENCE (elementIdentifier = 104; )"
  variant (lengthIndicator) "LENGTHTO( ur_seqn)"
}

// 8.2.72 Activate Predefined Rules
type record Activate_Predefined_Rules {
  LIN2_BO_LAST      elementIdentifier(106),
  LIN2_BO_LAST      lengthIndicator,
  octetstring       rule_bame
} with {
  variant "PRESENCE (elementIdentifier = 106; )"
  variant (lengthIndicator) "LENGTHTO( rule_bame)"
}

// 8.2.73 Deactivate Predefined Rules
type record Deactivate_Predefined_Rules {
  LIN2_BO_LAST      elementIdentifier(107),
  LIN2_BO_LAST      lengthIndicator,
  octetstring       rule_bame
} with {
  variant "PRESENCE (elementIdentifier = 107; )"
  variant (lengthIndicator) "LENGTHTO( rule_bame)"
}

// 8.2.74 FAR ID
type record FAR_ID {
  LIN2_BO_LAST      elementIdentifier(108),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      id_value
} with {
  variant "PRESENCE (elementIdentifier = 108; )"
  variant (lengthIndicator) "LENGTHTO(id_value )"
}

// 8.2.75 QER ID
type record QER_ID {
  LIN2_BO_LAST      elementIdentifier(109),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      id_value
} with {
  variant "PRESENCE (elementIdentifier = 109; )"
  variant (lengthIndicator) "LENGTHTO(id_value )"
}

type record of QER_ID QER_ID_list;

// 8.2.76 OCI Flags
type record OCI_Flags {
  LIN2_BO_LAST      elementIdentifier(110),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              aoci,
  BIT7              spare
} with {
  variant "PRESENCE (elementIdentifier = 110; )"
  variant (lengthIndicator) "LENGTHTO(aoci,spare)"
}

// 8.2.77 PFCP Association Release Request
type record PFCP_Association_Release_Request_IE {
  LIN2_BO_LAST      elementIdentifier(111),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              sarr,
  BIT7              spare
} with {
  variant "PRESENCE (elementIdentifier = 111; )"
  variant (lengthIndicator) "LENGTHTO(sarr,spare)"
}

// 8.2.78 Graceful Release Period
type record Graceful_Release_Period {
  LIN2_BO_LAST      elementIdentifier(112),
  LIN2_BO_LAST      lengthIndicator,
  BIT5              timer_value,
  BIT3              timer_unit
} with {
  variant "PRESENCE (elementIdentifier = 112; )"
  variant (lengthIndicator) "LENGTHTO(timer_value,timer_unit)"
}

// 8.2.79 PDN Type
type record PDN_Type {
  LIN2_BO_LAST      elementIdentifier(113),
  LIN2_BO_LAST      lengthIndicator,
  INT3b             pdn_type,
  BIT5              spare
} with {
  variant "PRESENCE (elementIdentifier = 113; )"
  variant (lengthIndicator) "LENGTHTO(pdn_type,spare)"
}

// 8.2.80 Failed Rule ID
type record Failed_Rule_ID {
  LIN2_BO_LAST      elementIdentifier(114),
  LIN2_BO_LAST      lengthIndicator,
  INT5b             rule_id_type,
  BIT3              spare,
  octetstring       rule_id_val
} with {
  variant "PRESENCE (elementIdentifier = 114; )"
  variant (lengthIndicator) "LENGTHTO(rule_id_type,spare,rule_id_val)"
}

// 8.2.81 Time Quota Mechanism
type record Time_Quota_Mechanism {
  LIN2_BO_LAST      elementIdentifier(115),
  LIN2_BO_LAST      lengthIndicator,
  INT2b             btit,
  BIT6              spare,
  LIN4_BO_LAST      base_time_interval
} with {
  variant "PRESENCE (elementIdentifier = 115; )"
  variant (lengthIndicator) "LENGTHTO(btit,spare,base_time_interval)"
}

// 8.2.82 UP_IP_Resource_Information
type record UP_IP_Resource_Information {
  LIN2_BO_LAST      elementIdentifier(116),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              v4,
  BIT1              v6,
  INT3b             teidri,
  BIT1              assoni,
  BIT2              spare,
  OCT1              teid_range optional,
  OCT4              ipv4_address optional,
  OCT16             ipv6_address optional,
  octetstring       network_instance optional
} with {
  variant (ipv4_address) "PRESENCE(v4 = '1'B)"
  variant (ipv6_address) "PRESENCE(v6 = '1'B)"
  variant (network_instance) "PRESENCE(assoni = '1'B)"
  variant (teid_range) "PRESENCE({teidri=1,teidri=2,teidri=3,teidri=4,teidri=5,teidri=6,teidri=7})"
  variant "PRESENCE (elementIdentifier = 116; )"
  variant (lengthIndicator) "LENGTHTO(v4,v6,teidri,assoni,spare,teid_range,ipv4_address,ipv6_address,network_instance)"
}

type record of UP_IP_Resource_Information UP_IP_Resource_Information_list;

// 8.2.83 UP_Inactivity_Timer
type record UP_Inactivity_Timer {
  LIN2_BO_LAST      elementIdentifier(117),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      UP_inactivity_timer
} with {
  variant "PRESENCE (elementIdentifier = 117; )"
  variant (lengthIndicator) "LENGTHTO(UP_inactivity_timer)"
}

// 8.2.84 Multiplier
type record Multiplier {
  LIN2_BO_LAST      elementIdentifier(119),
  LIN2_BO_LAST      lengthIndicator,
  integer           value_digits,
  integer           exponent
} with {
  variant "PRESENCE (elementIdentifier = 119; )"
  variant (value_digits) "FIELDLENGTH(64), BYTEORDER(last)"
  variant (exponent) "FIELDLENGTH(32), BYTEORDER(last)"
  variant (lengthIndicator) "LENGTHTO(value_digits,exponent)"
}

// 8.2.85 Aggregated_URR_ID_IE
type record Aggregated_URR_ID {
  LIN2_BO_LAST      elementIdentifier(120),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      id_value
} with {
  variant "PRESENCE (elementIdentifier = 120; )"
  variant (lengthIndicator) "LENGTHTO(id_value)"
}

// 8.2.86 Subsequent_Volume_Quota
type record Subsequent_Volume_Quota {
  LIN2_BO_LAST      elementIdentifier(121),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              tovol,
  BIT1              ulvol,
  BIT1              dlvol,
  BIT5              spare,
  LIN8_BO_LAST      total_volume optional,
  LIN8_BO_LAST      uplink_volume optional,
  LIN8_BO_LAST      downlink_volume optional
} with {
  variant "PRESENCE (elementIdentifier = 121; )"
  variant (total_volume) "PRESENCE ( tovol= '1'B )"
  variant (uplink_volume) "PRESENCE ( ulvol= '1'B )"
  variant (downlink_volume) "PRESENCE ( dlvol= '1'B )"
  variant (lengthIndicator) "LENGTHTO(tovol,ulvol,dlvol,spare,total_volume,uplink_volume,downlink_volume )"
}

// 8.2.87 Subsequent_Time_Quota
type record Subsequent_Time_Quota {
  LIN2_BO_LAST      elementIdentifier(122),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      time_qouta_value
} with {
  variant "PRESENCE (elementIdentifier = 122; )"
  variant (lengthIndicator) "LENGTHTO(time_qouta_value)"
}

// 8.2.88 RQI
type record RQI {
  LIN2_BO_LAST      elementIdentifier(123),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              rqi,
  BIT7              spare
} with {
  variant "PRESENCE (elementIdentifier = 123; )"
  variant (lengthIndicator) "LENGTHTO(rqi,spare)"
}

// 8.2.89 QFI
type record QFI {
  LIN2_BO_LAST      elementIdentifier(124),
  LIN2_BO_LAST      lengthIndicator,
  octetstring       qfi_value
} with {
  variant "PRESENCE (elementIdentifier = 124; )"
  variant (lengthIndicator) "LENGTHTO(qfi_value)"
}


// 8.2.90 Query URR Reference
type record Query_URR_Reference {
  LIN2_BO_LAST      elementIdentifier(125),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      query_URR_reference_value
} with {
  variant "PRESENCE (elementIdentifier = 125; )"
  variant (lengthIndicator) "LENGTHTO(query_URR_reference_value)"
}

// 8.2.91 Additional Usage Reports Information
type record Additional_Usage_Reports_Information {
  LIN2_BO_LAST      elementIdentifier(126),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              auri,
  integer           no_aur_value
} with {
  variant "PRESENCE (elementIdentifier = 126; )"
  variant (auri,no_aur_value) "FIELDORDER(msb)"
  variant (no_aur_value) "FIELDLENGTH(15), COMP(nosign), BYTEORDER(last)"
  variant (lengthIndicator) "LENGTHTO(auri,no_aur_value)"
}


// 8.2.92 Traffic Endpoint ID
type record Traffic_Endpoint_ID {
  LIN2_BO_LAST      elementIdentifier(131),
  LIN2_BO_LAST      lengthIndicator,
  INT1              endpoint_id
} with {
  variant "PRESENCE (elementIdentifier = 131; )"
  variant (lengthIndicator) "LENGTHTO(endpoint_id)"
}

// 8.2.93 MAC address
type record MAC_address {
  LIN2_BO_LAST      elementIdentifier(133),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              sour,
  BIT1              dest,
  BIT1              usou,
  BIT1              udes,
  BIT4              spare,
  OCT6              source_mac_adress optional,
  OCT6              dest_mac_adress optional,
  OCT6              upper_source_mac_adress optional,
  OCT6              upper_dest_mac_adress optional
} with {
  variant "PRESENCE (elementIdentifier = 133; )"
  variant (source_mac_adress) "PRESENCE(sour='1'B)"
  variant (dest_mac_adress) "PRESENCE(dest='1'B)"
  variant (upper_dest_mac_adress) "PRESENCE(udes='1'B)"
  variant (upper_source_mac_adress) "PRESENCE(usou='1'B)"
  variant (lengthIndicator) "LENGTHTO(sour,dest,usou,udes,spare,source_mac_adress,dest_mac_adress,upper_source_mac_adress,upper_dest_mac_adress)"
}


// 8.2.94 C-Tag
type record C_TAG {
  LIN2_BO_LAST      elementIdentifier(134),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              pcp,
  BIT1              dei,
  BIT1              vid,
  BIT5              spare,
  BIT3              pcp_value,
  BIT1              dei_flag,
  BIT12             c_vid_value
} with {
  variant "PRESENCE (elementIdentifier = 134; )"
  variant (lengthIndicator) "LENGTHTO(pcp,dei,vid,spare,pcp_value,dei_flag,c_vid_value)"
}

// 8.2.95 S-Tag
type record S_TAG {
  LIN2_BO_LAST      elementIdentifier(135),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              pcp,
  BIT1              dei,
  BIT1              vid,
  BIT5              spare,
  BIT3              pcp_value,
  BIT1              dei_flag,
  BIT12             c_vid_value
} with {
  variant "PRESENCE (elementIdentifier = 135; )"
  variant (lengthIndicator) "LENGTHTO(pcp,dei,vid,spare,pcp_value,dei_flag,c_vid_value)"
}

// 8.2.96 Ether Type
type record Ether_Type {
  LIN2_BO_LAST      elementIdentifier(136),
  LIN2_BO_LAST      lengthIndicator,
  OCT2              ethertype
} with {
  variant "PRESENCE (elementIdentifier = 136; )"
  variant (lengthIndicator) "LENGTHTO(ethertype)"
}

// 8.2.97 Proxying
type record Proxying {
  LIN2_BO_LAST      elementIdentifier(137),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              arp,
  BIT1              ins,
  BIT6              spare
} with {
  variant "PRESENCE (elementIdentifier = 137; )"
  variant (lengthIndicator) "LENGTHTO(arp,ins,spare)"
}

// 8.2.98 Ether Filter ID
type record Ethernet_Filter_ID {
  LIN2_BO_LAST      elementIdentifier(138),
  LIN2_BO_LAST      lengthIndicator,
  LIN4_BO_LAST      ether_filter_ID_value
} with {
  variant "PRESENCE (elementIdentifier = 138; )"
  variant (lengthIndicator) "LENGTHTO(ether_filter_ID_value)"
}
// 8.2.99 Ethernet Filter Properties
type record Ethernet_Filter_Properties {
  LIN2_BO_LAST      elementIdentifier(139),
  LIN2_BO_LAST      lengthIndicator,
  BIT1              bide,
  BIT7              spare
} with {
  variant "PRESENCE (elementIdentifier = 139; )"
  variant (lengthIndicator) "LENGTHTO(bide,spare)"
}


// Message Header
// 7.2
type record PDU_PFCP {
  BIT1              s_flag,
  BIT1              mp,
  BIT3              spare,
  INT3b             version,
  INT1              message_type,
  LIN2_BO_LAST      lengthIndicator,
  OCT8              seid optional,
  LIN3_BO_LAST      sequence_number,
  BIT4              spare2,
  BIT4              mp_or_spare,  // valid only if mp == '1'B, should be '0000'B otherwise
  PFCP_message_body message_body
} with {
  variant (seid) "PRESENCE(s_flag = '1'B)"
  variant (lengthIndicator) "LENGTHTO(seid,sequence_number,spare2,mp_or_spare,message_body)"
  variant (message_body) " CROSSTAG(
     heartbeat_request,                    message_type = 1;
     heartbeat_response,                   message_type = 2;
     pfcp_PFD_management_request,            message_type = 3;
     pfcp_PFD_management_response,           message_type = 4;
     pfcp_association_setup_request,         message_type = 5;
     pfcp_association_setup_response,        message_type = 6;
     pfcp_association_update_request,        message_type = 7;
     pfcp_association_update_response,       message_type = 8;
     pfcp_association_release_request,       message_type = 9;
     pfcp_association_release_response,      message_type = 10;
     pfcp_version_not_supported_response,    message_type = 11;
     pfcp_node_report_request,               message_type = 12;
     pfcp_node_report_response,              message_type = 13;
     pfcp_session_set_deletion_request,      message_type = 14;
     pfcp_session_set_deletion_response,     message_type = 15;
     pfcp_session_establishment_request,     message_type = 50;
     pfcp_session_establishment_response,    message_type = 51;
     pfcp_session_modification_request,      message_type = 52;
     pfcp_session_modification_response,     message_type = 53;
     pfcp_session_deletion_request,          message_type = 54;
     pfcp_session_deletion_response,         message_type = 55;
     pfcp_session_report_request,            message_type = 56;
     pfcp_session_report_response,           message_type = 57;
  )"
}

// 7.4 PFCP Node Related Messages

// 7.4.2.1  Heartbeat Request
type set Heartbeat_Request {
  Recovery_Time_Stamp  recovery_time_stamp
}

// 7.4.2.1  Heartbeat Response
type set Heartbeat_Response {
  Recovery_Time_Stamp  recovery_time_stamp
}

// 7.4.3.2 PFCP PFD Management Request
type set PFCP_PFD_Management_Request {
  record of Application_IDs_PFDs  application_IDs_PFDs_list optional
} with {
  variant (application_IDs_PFDs_list) "REPEATABLE(yes)"
}

// 7.4.3.1-2 Application ID's PFDs
type record Application_IDs_PFDs {
  LIN2_BO_LAST      elementIdentifier(58),
  LIN2_BO_LAST      lengthIndicator,
  set {
    Application_ID    application_id,
    record of PFD     PFDs optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 58; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
  variant (grouped_ie.PFDs) "REPEATABLE(yes)"
}

// 7.4.3.1-3
type record PFD {
  LIN2_BO_LAST      elementIdentifier(59),
  LIN2_BO_LAST      lengthIndicator,
  set {
    record of PFD_Contents  PFD_Contents_list
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 59; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
  variant (grouped_ie.PFD_Contents_list) "REPEATABLE(yes)"
}

// 7.4.3.2 PFCP PFD Management Response
type set PFCP_PFD_Management_Response {
  Cause             cause,
  Offending_IE      offending_ie optional
}

// 7.4.4.1 PFCP Association Setup Request
type set PFCP_Association_Setup_Request{
  Node_ID               node_id,
  Recovery_Time_Stamp   time_stamp,
  UP_Function_Features  up_function_features optional,
  CP_Function_Features  cp_function_features optional,
  UP_IP_Resource_Information_list UP_IP_resource_list optional
} with {
  variant (UP_IP_resource_list) "REPEATABLE(yes)"
}


// 7.4.4.2 PFCP Association Setup Response
type set PFCP_Association_Setup_Response{
  Node_ID               node_id,
  Cause                 cause,
  Recovery_Time_Stamp   time_stamp,
  UP_Function_Features  up_function_features optional,
  CP_Function_Features  cp_function_features optional,
  UP_IP_Resource_Information_list UP_IP_resource_list optional
} with {
  variant (UP_IP_resource_list) "REPEATABLE(yes)"
}


// 7.4.4.3 PFCP Association Update Request
type set PFCP_Association_Update_Request{
  Node_ID               node_id,
  UP_Function_Features  up_function_features optional,
  CP_Function_Features  cp_function_features optional,
  PFCP_Association_Release_Request_IE sarr optional,
  Graceful_Release_Period graceful_release_period optional,
  UP_IP_Resource_Information_list UP_IP_resource_list optional
} with {
  variant (UP_IP_resource_list) "REPEATABLE(yes)"
}

// 7.4.4.4 PFCP Association Setup Response
type set PFCP_Association_Update_Response{
  Node_ID               node_id,
  Cause                 cause,
  UP_Function_Features  up_function_features optional,
  CP_Function_Features  cp_function_features optional
}

// 7.4.4.5 PFCP Association Release Request
type set PFCP_Association_Release_Request{
  Node_ID               node_id
}

// 7.4.4.6 PFCP Association Release Response
type set PFCP_Association_Release_Response{
  Node_ID               node_id,
  Cause                 cause
}

// 7.4.4.7 PFCP Version Not Supported Response
type set PFCP_Version_Not_Supported_Response{
}

// 7.4.5.1 PFCP Node Report Request
type set PFCP_Node_Report_Request{
  Node_ID               node_id,
  Node_Report_Type      node_report_type,
  User_Plane_Path_Failure_Report failure_report optional
}

// User Plane Path Failure IE within PFCP Node Report Request
type record User_Plane_Path_Failure_Report {
  LIN2_BO_LAST      elementIdentifier(102),
  LIN2_BO_LAST      lengthIndicator,
  set {
    record of Remote_GTP_U_Peer  remote_GTP_U_peer_list
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 102; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
  variant (grouped_ie.remote_GTP_U_peer_list) "REPEATABLE(yes)"
}

// 7.4.5.2 PFCP Node Report Response
type set PFCP_Node_Report_Response{
  Node_ID               node_id,
  Cause                 cause,
  Offending_IE          offending_IE optional
}

// 7.4.6.1 PFCP Session Set Deletion Request
type set PFCP_Session_Set_Deletion_Request{
  Node_ID               node_id,
  FQ_CSID_list          node_list optional
} with {
  variant (node_list) "REPEATABLE(yes)"
}

// 7.4.6.2 PFCP Session Set Deletion Response
type set PFCP_Session_Set_Deletion_Response{
  Node_ID               node_id,
  Cause                 cause,
  Offending_IE          offending_IE optional
}

// 7.5.2 PFCP Session Establishment Request
type set PFCP_Session_Establishment_Request{
  Node_ID               node_id,
  F_SEID                CP_F_SEID,
  Create_PDR_list       create_PDR_list,
  Create_FAR_list       create_FAR_list,
  Create_URR_list       create_URR_list optional,
  Create_QER_list       create_QER_list optional,
  Create_BAR            create_BAR optional,
  record of Create_Traffic_Endpoint create_traffic_endpoint_list optional,
  PDN_Type              pdn_type optional,
  FQ_CSID_list          node_list optional,
  UP_Inactivity_Timer   up_inactivity_timer optional
} with {
  variant (create_PDR_list) "REPEATABLE(yes)"
  variant (create_FAR_list) "REPEATABLE(yes)"
  variant (create_URR_list) "REPEATABLE(yes)"
  variant (create_QER_list) "REPEATABLE(yes)"
  variant (node_list) "REPEATABLE(yes)"
}

type record Create_Traffic_Endpoint {
  LIN2_BO_LAST      elementIdentifier(127),
  LIN2_BO_LAST      lengthIndicator,
  set {
    Traffic_Endpoint_ID         traffic_endpint_id,
    F_TEID                      local_F_TEID optional,
    Network_Instance            network_instance optional,
    UE_IP_Address               ue_ip_address optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 127; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Create_PDR{
  LIN2_BO_LAST      elementIdentifier(1),
  LIN2_BO_LAST      lengthIndicator,
  set {
    PDR_ID                      pdr_id,
    Precedence                  precedence optional,
    PDI_IE                      pdi,
    Outer_Header_Removal        outer_header_removal optional,
    record of FAR_ID            FAR_ID_list optional,
    URR_ID_list                 uRR_ID_list optional,
    QER_ID_list                 qER_ID_list optional,
    Activate_Predefined_Rules   activate_predefined_rules optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 1; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
  variant (grouped_ie.FAR_ID_list) "REPEATABLE(yes)"
  variant (grouped_ie.uRR_ID_list) "REPEATABLE(yes)"
  variant (grouped_ie.qER_ID_list) "REPEATABLE(yes)"
}

type record of Create_PDR Create_PDR_list;

type record PDI_IE {
  LIN2_BO_LAST      elementIdentifier(2),
  LIN2_BO_LAST      lengthIndicator,
  set {
    Source_Interface             source_interface,
    F_TEID                       local_F_TEID optional,
    PDN_Instance                 pdn_instance optional,
    UE_IP_Address                ue_ip_address optional,
    Traffic_Endpoint_ID          traffic_endpoint_id optional,
    SDF_Filter_list              sdf_filter_list optional,
    Application_ID               application_id optional,
    record of Ethernet_Packet_Filter  ethernet_packet_filter_list optional,
    record of QFI                qfi_list optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 2; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
  variant (grouped_ie.sdf_filter_list) "REPEATABLE(yes)"
  variant (grouped_ie.ethernet_packet_filter_list) "REPEATABLE(yes)"
  variant (grouped_ie.qfi_list) "REPEATABLE(yes)"
}

type record Ethernet_Packet_Filter {
  LIN2_BO_LAST      elementIdentifier(132),
  LIN2_BO_LAST      lengthIndicator,
  set {
    Ethernet_Filter_ID           ethernet_filter_id optional,
    Ethernet_Filter_Properties   ethernet_filter_properties optional,
    MAC_address                  mac_address optional,
    Ether_Type                   ethertype optional,
    C_TAG                        c_tag optional,
    S_TAG                        s_tag optional,
    SDF_Filter_list              sdf_filter_list optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 132; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
  variant (grouped_ie.sdf_filter_list) "REPEATABLE(yes)"
}

type record of Create_FAR Create_FAR_list;

type record Create_FAR{
  LIN2_BO_LAST      elementIdentifier(3),
  LIN2_BO_LAST      lengthIndicator,
  set {
    FAR_ID                      far_id,
    Apply_Action                apply_action,
    Forwarding_Parameters       forwarding_parameters optional,
    Duplicating_Parameters      duplicating_parameters optional,
    BAR_ID                      bar_id optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 3; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Forwarding_Parameters {
  LIN2_BO_LAST      elementIdentifier(4),
  LIN2_BO_LAST      lengthIndicator,
  set {
    Destination_Interface       destination_interface,
    PDN_Instance                pdn_Instance optional,
    Redirect_Information        redirect_information optional,
    Outer_Header_Creation       outer_header_creation optional,
    DL_Transport_Level_Marking  transport_level_marking optional,
    Forwarding_Policy           forwarding_policy optional,
    Header_Enrichment           header_enrichment optional,
    Traffic_Endpoint_ID         traffic_endpoint_ID optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 4; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Duplicating_Parameters {
  LIN2_BO_LAST      elementIdentifier(5),
  LIN2_BO_LAST      lengthIndicator,
  set {
    Destination_Interface       destination_interface,
    Outer_Header_Creation       outer_header_creation optional,
    DL_Transport_Level_Marking  transport_level_marking optional,
    Forwarding_Policy           forwarding_policy optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 5; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Create_URR{
  LIN2_BO_LAST      elementIdentifier(6),
  LIN2_BO_LAST      lengthIndicator,
  set {
    URR_ID                      urr_id,
    Measurement_Method          measurement_method,
    Reporting_Triggers          reporting_triggers,
    Measurement_Period          measurement_period optional,
    Volume_Threshold            volume_threshold optional,
    Volume_Quota                volume_quota optional,
    Time_Threshold              time_threshold optional,
    Time_Quota                  time_quota optional,
    Quota_Holding_Time          quota_holding_time optional,
    Dropped_DL_Traffic_Threshold dropped_dl_traffic_threshold optional,
    Monitoring_Time             monitoring_time optional,
    Subsequent_Volume_Threshold subsequent_volume_threshold optional,
    Subsequent_Time_Threshold   subsequent_time_threshold optional,
    Subsequent_Volume_Quota     subsequent_volume_quota optional,
    Subsequent_Time_Quota       subsequent_time_quota optional,
    Inactivity_Detection_Time   inactivity_detection_time optional,
    Linked_URR_ID               linked_urr_id optional,
    Measurement_Information     measurement_information optional,
    Time_Quota_Mechanism        time_qouta_mechanism optional,
    Aggregated_URR_list         aggregated_urrs optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 6; )"
  variant (grouped_ie.aggregated_urrs) "REPEATABLE(yes)"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record of Create_URR Create_URR_list;

type record Aggregated_URR{
  LIN2_BO_LAST      elementIdentifier(118),
  LIN2_BO_LAST      lengthIndicator,
  set {
    Aggregated_URR_ID           aggregated_urr_id,
    Multiplier                  multiplier
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 118; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}
type record of Aggregated_URR Aggregated_URR_list;

type record Create_QER{
  LIN2_BO_LAST      elementIdentifier(7),
  LIN2_BO_LAST      lengthIndicator,
  set {
    QER_ID                      qer_id,
    QER_Correlation_ID          qer_correlation_id optional,
    Gate_Status                 gate_status,
    MBR                         mbr optional,
    GBR                         gbr optional,
    Packet_Rate                 packet_rate optional,
    DL_Transport_Level_Marking  dl_transport_level_marking optional,
    QFI                         qfi optional,
    RQI                         rqi optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 7; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record of Create_QER Create_QER_list;

type record Create_BAR{
  LIN2_BO_LAST      elementIdentifier(85),
  LIN2_BO_LAST      lengthIndicator,
  set {
    BAR_ID                      bar_id,
    Downlink_Data_Notification_Delay downlink_data_notification_delay optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 85; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

// 7.5.3 PFCP Session Establishment Response
type set PFCP_Session_Establishment_Response {
  Node_ID               node_id,
  Cause                 cause,
  Offending_IE          offending_ie optional,
  F_SEID                UP_F_SEID,
  record of Created_PDR created_PDR_list,
  Load_Control_Information load_control_information optional,
  Overload_Control_Information overload_control_information optional,
  FQ_CSID_list          node_list optional,
  Failed_Rule_ID        failed_rule_id optional,
  record of Created_Traffic_Endpoint created_traffic_endpoint_list optional
} with {
  variant (created_PDR_list) "REPEATABLE(yes)"
  variant (node_list) "REPEATABLE(yes)"
  variant (created_traffic_endpoint_list) "REPEATABLE(yes)"
}

type record Created_PDR{
  LIN2_BO_LAST      elementIdentifier(8),
  LIN2_BO_LAST      lengthIndicator,
  set {
    PDR_ID                      pdr_id,
    F_TEID                      local_F_TEID optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 8; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Load_Control_Information{
  LIN2_BO_LAST      elementIdentifier(50),
  LIN2_BO_LAST      lengthIndicator,
  set {
     Sequence_Number            sequence_number,
     Metric                     local_metric
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 50; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Overload_Control_Information{
  LIN2_BO_LAST      elementIdentifier(54),
  LIN2_BO_LAST      lengthIndicator,
  set {
     Sequence_Number            sequence_number,
     Metric                     overload_reduction_metric,
     Timer_IE                   period_of_validity,
     OCI_Flags                  oci_flags
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 54; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Created_Traffic_Endpoint {
  LIN2_BO_LAST      elementIdentifier(128),
  LIN2_BO_LAST      lengthIndicator,
  set {
    Traffic_Endpoint_ID         traffic_endpint_id,
    F_TEID                      local_F_TEID optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 128; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

// 7.5.4 PFCP Session Modification Request
type set PFCP_Session_Modification_Request {
  F_SEID                              f_seid optional,
  record of Remove_PDR                remove_PDR_list optional,
  record of Remove_FAR                remove_FAR_list optional,
  record of Remove_URR                remove_URR_list optional,
  record of Remove_QER                remove_QER_list optional,
  Remove_BAR                          remove_BAR optional,
  Remove_Traffic_Endpoint             remove_traffic_endpoint optional,
  Create_PDR_list                     create_PDR_list optional,
  Create_FAR_list                     create_FAR_list optional,
  Create_URR_list                     create_URR_list optional,
  Create_QER_list                     create_QER_list optional,
  Create_BAR                          create_BAR  optional,
  Create_Traffic_Endpoint             create_traffic_endpoint optional,
  record of Update_PDR                update_PDR_list optional,
  record of Update_FAR                update_FAR_list optional,
  record of Update_URR                update_URR_list optional,
  record of Update_QER                update_QER_list optional,
  Update_BAR                          update_BAR optional,
  Update_Traffic_Endpoint             update_traffic_endpoint optional,
  PFCPSMReq_Flags                     pfcpSMReq_flags optional,
  record of Query_URR                 query_URR_list optional,
  FQ_CSID_list                        node_list optional,
  UP_Inactivity_Timer                 up_inactivity_timer optional,
  Query_URR_Reference                 querry_urr_reference optional
} with {
  variant (remove_PDR_list) "REPEATABLE(yes)"
  variant (remove_FAR_list) "REPEATABLE(yes)"
  variant (remove_URR_list) "REPEATABLE(yes)"
  variant (remove_QER_list) "REPEATABLE(yes)"
  variant (update_PDR_list) "REPEATABLE(yes)"
  variant (update_FAR_list) "REPEATABLE(yes)"
  variant (update_URR_list) "REPEATABLE(yes)"
  variant (update_QER_list) "REPEATABLE(yes)"
  variant (query_URR_list) "REPEATABLE(yes)"
  variant (create_PDR_list) "REPEATABLE(yes)"
  variant (create_FAR_list) "REPEATABLE(yes)"
  variant (create_URR_list) "REPEATABLE(yes)"
  variant (create_QER_list) "REPEATABLE(yes)"
  variant (node_list) "REPEATABLE(yes)"
}

type record Update_PDR{
  LIN2_BO_LAST      elementIdentifier(9),
  LIN2_BO_LAST      lengthIndicator,
  set {
    PDR_ID                      pdr_id,
    Outer_Header_Removal        outer_header_removal optional,
    Precedence                  precedence optional,
    PDI_IE                      pdi optional,
    FAR_ID                      far_id optional,
    URR_ID_list                 uRR_ID_list optional,
    QER_ID_list                 qER_ID_list optional,
    Activate_Predefined_Rules   activate_predefined_rules optional,
    Deactivate_Predefined_Rules deactivate_predefined_rules optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 9; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
  variant (grouped_ie.uRR_ID_list) "REPEATABLE(yes)"
  variant (grouped_ie.qER_ID_list) "REPEATABLE(yes)"
}

type record Update_FAR{
  LIN2_BO_LAST      elementIdentifier(10),
  LIN2_BO_LAST      lengthIndicator,
  set {
    FAR_ID                      far_id,
    Apply_Action                apply_action optional,
    Update_Forwarding_Parameters       forwarding_parameters optional,
    Update_Duplicating_Parameters      duplicating_parameters optional,
    BAR_ID                      bar_id optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 10; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Update_Forwarding_Parameters {
  LIN2_BO_LAST      elementIdentifier(11),
  LIN2_BO_LAST      lengthIndicator,
  set {
    Destination_Interface       destination_interface optional,
    PDN_Instance                pdn_Instance optional,
    Redirect_Information        redirect_information optional,
    Outer_Header_Creation       outer_header_creation optional,
    DL_Transport_Level_Marking  transport_level_marking optional,
    Forwarding_Policy           forwarding_policy optional,
    Header_Enrichment           header_enrichment optional,
    PFCPSMReq_Flags             pfcpSMReq_flags optional,
    Traffic_Endpoint_ID         traffic_endpoint_id optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 11; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Update_Duplicating_Parameters {
  LIN2_BO_LAST      elementIdentifier(105),
  LIN2_BO_LAST      lengthIndicator,
  set {
    Destination_Interface       destination_interface optional,
    Outer_Header_Creation       outer_header_creation optional,
    DL_Transport_Level_Marking  transport_level_marking optional,
    Forwarding_Policy           forwarding_policy optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 105; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Update_URR{
  LIN2_BO_LAST      elementIdentifier(13),
  LIN2_BO_LAST      lengthIndicator,
  set {
    URR_ID                      urr_id,
    Measurement_Method          measurement_method optional,
    Reporting_Triggers          reporting_triggers optional,
    Measurement_Period          measurement_period optional,
    Volume_Threshold            volume_threshold optional,
    Volume_Quota                volume_quota optional,
    Time_Threshold              time_threshold optional,
    Time_Quota                  time_quota optional,
    Quota_Holding_Time          quota_holding_time optional,
    Dropped_DL_Traffic_Threshold dropped_dl_traffic_threshold optional,
    Monitoring_Time             monitoring_time optional,
    Subsequent_Volume_Threshold subsequent_volume_threshold optional,
    Subsequent_Time_Threshold   subsequent_time_threshold optional,
    Subsequent_Volume_Quota     subsequent_volume_quota optional,
    Subsequent_Time_Quota       subsequent_time_quota optional,
    Inactivity_Detection_Time   inactivity_detection_time optional,
    Linked_URR_ID               linked_urr_id optional,
    Measurement_Information     measurement_information optional,
    Time_Quota_Mechanism        time_qouta_mechanism optional,
    Aggregated_URR_list         aggregated_urrs optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 13; )"
  variant (grouped_ie.aggregated_urrs) "REPEATABLE(yes)"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Update_QER{
  LIN2_BO_LAST      elementIdentifier(14),
  LIN2_BO_LAST      lengthIndicator,
  set {
    QER_ID                      qer_id,
    QER_Correlation_ID          qer_correlation_id optional,
    Gate_Status                 gate_status optional,
    MBR                         mbr optional,
    GBR                         gbr optional,
    Packet_Rate                 packet_rate optional,
    DL_Flow_Level_Marking       dl_flow_level_marking optional,
    QFI                         qfi optional,
    RQI                         rqi optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 14; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Update_BAR{
  LIN2_BO_LAST      elementIdentifier(86),
  LIN2_BO_LAST      lengthIndicator,
  set {
    BAR_ID                      bar_id,
    Downlink_Data_Notification_Delay downlink_data_notification_delay optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 86; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Remove_PDR{
  LIN2_BO_LAST      elementIdentifier(15),
  LIN2_BO_LAST      lengthIndicator,
  set {
    PDR_ID                      pdr_id
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 15; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Remove_FAR{
  LIN2_BO_LAST      elementIdentifier(16),
  LIN2_BO_LAST      lengthIndicator,
  set {
    FAR_ID                      far_id
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 16; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Remove_URR{
  LIN2_BO_LAST      elementIdentifier(17),
  LIN2_BO_LAST      lengthIndicator,
  set {
    URR_ID                      urr_id
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 17; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Remove_QER{
  LIN2_BO_LAST      elementIdentifier(18),
  LIN2_BO_LAST      lengthIndicator,
  set {
    QER_ID                      qer_id
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 18; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Query_URR{
  LIN2_BO_LAST      elementIdentifier(77),
  LIN2_BO_LAST      lengthIndicator,
  set {
    URR_ID                      urr_id
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 77; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Remove_BAR{
  LIN2_BO_LAST      elementIdentifier(87),
  LIN2_BO_LAST      lengthIndicator,
  set {
    BAR_ID                      bar_id
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 87; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Update_Traffic_Endpoint {
  LIN2_BO_LAST      elementIdentifier(129),
  LIN2_BO_LAST      lengthIndicator,
  set {
    Traffic_Endpoint_ID         traffic_endpint_id,
    F_TEID                      local_F_TEID optional,
    Network_Instance            network_instance optional,
    UE_IP_Address               ue_ip_address optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 129; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Remove_Traffic_Endpoint {
  LIN2_BO_LAST      elementIdentifier(130),
  LIN2_BO_LAST      lengthIndicator,
  set {
    Traffic_Endpoint_ID         traffic_endpint_id
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 130; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

// 7.5.5 PFCP Session Modification Response
type set PFCP_Session_Modification_Response {
  Cause                               cause,
  Offending_IE                        offending_IE optional,
  Created_PDR                         created_PDR optional,
  Load_Control_Information            load_control_information optional,
  Overload_Control_Information        overload_control_information optional,
  record of Usage_Report_Modification_Response  usage_report optional,
  Failed_Rule_ID                      failed_rule_id optional,
  Additional_Usage_Reports_Information additional_usage_reports_information optional,
  Created_Traffic_Endpoint            created_updated_traffic_endpoint optional
} with {
  variant (usage_report) "REPEATABLE(yes)"
}

type record Usage_Report_Modification_Response {
  LIN2_BO_LAST      elementIdentifier(78),
  LIN2_BO_LAST      lengthIndicator,
  set {
    URR_ID                      urr_id,
    UR_SEQN                     ur_seqn,
    Usage_Report_Trigger        usage_report_trigger,
    Start_Time                  start_time optional,
    End_Time                    end_time optional,
    Volume_Measurement          volume_measurement optional,
    Duration_Measurement        duration_measurement optional,
    Time_of_First_Packet        time_of_first_packet optional,
    Time_of_Last_Packet         time_of_last_packet optional,
    Usage_Information           usage_information optional,
    Query_URR_Reference         query_urr_reference optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 78; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

// 7.5.6 PFCP Session Deletion Request
type set PFCP_Session_Deletion_Request{
}

// 7.5.7 PFCP Session Deletion Response
type set PFCP_Session_Deletion_Response {
  Cause                               cause,
  Offending_IE                        offending_IE optional,
  Load_Control_Information            load_control_information optional,
  Overload_Control_Information        overload_control_information optional,
  record of Usage_Report_Deletion_Response  usage_report optional
} with {
  variant (usage_report) "REPEATABLE(yes)"
}


type record Usage_Report_Deletion_Response {
  LIN2_BO_LAST      elementIdentifier(79),
  LIN2_BO_LAST      lengthIndicator,
  set {
    URR_ID                      urr_id,
    UR_SEQN                     ur_seqn,
    Usage_Report_Trigger        usage_report_trigger,
    Start_Time                  start_time optional,
    End_Time                    end_time optional,
    Volume_Measurement          volume_measurement optional,
    Duration_Measurement        duration_measurement optional,
    Time_of_First_Packet        time_of_first_packet optional,
    Time_of_Last_Packet         time_of_last_packet optional,
    Usage_Information           usage_information optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 79; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

// 7.5.8 PFCP Session Report Request
type set PFCP_Session_Report_Request {
  Report_Type                         report_type,
  Downlink_Data_Report                downlink_data_report optional,
  record of Usage_Report_Report_Request usage_report optional,
  Error_Indication_Report             error_indication_report optional,
  Load_Control_Information            load_control_information optional,
  Overload_Control_Information        overload_control_information optional,
  Additional_Usage_Reports_Information additional_usage_reports_information optional
} with {
  variant (usage_report) "REPEATABLE(yes)"
}

type record Downlink_Data_Report {
  LIN2_BO_LAST      elementIdentifier(83),
  LIN2_BO_LAST      lengthIndicator,
  set {
    record of PDR_ID                      pdr_id_list,
    record of Downlink_Data_Service_Information dl_service_information_list optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 83; )"
  variant (grouped_ie.pdr_id_list) "REPEATABLE(yes)"
  variant (grouped_ie.dl_service_information_list) "REPEATABLE(yes)"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Usage_Report_Report_Request {
  LIN2_BO_LAST      elementIdentifier(80),
  LIN2_BO_LAST      lengthIndicator,
  set {
    URR_ID                      urr_id,
    UR_SEQN                     ur_seqn,
    Usage_Report_Trigger        usage_report_trigger,
    Start_Time                  start_time optional,
    End_Time                    end_time optional,
    Volume_Measurement          volume_measurement optional,
    Duration_Measurement        duration_measurement optional,
    Application_Detection_Information application_detection_information optional,
    UE_IP_Address               ue_ip_address optional,
    PDN_Instance                pdn_instance optional,
    Time_of_First_Packet        time_of_first_packet optional,
    Time_of_Last_Packet         time_of_last_packet optional,
    Usage_Information           usage_information optional,
    Query_URR_Reference         query_urr_reference optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 80; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Application_Detection_Information {
  LIN2_BO_LAST      elementIdentifier(68),
  LIN2_BO_LAST      lengthIndicator,
  set {
    Application_ID               application_id,
    Application_Instance_ID      application_instance_id optional,
    Flow_Information             flow_information optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 68; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type record Error_Indication_Report {
  LIN2_BO_LAST      elementIdentifier(99),
  LIN2_BO_LAST      lengthIndicator,
  set {
    record of F_TEID                     f_teid_list
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 99; )"
  variant (grouped_ie.f_teid_list) "REPEATABLE(yes)"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

// 7.5.9 PFCP Session Report Response
type set PFCP_Session_Report_Response {
  Cause                               cause,
  Offending_IE                        offending_IE optional,
  Update_BAR_Report_Response          update_BAR optional,
  PFCPSMRsp_Flags                     pfcpSMRsp_flags optional
}

type record Update_BAR_Report_Response{
  LIN2_BO_LAST      elementIdentifier(12),
  LIN2_BO_LAST      lengthIndicator,
  set {
    BAR_ID                                bar_id,
    Downlink_Data_Notification_Delay      downlink_data_notification_delay optional,
    DL_Buffering_Duration                 dl_buffering_duration optional,
    DL_Buffering_Suggested_Packet_Count   dl_buffering_suggested_packet_count optional
  }  grouped_ie
} with {
  variant "PRESENCE (elementIdentifier = 12; )"
  variant (lengthIndicator) "LENGTHTO(grouped_ie)"
}

type union PFCP_message_body{
  Heartbeat_Request                   heartbeat_request,
  Heartbeat_Response                  heartbeat_response,
  PFCP_PFD_Management_Request           pfcp_PFD_management_request,
  PFCP_PFD_Management_Response          pfcp_PFD_management_response,
  PFCP_Association_Setup_Request        pfcp_association_setup_request,
  PFCP_Association_Setup_Response       pfcp_association_setup_response,
  PFCP_Association_Update_Request       pfcp_association_update_request,
  PFCP_Association_Update_Response      pfcp_association_update_response,
  PFCP_Association_Release_Request      pfcp_association_release_request,
  PFCP_Association_Release_Response     pfcp_association_release_response,
  PFCP_Version_Not_Supported_Response   pfcp_version_not_supported_response,
  PFCP_Node_Report_Request              pfcp_node_report_request,
  PFCP_Node_Report_Response             pfcp_node_report_response,
  PFCP_Session_Set_Deletion_Request     pfcp_session_set_deletion_request,
  PFCP_Session_Set_Deletion_Response    pfcp_session_set_deletion_response,
  PFCP_Session_Establishment_Request    pfcp_session_establishment_request,
  PFCP_Session_Establishment_Response   pfcp_session_establishment_response,
  PFCP_Session_Modification_Request     pfcp_session_modification_request,
  PFCP_Session_Modification_Response    pfcp_session_modification_response,
  PFCP_Session_Deletion_Request         pfcp_session_deletion_request,
  PFCP_Session_Deletion_Response        pfcp_session_deletion_response,
  PFCP_Session_Report_Request           pfcp_session_report_request,
  PFCP_Session_Report_Response          pfcp_session_report_response,
  octetstring    dummy
}


} with { encode "RAW"}
