sgsn: Use Random RAI when performing attach request

Change-Id: Id349c7cd0899d6b87114a3ece8bc2ee625f64116
diff --git a/library/L3_Common.ttcn b/library/L3_Common.ttcn
index a7c2eb2..19e52eb 100644
--- a/library/L3_Common.ttcn
+++ b/library/L3_Common.ttcn
@@ -2,6 +2,7 @@
 
 import from Osmocom_Types all;
 import from General_Types all;
+import from MobileL3_GMM_SM_Types all;
 
 type record AuthVector {
 	OCT16 rand,
@@ -66,6 +67,22 @@
 	return tlli or4b 'c0000000'O;
 }
 
+function f_RAI(HEX0_3n mcc, HEX0_3n mnc, OCT2 lac, OCT1 rac) return RoutingAreaIdentificationV {
+	if (lengthof(mnc) == 2) {
+		mnc := mnc & 'F'H;
+	}
+	var RoutingAreaIdentificationV ret := {
+		mccDigit1 := mcc[0],
+		mccDigit2 := mcc[1],
+		mccDigit3 := mcc[2],
+		mncDigit3 := mnc[2],
+		mncDigit1 := mnc[0],
+		mncDigit2 := mnc[1],
+		lac := lac,
+		rac := rac
+	}
+	return ret;
+}
 
 
 }