summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2020-09-11 19:52:15 +0200
committerAlexander Couzens <lynxis@fe80.eu>2020-09-11 20:24:19 +0200
commit4231de67fc11235e0c479add066b4a346ddc14b8 (patch)
treee4ae00a953bd7eef93310ff1674bd5634ee682b5
parent5e6ae79d0c321dbf0af11aa813d32cef97191f34 (diff)
library: Osmocom_Types: fix extra indention tab
The top level context doesn't have an indent. Change-Id: Ib94fa74a7752f21ba8203a5de17ce2b10d800d16
-rw-r--r--library/Osmocom_Types.ttcn154
1 files changed, 77 insertions, 77 deletions
diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn
index 6281280..1993ae1 100644
--- a/library/Osmocom_Types.ttcn
+++ b/library/Osmocom_Types.ttcn
@@ -10,90 +10,90 @@
module Osmocom_Types {
- import from General_Types all;
-
- type integer uint8_t (0..255) with { variant "unsigned 8 bit" };
- type integer uint16_t (0..65535) with { variant "unsigned 16 bit" };
- type integer uint24_t (0..16777215) with { variant "unsigned 24 bit" };
- type integer uint32_t (0..4294967295) with { variant "unsigned 32 bit" };
-
- type integer int8_t (-128..127) with { variant "8 bit" };
- type integer int16_t (-32768..32767) with { variant "16 bit" };
-
- type integer uint1_t (0..1) with { variant "unsigned 1 bit" };
- type integer uint2_t (0..3) with { variant "unsigned 2 bit" };
- type integer uint3_t (0..7) with { variant "unsigned 3 bit" };
- type integer uint4_t (0..15) with { variant "unsigned 4 bit" };
- type integer uint5_t (0..31) with { variant "unsigned 5 bit" };
- type integer uint6_t (0..63) with { variant "unsigned 6 bit" };
- type integer uint7_t (0..127) with { variant "unsigned 7 bit" };
- type integer uint9_t (0..511) with { variant "unsigned 9 bit" };
- type integer uint10_t (0..1023) with { variant "unsigned 10 bit" };
- type integer uint11_t (0..2047) with { variant "unsigned 11 bit" };
- type integer uint12_t (0..4095) with { variant "unsigned 12 bit" };
- type integer uint13_t (0..8191) with { variant "unsigned 13 bit" };
- type integer uint14_t (0..16383) with { variant "unsigned 14 bit" };
- type integer uint15_t (0..32767) with { variant "unsigned 15 bit" };
- type integer uint40_t (0..1099511627776) with { variant "unsigned 40 bit" };
-
-
- const uint16_t c_UINT16_MAX := 65535;
- const uint32_t c_UINT32_MAX := 4294967295;
-
- /* CSN.1 L/H placeholders */
- const BIT1 CSN1_L := '0'B;
- const BIT1 CSN1_H := '1'B;
-
- type record Arfcn {
- boolean pcs,
- uint15_t arfcn
- } with { variant "" };
-
- /* return random integer 0 <= ret < max. According to ETSI ES 201 873 C.6.1, rnd() returns *less* than 1, so
- * the returned int will always be ret < max, or ret <= (max-1). */
- function f_rnd_int(integer max) return integer {
- return float2int(rnd()*int2float(max));
- }
-
- /* return hexstring composed of random digits */
- function f_rnd_hexstring(in integer len, in integer max := 15) return hexstring {
- var integer i;
- var hexstring ret := ''H;
- for (i := 0; i < len; i := i + 1) {
- ret := ret & int2hex(f_rnd_int(max), 1);
- }
- return ret;
+import from General_Types all;
+
+type integer uint8_t (0..255) with { variant "unsigned 8 bit" };
+type integer uint16_t (0..65535) with { variant "unsigned 16 bit" };
+type integer uint24_t (0..16777215) with { variant "unsigned 24 bit" };
+type integer uint32_t (0..4294967295) with { variant "unsigned 32 bit" };
+
+type integer int8_t (-128..127) with { variant "8 bit" };
+type integer int16_t (-32768..32767) with { variant "16 bit" };
+
+type integer uint1_t (0..1) with { variant "unsigned 1 bit" };
+type integer uint2_t (0..3) with { variant "unsigned 2 bit" };
+type integer uint3_t (0..7) with { variant "unsigned 3 bit" };
+type integer uint4_t (0..15) with { variant "unsigned 4 bit" };
+type integer uint5_t (0..31) with { variant "unsigned 5 bit" };
+type integer uint6_t (0..63) with { variant "unsigned 6 bit" };
+type integer uint7_t (0..127) with { variant "unsigned 7 bit" };
+type integer uint9_t (0..511) with { variant "unsigned 9 bit" };
+type integer uint10_t (0..1023) with { variant "unsigned 10 bit" };
+type integer uint11_t (0..2047) with { variant "unsigned 11 bit" };
+type integer uint12_t (0..4095) with { variant "unsigned 12 bit" };
+type integer uint13_t (0..8191) with { variant "unsigned 13 bit" };
+type integer uint14_t (0..16383) with { variant "unsigned 14 bit" };
+type integer uint15_t (0..32767) with { variant "unsigned 15 bit" };
+type integer uint40_t (0..1099511627776) with { variant "unsigned 40 bit" };
+
+
+const uint16_t c_UINT16_MAX := 65535;
+const uint32_t c_UINT32_MAX := 4294967295;
+
+/* CSN.1 L/H placeholders */
+const BIT1 CSN1_L := '0'B;
+const BIT1 CSN1_H := '1'B;
+
+type record Arfcn {
+ boolean pcs,
+ uint15_t arfcn
+} with { variant "" };
+
+/* return random integer 0 <= ret < max. According to ETSI ES 201 873 C.6.1, rnd() returns *less* than 1, so
+ * the returned int will always be ret < max, or ret <= (max-1). */
+function f_rnd_int(integer max) return integer {
+ return float2int(rnd()*int2float(max));
+}
+
+/* return hexstring composed of random digits */
+function f_rnd_hexstring(in integer len, in integer max := 15) return hexstring {
+ var integer i;
+ var hexstring ret := ''H;
+ for (i := 0; i < len; i := i + 1) {
+ ret := ret & int2hex(f_rnd_int(max), 1);
}
+ return ret;
+}
- /* return octetstring composed of random bytes */
- function f_rnd_octstring(in integer len) return octetstring {
- var integer i;
- var octetstring ret := ''O;
- for (i := 0; i < len; i := i + 1) {
- ret := ret & int2oct(f_rnd_int(255), 1);
- }
- return ret;
+/* return octetstring composed of random bytes */
+function f_rnd_octstring(in integer len) return octetstring {
+ var integer i;
+ var octetstring ret := ''O;
+ for (i := 0; i < len; i := i + 1) {
+ ret := ret & int2oct(f_rnd_int(255), 1);
}
+ return ret;
+}
- /* return bitstring composed of random bits */
- function f_rnd_bitstring(in integer len) return bitstring {
- var octetstring oct := f_rnd_octstring(len / 8 + 1);
- return substr(oct2bit(oct), 0, len);
- }
+/* return bitstring composed of random bits */
+function f_rnd_bitstring(in integer len) return bitstring {
+ var octetstring oct := f_rnd_octstring(len / 8 + 1);
+ return substr(oct2bit(oct), 0, len);
+}
- function f_rnd_imsi(in hexstring prefix) return hexstring {
- return prefix & f_rnd_hexstring(15 - lengthof(prefix), 9);
- }
+function f_rnd_imsi(in hexstring prefix) return hexstring {
+ return prefix & f_rnd_hexstring(15 - lengthof(prefix), 9);
+}
- function f_rnd_msisdn(in octetstring prefix, integer len := 6) return octetstring {
- return prefix & f_rnd_octstring(len - lengthof(prefix));
- }
+function f_rnd_msisdn(in octetstring prefix, integer len := 6) return octetstring {
+ return prefix & f_rnd_octstring(len - lengthof(prefix));
+}
- function f_sleep(float seconds) {
- timer T := seconds;
- T.start;
- T.timeout;
- }
+function f_sleep(float seconds) {
+ timer T := seconds;
+ T.start;
+ T.timeout;
+}
function bool2bit(boolean inp) return BIT1 {
if (inp) {