sgsn: Use Random RAI when performing attach request
Change-Id: Id349c7cd0899d6b87114a3ece8bc2ee625f64116
diff --git a/library/General_Types.ttcn b/library/General_Types.ttcn
index aab0609..b404fe1 100644
--- a/library/General_Types.ttcn
+++ b/library/General_Types.ttcn
@@ -163,6 +163,7 @@
type hexstring HEX24n length(24) with { variant "" };
//hexstring with length interval
+ type hexstring HEX0_3n length(0..3) with { variant "" };
type hexstring HEX0_18n length(0..18) with { variant "" };
type hexstring HEX1_20n length(1..20) with { variant "" };
type hexstring HEX1_34n length(1..34) with { variant "" };
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;
+}
}