pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34775?usp=email )
Change subject: library/DIAMETER: Allow passing template as imsi param to tr_AVP_UserNameImsi() ...................................................................... library/DIAMETER: Allow passing template as imsi param to tr_AVP_UserNameImsi() Change-Id: Ia525b2a1850bc80cee13717b114fec215fa84f9f --- M library/DIAMETER_Templates.ttcn M library/Osmocom_Types.ttcn 2 files changed, 23 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved laforge: Looks good to me, but someone else must approve diff --git a/library/DIAMETER_Templates.ttcn b/library/DIAMETER_Templates.ttcn index 4dd686a..b6723e7 100644 --- a/library/DIAMETER_Templates.ttcn +++ b/library/DIAMETER_Templates.ttcn @@ -625,7 +625,7 @@ } } template (value) GenericAVP ts_AVP_UserNameImsi(hexstring imsi) := ts_AVP_UserName(char2oct(hex2str(imsi))); -template (present) GenericAVP tr_AVP_UserNameImsi(hexstring imsi) := tr_AVP_UserName(char2oct(hex2str(imsi))); +template (present) GenericAVP tr_AVP_UserNameImsi(template (present) hexstring imsi := ?) := tr_AVP_UserName(char2oct_tmpl(hex2str_tmpl(imsi))); diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn index ce22c1e..ef55583 100644 --- a/library/Osmocom_Types.ttcn +++ b/library/Osmocom_Types.ttcn @@ -179,6 +179,19 @@ } } +function hex2str_tmpl(template hexstring inp) return template charstring +{ + if (istemplatekind(inp, "omit")) { + return omit; + } else if (istemplatekind(inp, "*")) { + return *; + } else if (istemplatekind(inp, "?")) { + return ?; + } else { + return hex2str(valueof(inp)); + } +} + function f_array_contains(IntegerRecord arr, integer key) return boolean { for (var integer i:= 0; i< sizeof(arr); i := i + 1) { if (arr[i] == key) { -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34775?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ia525b2a1850bc80cee13717b114fec215fa84f9f Gerrit-Change-Number: 34775 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pes...@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de> Gerrit-Reviewer: laforge <lafo...@osmocom.org> Gerrit-Reviewer: pespin <pes...@sysmocom.de> Gerrit-MessageType: merged