pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40442?usp=email )
Change subject: library: Improve some f_rnd_*() functions
......................................................................
library: Improve some f_rnd_*() functions
Change-Id: I82535caf08aa628738c0cbc29b8b27d525ec78ce
---
M library/General_Types.ttcn
M library/Osmocom_Types.ttcn
2 files changed, 7 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/42/40442/1
diff --git a/library/General_Types.ttcn b/library/General_Types.ttcn
index 163ec47..dca4ea2 100644
--- a/library/General_Types.ttcn
+++ b/library/General_Types.ttcn
@@ -172,6 +172,7 @@
type hexstring HEX4n length(4) with { variant "" };
type hexstring HEX6n length(6) with { variant "" };
type hexstring HEX8n length(8) with { variant "" };
+ type hexstring HEX14n length(14) with { variant "" };
type hexstring HEX15n length(15) with { variant "" };
type hexstring HEX16n length(16) with { variant "" };
type hexstring HEX24n length(24) with { variant "" };
diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn
index 21d7abf..a7e37e6 100644
--- a/library/Osmocom_Types.ttcn
+++ b/library/Osmocom_Types.ttcn
@@ -101,14 +101,18 @@
return substr(oct2bit(oct), 0, len);
}
-function f_rnd_imsi(in hexstring prefix) return hexstring {
+function f_rnd_imsi(in hexstring prefix := ''H) return HEX15n {
return prefix & f_rnd_hexstring(15 - lengthof(prefix), 10);
}
-function f_rnd_imei(in hexstring prefix) return hexstring {
+function f_rnd_imei(in hexstring prefix := ''H) return HEX14n {
return prefix & f_rnd_hexstring(14 - lengthof(prefix), 10);
}
+function f_rnd_imeisv(in hexstring prefix := ''H) return HEX16n {
+ return prefix & f_rnd_hexstring(16 - lengthof(prefix), 10);
+}
+
function f_rnd_msisdn(in octetstring prefix, integer len := 6) return octetstring {
return prefix & f_rnd_octstring(len - lengthof(prefix));
}
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40442?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I82535caf08aa628738c0cbc29b8b27d525ec78ce
Gerrit-Change-Number: 40442
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>