pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28156 )


Change subject: ggsn: Improve checks around Gy messages
......................................................................

ggsn: Improve checks around Gy messages

Change-Id: I702796f2f941b78da904faa2ffdba4185333bc0d
---
M ggsn_tests/GGSN_Tests.ttcn
M library/DIAMETER_Templates.ttcn
2 files changed, 473 insertions(+), 17 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/56/28156/1

diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn
index cc26f92..319bb09 100644
--- a/ggsn_tests/GGSN_Tests.ttcn
+++ b/ggsn_tests/GGSN_Tests.ttcn
@@ -130,9 +130,11 @@
                var integer g_use_echo_intval := 0; /* 0 = disabled */

                /* emulated PCRF, used with m_ggsn_impl = GGSN_IMPL_OPEN5GS */
+               var DIAMETER_conn_parameters gx_pars;
                var DIAMETER_Emulation_CT vc_Gx;
                port DIAMETER_PT Gx_UNIT;
                port DIAMETEREM_PROC_PT Gx_PROC;
+               var DIAMETER_conn_parameters gy_pars;
                var DIAMETER_Emulation_CT vc_Gy;
                port DIAMETER_PT Gy_UNIT;
                port DIAMETEREM_PROC_PT Gy_PROC;
@@ -212,10 +214,9 @@
                        unitdata_cb := refers(DiameterForwardUnitdataCallback),
                        raw := true /* handler mode (single component for all 
IMSI)) */
                };
-               var DIAMETER_conn_parameters pars;
 
                /* Gx setup: */
-               pars := {
+               gx_pars := {
                        remote_ip := m_ggsn_ip_gtpc,
                        remote_sctp_port := -1,
                        local_ip := m_bind_ip_gtpc,
@@ -229,10 +230,10 @@
                map(vc_Gx:DIAMETER, system:DIAMETER_CODEC_PT);
                connect(vc_Gx:DIAMETER_UNIT, self:Gx_UNIT);
                connect(vc_Gx:DIAMETER_PROC, self:Gx_PROC);
-               vc_Gx.start(DIAMETER_Emulation.main(ops, pars, id));
+               vc_Gx.start(DIAMETER_Emulation.main(ops, gx_pars, id));

                /* Gy setup: */
-               pars := {
+               gy_pars := {
                        remote_ip := m_ggsn_ip_gtpc,
                        remote_sctp_port := -1,
                        local_ip := m_bind_ip_gtpc,
@@ -246,7 +247,7 @@
                map(vc_Gy:DIAMETER, system:DIAMETER_CODEC_PT);
                connect(vc_Gy:DIAMETER_UNIT, self:Gy_UNIT);
                connect(vc_Gy:DIAMETER_PROC, self:Gy_PROC);
-               vc_Gy.start(DIAMETER_Emulation.main(ops, pars, id));
+               vc_Gy.start(DIAMETER_Emulation.main(ops, gy_pars, id));

                f_diameter_wait_capability(Gx_UNIT);
                f_diameter_wait_capability(Gy_UNIT);
@@ -485,9 +486,173 @@
                }
        }

-       private altstep as_DIA_Gy_CCR(DCC_NONE_CC_Request_Type req_type) runs 
on GT_CT {
+       private function f_tr_DIA_Gy_CCR(template (omit) PdpContext ctx, 
DCC_NONE_CC_Request_Type req_type)
+       runs on GT_CT return template (present) PDU_DIAMETER
+       {
+               var template (present) PDU_DIAMETER tpl;
+               var charstring smf_origin_host := "smf.localdomain";
+               var template (present) octetstring imsi := ?;
+               var template (present) octetstring msisdn := ?;
+               var template (present) octetstring imeisv := ?;
+               var template (present) octetstring rat_type := ?;
+               var template (present) OCT4 charging_char := ?;
+               var template (present) OCT1 nsapi := ?;
+               if (not istemplatekind(ctx, "omit")) {
+                       var PdpContext ctx_val := valueof(ctx);
+                       imsi := 
char2oct(f_dec_TBCD(imsi_hex2oct(ctx_val.imsi)));
+                       msisdn := char2oct(f_dec_TBCD(substr(ctx_val.msisdn, 1, 
lengthof(ctx_val.msisdn) -1)));
+                       imeisv := char2oct(f_dec_TBCD(ctx_val.imeisv));
+                       rat_type := ctx_val.ratType;
+                       charging_char := 
char2oct(oct2str(ctx_val.charging_char));
+                       nsapi := char2oct(hex2str(bit2hex(ctx_val.nsapi)));
+               }
+               select (req_type) {
+                       case (INITIAL_REQUEST) {
+                               tpl := tr_DIAMETER(flags:='11000000'B, 
cmd_code:=Credit_Control,
+                                       avps := superset(
+                                               tr_AVP_SessionId,
+                                               
tr_AVP_OriginHost(smf_origin_host),
+                                               
tr_AVP_OriginRealm(gy_pars.origin_realm),
+                                               
tr_AVP_DestinationRealm(gy_pars.origin_realm),
+                                               
tr_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)),
+                                               tr_AVP_ServiceContextId,
+                                               tr_AVP_CcReqType(req_type),
+                                               tr_AVP_CcReqNum(?),
+                                               tr_AVP_EventTimestamp(?),
+                                               
tr_AVP_SubcrId({tr_AVP_SubcrIdType(END_USER_IMSI), tr_AVP_SubcrIdData(imsi)}),
+                                               
tr_AVP_SubcrId({tr_AVP_SubcrIdType(END_USER_E164), tr_AVP_SubcrIdData(msisdn)}),
+                                               
tr_AVP_RequestedAction(DIRECT_DEBITING),
+                                               tr_AVP_3GPP_AoCRequestType,
+                                               
tr_AVP_MultipleServicesIndicator,
+                                               
tr_AVP_Multiple_Services_Credit_Control(content := superset(
+                                                       
tr_AVP_Requested_Service_Unit,
+                                                       
tr_AVP_Used_Service_Unit,
+                                                       
tr_AVP_3GPP_QoS_Information,
+                                                       
tr_AVP_GI_3GPP_RatType(rat_type)
+                                               )),
+                                               
tr_AVP_3GPP_ServiceInformation(content := superset(
+                                                       
tr_AVP_3GPP_PSInformation(content := superset(
+                                                               
tr_AVP_3GPP_ChargingId,
+                                                               
tr_AVP_3GPP_PDPType((IPv4,IPv6,IPv4v6)),
+                                                               
tr_AVP_3GPP_PDPAddress(tr_AVP_Address((IP,IP6), ?)),
+                                                               
tr_AVP_3GPP_SGSNAddress(tr_AVP_Address(IP, f_inet_addr(m_bind_ip_gtpc))),
+                                                               
tr_AVP_3GPP_GGSNAddress(tr_AVP_Address(IP, f_inet_addr(m_ggsn_ip_gtpc))),
+                                                               
tr_AVP_3GPP_CalledStationId,
+                                                               
tr_AVP_3GPP_SelectionMode,
+                                                               
tr_AVP_3GPP_ChargingCharacteristics(charging_char),
+                                                               
tr_AVP_3GPP_SGSNMCCMNC,
+                                                               
tr_AVP_3GPP_NSAPI(nsapi),
+                                                               
tr_AVP_3GPP_MS_TimeZone,
+                                                               tr_AVP_3GPP_ULI,
+                                                               
tr_AVP_UserEquipmentInfo({
+                                                                       
tr_AVP_UserEquipmentInfoType(IMEISV),
+                                                                       
tr_AVP_UserEquipmentInfoValue(imeisv)
+                                                               })
+                                                       ))
+                                               ))
+                                       ));
+                       }
+                       case (UPDATE_REQUEST) {
+                               tpl := tr_DIAMETER(flags:='11000000'B, 
cmd_code:=Credit_Control,
+                                       avps := superset(
+                                               tr_AVP_SessionId,
+                                               
tr_AVP_OriginHost(smf_origin_host),
+                                               
tr_AVP_OriginRealm(gy_pars.origin_realm),
+                                               
tr_AVP_DestinationRealm(gy_pars.origin_realm),
+                                               
tr_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)),
+                                               tr_AVP_ServiceContextId,
+                                               tr_AVP_CcReqType(req_type),
+                                               tr_AVP_CcReqNum(?),
+                                               tr_AVP_DestinationHost(?),
+                                               tr_AVP_EventTimestamp(?),
+                                               
tr_AVP_SubcrId({tr_AVP_SubcrIdType(END_USER_IMSI), tr_AVP_SubcrIdData(imsi)}),
+                                               
tr_AVP_SubcrId({tr_AVP_SubcrIdType(END_USER_E164), tr_AVP_SubcrIdData(msisdn)}),
+                                               
tr_AVP_RequestedAction(DIRECT_DEBITING),
+                                               tr_AVP_3GPP_AoCRequestType,
+                                               
tr_AVP_MultipleServicesIndicator,
+                                               
tr_AVP_Multiple_Services_Credit_Control(content := superset(
+                                                       
tr_AVP_Requested_Service_Unit,
+                                                       
tr_AVP_Used_Service_Unit,
+                                                       
tr_AVP_3GPP_Reporting_Reason,
+                                                       
tr_AVP_3GPP_QoS_Information,
+                                                       
tr_AVP_GI_3GPP_RatType(rat_type)
+                                               )),
+                                               
tr_AVP_3GPP_ServiceInformation(content := superset(
+                                                       
tr_AVP_3GPP_PSInformation(content := superset(
+                                                               
tr_AVP_3GPP_ChargingId,
+                                                               /* 
tr_AVP_3GPP_PDPType, Only in INIT */
+                                                               
tr_AVP_3GPP_PDPAddress(tr_AVP_Address((IP,IP6), ?)),
+                                                               
tr_AVP_3GPP_SGSNAddress(tr_AVP_Address(IP, f_inet_addr(m_bind_ip_gtpc))),
+                                                               
tr_AVP_3GPP_GGSNAddress(tr_AVP_Address(IP, f_inet_addr(m_ggsn_ip_gtpc))),
+                                                               
tr_AVP_3GPP_CalledStationId,
+                                                               
tr_AVP_3GPP_SelectionMode,
+                                                               
tr_AVP_3GPP_ChargingCharacteristics(charging_char),
+                                                               
tr_AVP_3GPP_SGSNMCCMNC,
+                                                               
tr_AVP_3GPP_NSAPI(nsapi),
+                                                               
tr_AVP_3GPP_MS_TimeZone,
+                                                               tr_AVP_3GPP_ULI,
+                                                               
tr_AVP_UserEquipmentInfo({
+                                                                       
tr_AVP_UserEquipmentInfoType(IMEISV),
+                                                                       
tr_AVP_UserEquipmentInfoValue(imeisv)
+                                                               })
+                                                       ))
+                                               ))
+                                       ));
+                       }
+                       case (TERMINATION_REQUEST) {
+                               tpl := tr_DIAMETER(flags:='11000000'B, 
cmd_code:=Credit_Control,
+                                       avps := superset(
+                                               tr_AVP_SessionId,
+                                               
tr_AVP_OriginHost(smf_origin_host),
+                                               
tr_AVP_OriginRealm(gy_pars.origin_realm),
+                                               
tr_AVP_DestinationRealm(gy_pars.origin_realm),
+                                               
tr_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)),
+                                               tr_AVP_ServiceContextId,
+                                               tr_AVP_CcReqType(req_type),
+                                               tr_AVP_CcReqNum(?),
+                                               tr_AVP_DestinationHost(?),
+                                               tr_AVP_EventTimestamp(?),
+                                               
tr_AVP_SubcrId({tr_AVP_SubcrIdType(END_USER_IMSI), tr_AVP_SubcrIdData(imsi)}),
+                                               
tr_AVP_SubcrId({tr_AVP_SubcrIdType(END_USER_E164), tr_AVP_SubcrIdData(msisdn)}),
+                                               tr_AVP_TerminationCause(?),
+                                               
tr_AVP_RequestedAction(DIRECT_DEBITING),
+                                               tr_AVP_3GPP_AoCRequestType,
+                                               
tr_AVP_MultipleServicesIndicator,
+                                               
tr_AVP_Multiple_Services_Credit_Control(content := superset(
+                                                       /* 
tr_AVP_Requested_Service_Unit, Only in INIT and UPDATE */
+                                                       
tr_AVP_Used_Service_Unit,
+                                                       
tr_AVP_3GPP_QoS_Information,
+                                                       
tr_AVP_GI_3GPP_RatType(rat_type)
+                                               )),
+                                               
tr_AVP_3GPP_ServiceInformation(content := superset(
+                                                       
tr_AVP_3GPP_PSInformation(content := superset(
+                                                               
tr_AVP_3GPP_ChargingId,
+                                                               /* 
tr_AVP_3GPP_PDPType, Only in INIT */
+                                                               
tr_AVP_3GPP_PDPAddress(tr_AVP_Address((IP,IP6), ?)),
+                                                               
tr_AVP_3GPP_SGSNAddress(tr_AVP_Address(IP, f_inet_addr(m_bind_ip_gtpc))),
+                                                               
tr_AVP_3GPP_GGSNAddress(tr_AVP_Address(IP, f_inet_addr(m_ggsn_ip_gtpc))),
+                                                               
tr_AVP_3GPP_CalledStationId,
+                                                               
tr_AVP_3GPP_SelectionMode,
+                                                               
tr_AVP_3GPP_ChargingCharacteristics(charging_char),
+                                                               
tr_AVP_3GPP_SGSNMCCMNC,
+                                                               
tr_AVP_3GPP_NSAPI(nsapi),
+                                                               
tr_AVP_3GPP_MS_TimeZone,
+                                                               tr_AVP_3GPP_ULI,
+                                                               
tr_AVP_UserEquipmentInfo({
+                                                                       
tr_AVP_UserEquipmentInfoType(IMEISV),
+                                                                       
tr_AVP_UserEquipmentInfoValue(imeisv)
+                                                               })
+                                                       ))
+                                               ))
+                                       ));
+                       }
+               }
+               return tpl;
+       }
+
+       private altstep as_DIA_Gy_CCR(template (omit) PdpContext ctx, 
DCC_NONE_CC_Request_Type req_type) runs on GT_CT {
                var PDU_DIAMETER rx_dia;
-               [] Gy_UNIT.receive(tr_DIA_Gy_CCR(req_type := req_type)) -> 
value rx_dia {
+               [] Gy_UNIT.receive(f_tr_DIA_Gy_CCR(ctx, req_type := req_type)) 
-> value rx_dia {
                        var template (value) PDU_DIAMETER tx_dia;
                        var template (omit) AVP avp;
                        var octetstring sess_id;
@@ -498,6 +663,7 @@

                        avp := f_DIAMETER_get_avp(rx_dia, 
c_AVP_Code_DCC_NONE_CC_Request_Number);
                        req_num := 
valueof(avp.avp_data.avp_DCC_NONE_CC_Request_Number);
+
                        if (g_gy_validity_time > 0) {
                                tx_dia := 
ts_DIA_Gy_CCA_ValidityTime(rx_dia.hop_by_hop_id, rx_dia.end_to_end_id, sess_id,
                                                         req_type, req_num, 
g_gy_validity_time);
@@ -530,7 +696,7 @@
                        as_DIA_Gx_CCR(INITIAL_REQUEST);
                }
                if (Gy_PROC.checkstate("Connected")) {
-                       as_DIA_Gy_CCR(INITIAL_REQUEST);
+                       as_DIA_Gy_CCR(ctx, INITIAL_REQUEST);
                }
                alt {
                        [] GTPC.receive(tr_GTPC_MsgType(g_peer_c, 
createPDPContextResponse, ctx.teic)) -> value ud {
@@ -595,7 +761,7 @@
                        as_DIA_Gx_CCR(TERMINATION_REQUEST);
                }
                if (Gy_PROC.checkstate("Connected") and expect_diameter) {
-                       as_DIA_Gy_CCR(TERMINATION_REQUEST);
+                       as_DIA_Gy_CCR(ctx, TERMINATION_REQUEST);
                }
                alt {
                        [] GTPC.receive(tr_GTPC_MsgType(g_peer_c, 
deletePDPContextResponse, expect_teid)) -> value ud {
@@ -2225,17 +2391,17 @@

                g_gy_validity_time := 2;
                /* First update reports octests/pkt on both UL/DL (see icmp 
ping-pong above) */
-               as_DIA_Gy_CCR(UPDATE_REQUEST);
+               as_DIA_Gy_CCR(ctx, UPDATE_REQUEST);

                /* Second update: 0 ul/dl pkt/octet should be reported, since 
nothing was sent */
-               as_DIA_Gy_CCR(UPDATE_REQUEST);
+               as_DIA_Gy_CCR(ctx, UPDATE_REQUEST);

                /* Third update: make sure report contains again octets/pkts 
for both UL/DL: */
                f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr, dns1_addr));
                f_wait_icmp4_echo_reply(ctx);
                f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr, dns1_addr));
                f_wait_icmp4_echo_reply(ctx);
-               as_DIA_Gy_CCR(UPDATE_REQUEST);
+               as_DIA_Gy_CCR(ctx, UPDATE_REQUEST);

                /* Let the CCA reach the GGSN */
                f_sleep(0.5);
diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn
index 07b5c74..855358d 100644
--- a/library/DIAMETER_Templates.ttcn
+++ b/library/DIAMETER_Templates.ttcn
@@ -195,8 +195,23 @@
        vendor_id := vendor_id_3GPP
 }
 
+template (present) AVP_Address tr_AVP_Address(template (present) AddressType 
addr_type := ?,
+                                             template (present) octetstring 
addr_data := ?) := {
+       address_type := addr_type,
+       address_data := addr_data
+}
+
 template (present) GenericAVP tr_AVP_SubcrId(template (present) 
DCC_NONE_Subscription_Id t) := {
        avp := {
+               avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id),
+               avp_data := {
+                       avp_DCC_NONE_Subscription_Id := t
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_SubcrIdType(template (present) 
DCC_NONE_Subscription_Id_Type t) := {
+       avp := {
                avp_header := 
tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id_Type),
                avp_data := {
                        avp_DCC_NONE_Subscription_Id_Type := t
@@ -204,6 +219,42 @@
        }
 }

+template (present) GenericAVP tr_AVP_SubcrIdData(template (present) 
DCC_NONE_Subscription_Id_Data t) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id_Data),
+               avp_data := {
+                       avp_DCC_NONE_Subscription_Id_Data := t
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_RequestedAction(template (present) 
DCC_NONE_Requested_Action t := ?) := {
+       avp := {
+               avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Requested_Action),
+               avp_data := {
+                       avp_DCC_NONE_Requested_Action := t
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_MultipleServicesIndicator(template 
(present) DCC_NONE_Multiple_Services_Indicator t := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Multiple_Services_Indicator),
+               avp_data := {
+                       avp_DCC_NONE_Multiple_Services_Indicator := t
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_ServiceContextId(template (present) 
DCC_NONE_Service_Context_Id id := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Service_Context_Id),
+               avp_data := {
+                       avp_DCC_NONE_Service_Context_Id := id
+               }
+       }
+}
+
 template (value) GenericAVP ts_AVP_OriginHost(template (value) charstring 
host) := {
        avp := {
                avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Origin_Host),
@@ -257,6 +308,15 @@
        }
 }

+template (present) GenericAVP tr_AVP_TerminationCause(template (present) 
BASE_NONE_Termination_Cause tc) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Termination_Cause),
+               avp_data := {
+                       avp_BASE_NONE_Termination_Cause := tc
+               }
+       }
+}
+
 template (value) GenericAVP ts_AVP_HostIpAddr(template (value) OCTET4 
ipv4_addr) := {
        avp := {
                avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Host_IP_Address),
@@ -381,7 +441,14 @@
        }
 }

-
+template (present) GenericAVP tr_AVP_EventTimestamp(template (present) 
AVP_Unsigned32 n := ?) := {
+       avp := {
+               avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Event_Timestamp),
+               avp_data := {
+                       avp_BASE_NONE_Event_Timestamp := n
+               }
+       }
+}

 
 template (value) GenericAVP ts_AVP_SuppVendorIdRaw(uint32_t vendor_id) := {
@@ -446,6 +513,15 @@
        }
 }

+template (present) GenericAVP tr_AVP_DestinationHost(template (present) 
charstring host := ?) := {
+       avp := {
+               avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Destination_Host),
+               avp_data := {
+                       avp_BASE_NONE_Destination_Host := host
+               }
+       }
+}
+
 /* 3.3 Destination Realm */
 template (value) GenericAVP ts_AVP_DestinationRealm(template (value) 
charstring dest_realm) := {
        avp := {
@@ -611,7 +687,7 @@
 }

 /* TS 29.262 7.3.13 RAT-Type */
-template (value) GenericAVP ts_AVP_3GPP_RatType(template (value) 
PCC_3GPP_RAT_Type rat_type) := {
+template (value) GenericAVP ts_AVP_PCC_3GPP_RatType(template (value) 
PCC_3GPP_RAT_Type rat_type) := {
        avp := {
                avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_RAT_Type),
                avp_data := {
@@ -619,7 +695,7 @@
                }
        }
 }
-template (present) GenericAVP tr_AVP_3GPP_RatType(template (present) 
PCC_3GPP_RAT_Type rat_type := ?) := {
+template (present) GenericAVP tr_AVP_PCC_3GPP_RatType(template (present) 
PCC_3GPP_RAT_Type rat_type := ?) := {
        avp := {
                avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_RAT_Type),
                avp_data := {
@@ -628,6 +704,15 @@
        }
 }
 
+template (present) GenericAVP tr_AVP_GI_3GPP_RatType(template (present) 
GI_3GPP_3GPP_RAT_Type rat_type := ?) := {
+       avp := {
+               avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_RAT_Type),
+               avp_data := {
+                       avp_GI_3GPP_3GPP_RAT_Type := rat_type
+               }
+       }
+}
+
 /* TS 29.262 7.3.7 ULR-Flags */
 template (value) GenericAVP ts_AVP_3GPP_UlrFlags(template (value) UINT32 
flags) := {
        avp := {
@@ -774,6 +859,15 @@
        }
 }

+template (present) GenericAVP tr_AVP_3GPP_QoS_Information(template (present) 
AVP_list list := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_QoS_Information),
+               avp_data := {
+                       avp_PCC_3GPP_QoS_Information := list
+               }
+       }
+}
+
 template (value) GenericAVP ts_AVP_3GPP_QosClassId(uint32_t id) := {
        avp := {
                avp_header := 
ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_QoS_Class_Identifier),
@@ -850,7 +944,167 @@
        }
 }

+template (present) GenericAVP tr_AVP_3GPP_Reporting_Reason(template (present) 
DCA_3GPP_Reporting_Reason r := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_Reporting_Reason),
+               avp_data := {
+                       avp_DCA_3GPP_Reporting_Reason := r
+               }
+       }
+}

+template (present) GenericAVP tr_AVP_3GPP_AoCRequestType(template (present) 
DCA_3GPP_AoC_Request_Type t := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_AoC_Request_Type),
+               avp_data := {
+                       avp_DCA_3GPP_AoC_Request_Type := t
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_3GPP_ServiceInformation(template 
(present) AVP_list content := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_Service_Information),
+               avp_data := {
+                       avp_DCA_3GPP_Service_Information := content
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_3GPP_PSInformation(template (present) 
AVP_list content := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_PS_Information),
+               avp_data := {
+                       avp_DCA_3GPP_PS_Information := content
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_3GPP_ChargingId(template (present) 
AVP_OctetString id := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_Charging_Id),
+               avp_data := {
+                       avp_GI_3GPP_3GPP_Charging_Id := id
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_3GPP_PDPType(template (present) 
GI_3GPP_3GPP_PDP_Type t := ?) := {
+       avp := {
+               avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_PDP_Type),
+               avp_data := {
+                       avp_GI_3GPP_3GPP_PDP_Type := t
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_3GPP_PDPAddress(template (present) 
DCA_3GPP_PDP_Address addr := ?) := {
+       avp := {
+               avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_PDP_Address),
+               avp_data := {
+                       avp_DCA_3GPP_PDP_Address := addr
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_3GPP_SGSNAddress(template (present) 
DCA_3GPP_SGSN_Address addr := ?) := {
+       avp := {
+               avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_SGSN_Address),
+               avp_data := {
+                       avp_DCA_3GPP_SGSN_Address := addr
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_3GPP_GGSNAddress(template (present) 
DCA_3GPP_GGSN_Address addr := ?) := {
+       avp := {
+               avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_GGSN_Address),
+               avp_data := {
+                       avp_DCA_3GPP_GGSN_Address := addr
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_3GPP_SelectionMode(template (present) 
GI_3GPP_3GPP_Selection_Mode sm := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_Selection_Mode),
+               avp_data := {
+                       avp_GI_3GPP_3GPP_Selection_Mode := sm
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_3GPP_ChargingCharacteristics(template 
(present) GI_3GPP_3GPP_Charging_Characteristics cc := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_Charging_Characteristics),
+               avp_data := {
+                       avp_GI_3GPP_3GPP_Charging_Characteristics := cc
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_3GPP_SGSNMCCMNC(template (present) 
GI_3GPP_3GPP_SGSN_MCC_MNC smn := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_SGSN_MCC_MNC),
+               avp_data := {
+                       avp_GI_3GPP_3GPP_SGSN_MCC_MNC := smn
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_3GPP_NSAPI(template (present) 
GI_3GPP_3GPP_NSAPI nsapi := ?) := {
+       avp := {
+               avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_NSAPI),
+               avp_data := {
+                       avp_GI_3GPP_3GPP_NSAPI := nsapi
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_3GPP_MS_TimeZone(template (present) 
GI_3GPP_3GPP_MS_TimeZone ms_tz := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_MS_TimeZone),
+               avp_data := {
+                       avp_GI_3GPP_3GPP_MS_TimeZone := ms_tz
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_3GPP_ULI(template (present) 
GI_3GPP_3GPP_User_Location_Info uli := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_User_Location_Info),
+               avp_data := {
+                       avp_GI_3GPP_3GPP_User_Location_Info := uli
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_UserEquipmentInfo(template (present) 
DCC_NONE_User_Equipment_Info uei := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr(c_AVP_Code_DCC_NONE_User_Equipment_Info),
+               avp_data := {
+                       avp_DCC_NONE_User_Equipment_Info := uei
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_UserEquipmentInfoType(template (present) 
DCC_NONE_User_Equipment_Info_Type ueit := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr(c_AVP_Code_DCC_NONE_User_Equipment_Info_Type),
+               avp_data := {
+                       avp_DCC_NONE_User_Equipment_Info_Type := ueit
+               }
+       }
+}
+
+template (present) GenericAVP tr_AVP_UserEquipmentInfoValue(template (present) 
DCC_NONE_User_Equipment_Info_Value ueiv := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr(c_AVP_Code_DCC_NONE_User_Equipment_Info_Value),
+               avp_data := {
+                       avp_DCC_NONE_User_Equipment_Info_Value := ueiv
+               }
+       }
+}

 /* TS 29.262 7.3.62 PDN-Type */
 template (value) GenericAVP ts_AVP_3GPP_PdnType(template (value) 
AAA_3GPP_PDN_Type pdn_type) := {
@@ -871,6 +1125,34 @@
                }
        }
 }
+template (present) GenericAVP tr_AVP_Multiple_Services_Credit_Control(template 
(present) AVP_list content := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Multiple_Services_Credit_Control),
+               avp_data := {
+                       avp_DCC_NONE_Multiple_Services_Credit_Control := content
+               }
+       }
+}
+
+/* Requested-Service-Unit AVP */
+template (present) GenericAVP tr_AVP_Requested_Service_Unit(template (present) 
AVP_list content := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Requested_Service_Unit),
+               avp_data := {
+                       avp_DCC_NONE_Requested_Service_Unit := content
+               }
+       }
+}
+
+/* Used-Service-Unit AVP */
+template (present) GenericAVP tr_AVP_Used_Service_Unit(template (present) 
AVP_list content := ?) := {
+       avp := {
+               avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Used_Service_Unit),
+               avp_data := {
+                       avp_DCC_NONE_Used_Service_Unit := content
+               }
+       }
+}

 /* RFC4006 8.17 Granted-Service-Unit AVP */
 template (value) GenericAVP ts_AVP_Granted_Service_Unit(template (value) 
AVP_list content) := {
@@ -912,6 +1194,14 @@
        }
 }

+template (present) GenericAVP tr_AVP_3GPP_CalledStationId(template (present) 
DNAS_NONE_Called_Station_Id id := ?) := {
+       avp := {
+               avp_header := 
tr_DIA_Hdr(c_AVP_Code_DNAS_NONE_Called_Station_Id),
+               avp_data := {
+                       avp_DNAS_NONE_Called_Station_Id := id
+               }
+       }
+}


 /* 5.3.2 Capabilities Exchange Answer */
@@ -1076,7 +1366,7 @@
                        ts_AVP_UserNameImsi(imsi),
                        ts_AVP_3GPP_UlrFlags('00000000'O),
                        ts_AVP_3GPP_VisitedPlmnId('11111F'O),
-                       ts_AVP_3GPP_RatType(EUTRAN),
+                       ts_AVP_PCC_3GPP_RatType(EUTRAN),
                        ts_AVP_OriginHost(orig_host),
                        ts_AVP_OriginRealm(orig_realm),
                        ts_AVP_DestinationRealm(dest_realm)
@@ -1101,7 +1391,7 @@
                        tr_AVP_OriginRealm(orig_realm),
                        tr_AVP_DestinationRealm(dest_realm),
                        tr_AVP_UserNameImsi(imsi),
-                       tr_AVP_3GPP_RatType(EUTRAN),
+                       tr_AVP_PCC_3GPP_RatType,
                        tr_AVP_3GPP_UlrFlags,
                        tr_AVP_3GPP_VisitedPlmnId
        ));

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28156
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I702796f2f941b78da904faa2ffdba4185333bc0d
Gerrit-Change-Number: 28156
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-MessageType: newchange

Reply via email to