<p>herlesupreeth has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/pysim/+/21869">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">utils.py: Support IPv4 decoding for Address TLV object present in EF.ePDGId and EF.ePDGIdEm<br><br>Change-Id: I96c30c1fcc03e50c55e9db7e6a18297a3b1d889d<br>---<br>M pySim/utils.py<br>1 file changed, 7 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/69/21869/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/pySim/utils.py b/pySim/utils.py</span><br><span>index 389964c..182bd80 100644</span><br><span>--- a/pySim/utils.py</span><br><span>+++ b/pySim/utils.py</span><br><span>@@ -530,12 +530,18 @@</span><br><span> </span><br><span>               # First byte in the value has the address type</span><br><span>               addr_type = tlv[2][0]</span><br><span style="color: hsl(0, 100%, 40%);">-           # TODO: Support parsing of IPv4 and IPv6</span><br><span style="color: hsl(120, 100%, 40%);">+              # TODO: Support parsing of IPv6</span><br><span>              # Address Type: 0x00 (FQDN), 0x01 (IPv4), 0x02 (IPv6), other (Reserved)</span><br><span>              if addr_type == 0x00: #FQDN</span><br><span>                  # Skip address tye byte i.e. first byte in value list</span><br><span>                        content = tlv[2][1:]</span><br><span>                         s += "\t%s # %s\n" % (i2h(content), i2s(content))</span><br><span style="color: hsl(120, 100%, 40%);">+           elif addr_type == 0x01: #IPv4</span><br><span style="color: hsl(120, 100%, 40%);">+                 # Skip address tye byte i.e. first byte in value list</span><br><span style="color: hsl(120, 100%, 40%);">+                 # Skip the unused byte in Octect 4 after address type byte as per 3GPP TS 31.102</span><br><span style="color: hsl(120, 100%, 40%);">+                      ipv4 = tlv[2][2:]</span><br><span style="color: hsl(120, 100%, 40%);">+                     content = '.'.join(str(x) for x in ipv4)</span><br><span style="color: hsl(120, 100%, 40%);">+                      s += "\t%s # %s\n" % (i2h(ipv4), content)</span><br><span> </span><br><span>      return s</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/pysim/+/21869">change 21869</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/pysim/+/21869"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: pysim </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I96c30c1fcc03e50c55e9db7e6a18297a3b1d889d </div>
<div style="display:none"> Gerrit-Change-Number: 21869 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: herlesupreeth <herlesupreeth@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>