library/DIAMETER: Add several missing tr templates

Change-Id: I21da18a5e1f0d368176d653494e0e0cde0beb656
diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn
index 1e29120..5bbb2c3 100644
--- a/library/DIAMETER_Templates.ttcn
+++ b/library/DIAMETER_Templates.ttcn
@@ -852,6 +852,14 @@
 
 
 /* TS 29.272 7.3.27 Context-Identifier */
+template (present) GenericAVP tr_AVP_3GPP_ContextId(template (present) uint32_t ctx := ?) := {
+	avp := {
+		avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Context_Identifier),
+		avp_data := {
+			avp_AAA_3GPP_Context_Identifier := int2oct_tmpl(ctx, 4)
+		}
+	}
+}
 template (value) GenericAVP ts_AVP_3GPP_ContextId(uint32_t ctx) := {
 	avp := {
 		avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Context_Identifier),
@@ -862,6 +870,14 @@
 }
 
 /* Ts 29.272 7.3.29 Subscriber-Status */
+template (present) GenericAVP tr_AVP_3GPP_SubscriberStatus(template (present) AAA_3GPP_Subscriber_Status sts) := {
+	avp := {
+		avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscriber_Status),
+		avp_data := {
+			avp_AAA_3GPP_Subscriber_Status := sts
+		}
+	}
+}
 template (value) GenericAVP ts_AVP_3GPP_SubscriberStatus(template (value) AAA_3GPP_Subscriber_Status sts) := {
 	avp := {
 		avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscriber_Status),
@@ -871,6 +887,15 @@
 	}
 }
 
+template (present) GenericAVP tr_AVP_3GPP_SubscrRauTauTmr(template (present) uint32_t tmr := ?) := {
+	avp := {
+		avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscribed_Periodic_RAU_TAU_Timer),
+		avp_data := {
+			avp_AAA_3GPP_Subscribed_Periodic_RAU_TAU_Timer := int2oct_tmpl(tmr, 4)
+		}
+	}
+}
+
 template (value) GenericAVP ts_AVP_3GPP_SubscrRauTauTmr(uint32_t tmr) := {
 	avp := {
 		avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscribed_Periodic_RAU_TAU_Timer),
@@ -881,6 +906,14 @@
 }
 
 /* TS 29.272 7.3.33 All-APN-Configurations-Included-Indicator */
+template (present) GenericAVP tr_AVP_3GPP_AllApnConfigsIncl(template (present) AAA_3GPP_All_APN_Configurations_Included_Indicator ind := ?) := {
+	avp := {
+		avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_All_APN_Configurations_Included_Indicator),
+		avp_data := {
+			avp_AAA_3GPP_All_APN_Configurations_Included_Indicator := ind
+		}
+	}
+}
 template (value) GenericAVP ts_AVP_3GPP_AllApnConfigsIncl(template (value) AAA_3GPP_All_APN_Configurations_Included_Indicator ind := All_APN_CONFIGURATIONS_INCLUDED) := {
 	avp := {
 		avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_All_APN_Configurations_Included_Indicator),
@@ -891,6 +924,14 @@
 }
 
 /* TS 29.272 7.3.34 APN-Configuration-Profile */
+template (present) GenericAVP tr_AVP_3GPP_ApnConfigProfile(template (present) AVP_list content := ?) := {
+	avp := {
+		avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration_Profile),
+		avp_data := {
+			avp_AAA_3GPP_APN_Configuration_Profile := content
+		}
+	}
+}
 template (value) GenericAVP ts_AVP_3GPP_ApnConfigProfile(template (value) AVP_list content) := {
 	avp := {
 		avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration_Profile),
@@ -901,6 +942,21 @@
 }
 
 /* TS 29.272 7.3.35 APN-Configuration */
+template (present) GenericAVP tr_AVP_3GPP_ApnConfig(template (present) uint32_t ctx := ?,
+						    template (present) AAA_3GPP_PDN_Type pdn_type := ?,
+						    template (present) charstring apn := ?) := {
+	avp := {
+		avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration),
+		avp_data := {
+			avp_AAA_3GPP_APN_Configuration := superset(
+				tr_AVP_3GPP_ContextId(ctx),
+				tr_AVP_3GPP_PdnType(pdn_type),
+				tr_AVP_ServiceSelection(apn),
+				tr_AVP_3GPP_EpsSubscrQosProfile(?, ?)
+			)
+		}
+	}
+}
 template (value) GenericAVP ts_AVP_3GPP_ApnConfig(uint32_t ctx, AAA_3GPP_PDN_Type pdn_type,
 						  charstring apn) := {
 	avp := {
@@ -917,6 +973,14 @@
 }
 
 /* TS 29.272 7.3.36 Service-Selection (refers to RFC 5778) */
+template (present) GenericAVP tr_AVP_ServiceSelection(template (present) charstring apn := ?) := {
+	avp := {
+		avp_header := tr_DIA_Hdr(c_AVP_Code_MIPv6_NONE_Service_Selection),
+		avp_data := {
+			avp_MIPv6_NONE_Service_Selection := char2oct_tmpl(apn)
+		}
+	}
+}
 template (value) GenericAVP ts_AVP_ServiceSelection(charstring apn) := {
 	avp := {
 		avp_header := ts_DIA_Hdr(c_AVP_Code_MIPv6_NONE_Service_Selection),
@@ -971,6 +1035,15 @@
 	}
 }
 
+template (present) GenericAVP tr_AVP_PCC_3GPP_QoS_Class_Identifier(template (present) uint32_t val := ?) := {
+	avp := {
+		avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_QoS_Class_Identifier),
+		avp_data := {
+			avp_PCC_3GPP_QoS_Class_Identifier := int2oct_tmpl(val, 4)
+		}
+	}
+}
+
 template (value) GenericAVP ts_AVP_PCC_3GPP_QoS_Class_Identifier(uint32_t val) := {
 	avp := {
 		avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_QoS_Class_Identifier),
@@ -980,6 +1053,15 @@
 	}
 }
 
+template (present) GenericAVP tr_AVP_3GPP_PriorityLevel(template (present) uint32_t prio := ?) := {
+	avp := {
+		avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_Priority_Level),
+		avp_data := {
+			avp_PCC_3GPP_Priority_Level := int2oct_tmpl(prio, 4)
+		}
+	}
+}
+
 template (value) GenericAVP ts_AVP_3GPP_PriorityLevel(uint32_t prio) := {
 	avp := {
 		avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_Priority_Level),
@@ -989,6 +1071,18 @@
 	}
 }
 
+template (present) GenericAVP tr_AVP_PCC_3GPP_AllocRetenPrio(template (present) uint32_t prio := ?) := {
+	avp := {
+		avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_Allocation_Retention_Priority),
+		avp_data := {
+			avp_PCC_3GPP_Allocation_Retention_Priority := superset(
+				tr_AVP_3GPP_PriorityLevel(prio)
+				/* pre-emption capability */
+				/* pre-emption vulnerability */
+			)
+		}
+	}
+}
 template (value) GenericAVP ts_AVP_PCC_3GPP_AllocRetenPrio(uint32_t prio) := {
 	avp := {
 		avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_Allocation_Retention_Priority),
@@ -1002,6 +1096,20 @@
 	}
 }
 
+/* 7.3.37 EPS-Subscribed-QoS-Profile */
+template (present) GenericAVP tr_AVP_3GPP_EpsSubscrQosProfile(template (present) uint32_t qos_class := ?,
+							      template (present) uint32_t prio := ?) := {
+	avp := {
+		avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_EPS_Subscribed_QoS_Profile),
+		avp_data := {
+			avp_AAA_3GPP_EPS_Subscribed_QoS_Profile := superset(
+				tr_AVP_PCC_3GPP_QoS_Class_Identifier(qos_class),
+				tr_AVP_PCC_3GPP_AllocRetenPrio(prio)
+			)
+		}
+	}
+}
+
 template (value) GenericAVP ts_AVP_3GPP_EpsSubscrQosProfile(uint32_t qos_class, uint32_t prio) := {
 	avp := {
 		avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_EPS_Subscribed_QoS_Profile),
@@ -1016,6 +1124,17 @@
 
 
 /* TS 29.272 7.3.41 AMBR */
+template (present) GenericAVP tr_AVP_3GPP_AMBR(template (present) uint32_t ul := ?, template (present) uint32_t dl := ?) := {
+	avp := {
+		avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AMBR),
+		avp_data := {
+			avp_AAA_3GPP_AMBR := {
+				tr_AVP_3GPP_MaxReqBwUL(ul),
+				tr_AVP_3GPP_MaxReqBwDL(dl)
+			}
+		}
+	}
+}
 template (value) GenericAVP ts_AVP_3GPP_AMBR(uint32_t ul, uint32_t dl) := {
 	avp := {
 		avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AMBR),
@@ -1028,6 +1147,15 @@
 	}
 }
 
+template (present) GenericAVP tr_AVP_3GPP_MaxReqBwUL(template (present) uint32_t bw := ?) := {
+	avp := {
+		avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_UL),
+		avp_data := {
+			avp_RX_3GPP_Max_Requested_Bandwidth_UL := int2oct_tmpl(bw, 4)
+		}
+	}
+}
+
 template (value) GenericAVP ts_AVP_3GPP_MaxReqBwUL(uint32_t bw) := {
 	avp := {
 		avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_UL),
@@ -1037,6 +1165,15 @@
 	}
 }
 
+template (present) GenericAVP tr_AVP_3GPP_MaxReqBwDL(template (present) uint32_t bw := ?) := {
+	avp := {
+		avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_DL),
+		avp_data := {
+			avp_RX_3GPP_Max_Requested_Bandwidth_DL := int2oct_tmpl(bw, 4)
+		}
+	}
+}
+
 template (value) GenericAVP ts_AVP_3GPP_MaxReqBwDL(uint32_t bw) := {
 	avp := {
 		avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_DL),
@@ -1209,6 +1346,14 @@
 }
 
 /* TS 29.272 7.3.62 PDN-Type */
+template (present) GenericAVP tr_AVP_3GPP_PdnType(template (present) AAA_3GPP_PDN_Type pdn_type := ?) := {
+	avp := {
+		avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_PDN_Type),
+		avp_data := {
+			avp_AAA_3GPP_PDN_Type := pdn_type
+		}
+	}
+}
 template (value) GenericAVP ts_AVP_3GPP_PdnType(template (value) AAA_3GPP_PDN_Type pdn_type) := {
 	avp := {
 		avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_PDN_Type),