ggsn: test Gy Volume-Quote-Threshold feature

Change-Id: If10171589e915db8e78278d2d802e38c66b37687
diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn
index 03fec7c..2bc9e77 100644
--- a/library/DIAMETER_Templates.ttcn
+++ b/library/DIAMETER_Templates.ttcn
@@ -1195,6 +1195,15 @@
 	}
 }
 
+template (value) GenericAVP ts_AVP_3GPP_VolumeQuotaThreshold(uint32_t volume_quota_thresh_val) := {
+	avp := {
+		avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_Volume_Quota_Threshold),
+		avp_data := {
+			avp_DCA_3GPP_Volume_Quota_Threshold := int2oct(volume_quota_thresh_val, 4)
+		}
+	}
+}
+
 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),
@@ -1541,6 +1550,36 @@
 		// supported features
 		// origin
 	});
+/* Same as ts_DIA_Gy_CCA_ValidityTime, but with extra AVP to grant access for limited amount of octets */
+template (value) PDU_DIAMETER
+ts_DIA_Gy_CCA_ValidityTimeVolumeThreshold(template (value) UINT32 hbh_id, template (value) UINT32 ete_id,
+	   template (value) octetstring sess_id,
+	   template (value) DCC_NONE_CC_Request_Type req_type,
+	   template (value) AVP_Unsigned32 req_num,
+	   uint32_t validity_time, uint32_t volume_threhsold)
+:= ts_DIAMETER(flags:='01000000'B, cmd_code:=Credit_Control,
+		app_id:=int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4), hbh_id:=hbh_id, ete_id:=ete_id,
+	avps := {
+		ts_AVP_SessionId(sess_id),
+		ts_AVP_ResultCode(DIAMETER_SUCCESS),
+		ts_AVP_OriginHost("ocs.localdomain"),
+		ts_AVP_OriginRealm("localdomain"),
+		ts_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)),
+		ts_AVP_CcReqType(req_type),
+		ts_AVP_CcReqNum(req_num),
+		ts_AVP_Multiple_Services_Credit_Control({
+			ts_AVP_Validity_Time(validity_time),
+			ts_AVP_Granted_Service_Unit({
+				ts_AVP_CC_Total_Octets(volume_threhsold*100)
+				}),
+			ts_AVP_3GPP_VolumeQuotaThreshold(volume_threhsold)
+			})
+		//,
+		// qos
+		// default eps bearer qos
+		// supported features
+		// origin
+	});
 
 /* RFC 6733, section 5.5.1 "Device-Watchdog-Request" */
 template (value) PDU_DIAMETER