<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17645">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">library/L3_Templates: add more templates for Mobile Identity IE<br><br>Change-Id: Ife954becab8c51605da05618a721541e7a4de319<br>---<br>M library/L3_Templates.ttcn<br>1 file changed, 61 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/45/17645/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn</span><br><span>index af4a573..7e53709 100644</span><br><span>--- a/library/L3_Templates.ttcn</span><br><span>+++ b/library/L3_Templates.ttcn</span><br><span>@@ -63,6 +63,67 @@</span><br><span> }</span><br><span> </span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* 3GPP TS 24.008, section 10.5.1.4 "Mobile Identity" */</span><br><span style="color: hsl(120, 100%, 40%);">+template (value) MobileIdentityTLV ts_MI_TLV(template (value) MobileIdentityV mi) := {</span><br><span style="color: hsl(120, 100%, 40%);">+ elementIdentifier := '0010111'B,</span><br><span style="color: hsl(120, 100%, 40%);">+      spare1 := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+       mobileIdentityLV := ts_MI_LV(mi)</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+template MobileIdentityTLV tr_MI_TLV(template MobileIdentityV mi) := {</span><br><span style="color: hsl(120, 100%, 40%);">+  elementIdentifier := '0010111'B,</span><br><span style="color: hsl(120, 100%, 40%);">+      spare1 := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+       mobileIdentityLV := tr_MI_LV(mi)</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+template (value) MobileIdentityLV ts_MI_LV(template (value) MobileIdentityV mi) := {</span><br><span style="color: hsl(120, 100%, 40%);">+  lengthIndicator := 0, /* overwritten */</span><br><span style="color: hsl(120, 100%, 40%);">+       mobileIdentityV := mi</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+template MobileIdentityLV tr_MI_LV(template MobileIdentityV mi) := {</span><br><span style="color: hsl(120, 100%, 40%);">+       lengthIndicator := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+ mobileIdentityV := mi</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Universal (send & receive) template for No Identity */</span><br><span style="color: hsl(120, 100%, 40%);">+template MobileIdentityV t_MI_NoIdentity(template (present) hexstring filler := 'F'H) := {</span><br><span style="color: hsl(120, 100%, 40%);">+        typeOfIdentity := '000'B,</span><br><span style="color: hsl(120, 100%, 40%);">+     oddEvenInd_identity := {</span><br><span style="color: hsl(120, 100%, 40%);">+              no_identity := {</span><br><span style="color: hsl(120, 100%, 40%);">+                      /* Always old, since length can be 1, 3, or 5 */</span><br><span style="color: hsl(120, 100%, 40%);">+                      oddevenIndicator := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                     fillerDigits := filler</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* Universal (send & receive) template for TMSI/P-TMSI */</span><br><span style="color: hsl(120, 100%, 40%);">+template MobileIdentityV t_MI_TMSI(template (present) OCT4 tmsi) := {</span><br><span style="color: hsl(120, 100%, 40%);">+ typeOfIdentity := '100'B,</span><br><span style="color: hsl(120, 100%, 40%);">+     oddEvenInd_identity := {</span><br><span style="color: hsl(120, 100%, 40%);">+              tmsi_ptmsi := {</span><br><span style="color: hsl(120, 100%, 40%);">+                       oddevenIndicator := '0'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                     fillerDigit := '1111'B,</span><br><span style="color: hsl(120, 100%, 40%);">+                       octets := tmsi</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_tr_MI_IMSI(template (present) hexstring digits)</span><br><span style="color: hsl(120, 100%, 40%);">+return template (present) IMSI_L3 {</span><br><span style="color: hsl(120, 100%, 40%);">+      if (istemplatekind(digits, "?")) {</span><br><span style="color: hsl(120, 100%, 40%);">+          return ?;</span><br><span style="color: hsl(120, 100%, 40%);">+     } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              return f_enc_IMSI_L3(valueof(digits))</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+template MobileIdentityV tr_MI_IMSI(template hexstring imsi) := {</span><br><span style="color: hsl(120, 100%, 40%);">+       typeOfIdentity := '001'B,</span><br><span style="color: hsl(120, 100%, 40%);">+     oddEvenInd_identity := {</span><br><span style="color: hsl(120, 100%, 40%);">+              imsi := f_tr_MI_IMSI(imsi)</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* send template for Mobile Identity (TMSI) */</span><br><span> template MobileIdentityLV ts_MI_TMSI_LV(OCT4 tmsi) := {</span><br><span>       lengthIndicator := 0, /* overwritten */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17645">change 17645</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17645"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ttcn3-hacks </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ife954becab8c51605da05618a721541e7a4de319 </div>
<div style="display:none"> Gerrit-Change-Number: 17645 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>