epdg: Make sure PCO is forwarded from strongswan to PGW and back

Related: OS#6369
Change-Id: Ie01d6e88b3ccc55fecc97c2ba75bb31bba5b9ef7
diff --git a/library/GSUP_Templates.ttcn b/library/GSUP_Templates.ttcn
index d886088..9daf9c0 100644
--- a/library/GSUP_Templates.ttcn
+++ b/library/GSUP_Templates.ttcn
@@ -301,6 +301,14 @@
 	}
 }
 
+template (present) GSUP_IE tr_GSUP_IE_PCO(template (present) PCO_DATA pco := ?) := {
+	tag := OSMO_GSUP_PCO_IE,
+	len := ?,
+	val := {
+		pco := pco
+	}
+}
+
 template GSUP_PDU tr_GSUP(template GSUP_MessageType msgt := ?, template GSUP_IEs ies := *) := {
 	msg_type := msgt,
 	ies := ies
@@ -536,6 +544,7 @@
 
 template (present) GSUP_PDU tr_GSUP_EPDGTunnel_RES(template (present) hexstring imsi,
 						   template (present) GSUP_IEs pdp_info,
+						   template (present) PCO_DATA pco := ?,
 						   template (present) GSUP_Message_Class message_class := OSMO_GSUP_MESSAGE_CLASS_IPSEC_EPDG,
 						   template octetstring destination_name := omit) :=
 	tr_GSUP(OSMO_GSUP_MSGT_EPDG_TUNNEL_RESULT,
@@ -543,6 +552,7 @@
 			     pdp_info_compl := true,
 			     pdp_info := pdp_info,
 			     message_class := message_class,
+			     pco := pco,
 			     destination_name := destination_name));
 
 template (value) GSUP_PDU ts_GSUP_EPDGTunnel_ERR(hexstring imsi,
@@ -1229,6 +1239,7 @@
 			      template GSUP_CancelType cancel_type := omit,
 			      template hexstring msisdn := omit,
 			      template GSUP_IMEIResult imei_result := omit,
+			      template PCO_DATA pco := omit,
 			      template GSUP_CnDomain cn_domain := omit,
 			      template octetstring source_name := omit,
 			      template octetstring destination_name := omit
@@ -1278,6 +1289,11 @@
 		idx := idx + 1;
 	}
 
+	if (not istemplatekind(pco, "omit")) {
+		ies[idx] := tr_GSUP_IE_PCO(pco);
+		idx := idx + 1;
+	}
+
 	if (not istemplatekind(source_name, "omit")) {
 		ies[idx] := tr_GSUP_IE_Source_Name(source_name);
 		idx := idx + 1;
diff --git a/library/PCO_Types.ttcn b/library/PCO_Types.ttcn
index 22b475a..0eaa45e 100644
--- a/library/PCO_Types.ttcn
+++ b/library/PCO_Types.ttcn
@@ -48,6 +48,10 @@
 } with { variant "FIELDLENGTH(16)";
 	 variant "BYTEORDER(last)" };
 
+function PCO_P_to_OCT2(PCO_P p) return OCT2 {
+	return int2oct(enum2int(p), 2);
+}
+
 /* RFC 1332 IP Control Protocol options, extensions in RFC 1877 */
 type enumerated IPCP_OPT {
 	IPCP_OPT_IPADDR		(3), /* RFC 1332 3.3 */
@@ -108,15 +112,23 @@
 
 template (value) ProtocolElement ts_PCO_P_DNS_IPv4(template (value) octetstring dns4 := ''O) :=
 	ts_PCO_P_OCTSTR(PCO_P_DNS_IPv4_ADDR, protoIDContents := dns4);
+template (present) ProtocolElement tr_PCO_P_DNS_IPv4(template (present) octetstring dns4 := ?) :=
+	tr_PCO_P_OCTSTR(PCO_P_DNS_IPv4_ADDR, protoIDContents := dns4);
 
 template (value) ProtocolElement ts_PCO_P_DNS_IPv6(template (value) octetstring dns6 := ''O) :=
 	ts_PCO_P_OCTSTR(PCO_P_DNS_IPv6_ADDR, protoIDContents := dns6);
+template (present) ProtocolElement tr_PCO_P_DNS_IPv6(template (present) octetstring dns6 := ?) :=
+	tr_PCO_P_OCTSTR(PCO_P_DNS_IPv6_ADDR, protoIDContents := dns6);
 
 template (value) ProtocolElement ts_PCO_P_PCSCF_IPv4(template (value) octetstring pcscf4 := ''O) :=
 	ts_PCO_P_OCTSTR(PCO_P_PCSCF_IPv4_ADDR, protoIDContents := pcscf4);
+template (present) ProtocolElement tr_PCO_P_PCSCF_IPv4(template (present) octetstring pcscf4 := ?) :=
+	tr_PCO_P_OCTSTR(PCO_P_PCSCF_IPv4_ADDR, protoIDContents := pcscf4);
 
 template (value) ProtocolElement ts_PCO_P_PCSCF_IPv6(template (value) octetstring pcscf6 := ''O) :=
 	ts_PCO_P_OCTSTR(PCO_P_PCSCF_ADDR, protoIDContents := pcscf6);
+template (present) ProtocolElement tr_PCO_P_PCSCF_IPv6(template (present) octetstring pcscf6 := ?) :=
+	tr_PCO_P_OCTSTR(PCO_P_PCSCF_ADDR, protoIDContents := pcscf6);
 
 /* PCO send base template */
 template (value) PCO_DATA ts_PCO(template (value) ProtocolIDList protocols := {}) := {