library/RLCMAC_CSN1_Types: add EGPRS Packet Channel Request definition

For more details, see 3GPP TS 44.060, table 11.2.5a.2.

Change-Id: I762b932ed67d9e67a5e13290209cc9017dd650a7
Related: OS#1548
diff --git a/library/RLCMAC_CSN1_Types.ttcn b/library/RLCMAC_CSN1_Types.ttcn
index 1bb6232..9ceb339 100644
--- a/library/RLCMAC_CSN1_Types.ttcn
+++ b/library/RLCMAC_CSN1_Types.ttcn
@@ -703,5 +703,81 @@
 		}
 	}
 
+	/* 3GPP TS 44.060, table 11.2.5a.2 "EGPRS PACKET CHANNEL REQUEST" */
+	type union EGPRSPktChRequest {
+		EGPRSPktChRequest_MC5P2RB3		one_phase,
+		EGPRSPktChRequest_NOB3P2RB3		short, // deprecated
+		EGPRSPktChRequest_MCG3P2RB3		one_phase_red,
+		EGPRSPktChRequest_P2RB3			two_phase,
+		EGPRSPktChRequest_RB5			signalling,
+		EGPRSPktChRequest_RB5			one_phase_unack,
+		EGPRSPktChRequest_RB5			dedicated,
+		EGPRSPktChRequest_RB5			emergency,
+		EGPRSPktChRequest_P2RB3			two_phase_ipa,
+		EGPRSPktChRequest_RB5			signalling_ipa
+	} with {
+		variant "TAG (
+			one_phase,		tag = '0'B;
+			short,			tag = '100'B;
+			one_phase_red,		tag = '101'B;
+			two_phase,		tag = '110000'B;
+			signalling,		tag = '110011'B;
+			one_phase_unack,	tag = '110101'B;
+			dedicated,		tag = '110110'B;
+			emergency,		tag = '110111'B;
+			two_phase_ipa,		tag = '111000'B;
+			signalling_ipa,		tag = '111001'B;
+		)"
+	};
+
+	private type record EGPRSPktChRequest_MC5P2RB3 {
+		BIT1		tag,
+		BIT5		multislot_class,
+		BIT2		priority,
+		BIT3		random_bits
+	};
+
+	private type record EGPRSPktChRequest_NOB3P2RB3 {
+		BIT3		tag,
+		BIT3		nr_of_blocks,
+		BIT2		priority,
+		BIT3		random_bits
+	};
+
+	private type record EGPRSPktChRequest_MCG3P2RB3 {
+		BIT3		tag,
+		BIT3		multislot_class_group,
+		BIT2		priority,
+		BIT3		random_bits
+	};
+
+	private type record EGPRSPktChRequest_P2RB3 {
+		BIT6		tag,
+		BIT2		priority,
+		BIT3		random_bits
+	};
+
+	private type record EGPRSPktChRequest_RB5 {
+		BIT6		tag,
+		BIT5		random_bits
+	};
+
+	/* TITAN violates length restrictions on returned type, so we cannot do '... return BIT11'.
+	 * Keep this function private as it returns octet-aligned bitstring (+5 padding bits). */
+	private external function enc_EGPRSPktChRequestInternal(in EGPRSPktChRequest req) return bitstring
+		with { extension "prototype(convert) encode(RAW)" };
+
+	function enc_EGPRSPktChRequest2bits(in EGPRSPktChRequest req) return BIT11
+	{
+		var bitstring ra11_pad := enc_EGPRSPktChRequestInternal(req);
+		return substr(ra11_pad, 0, 11); /* TITAN adds 5 padding bits */
+	}
+
+	function enc_EGPRSPktChRequest2uint(in EGPRSPktChRequest req) return uint16_t
+	{
+		var BIT11 ra11 := enc_EGPRSPktChRequest2bits(req);
+		return bit2int(ra11);
+	}
+
 
 } with { encode "RAW"; variant "FIELDORDER(msb)" variant "BYTEORDER(last)" };