Change in pysim[master]: utils.py: Support IPv4 decoding for Address TLV object present in EF....

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

herlesupreeth gerrit-no-reply at lists.osmocom.org
Thu Dec 24 08:16:40 UTC 2020


herlesupreeth has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/21869 )


Change subject: utils.py: Support IPv4 decoding for Address TLV object present in EF.ePDGId and EF.ePDGIdEm
......................................................................

utils.py: Support IPv4 decoding for Address TLV object present in EF.ePDGId and EF.ePDGIdEm

Change-Id: I96c30c1fcc03e50c55e9db7e6a18297a3b1d889d
---
M pySim/utils.py
1 file changed, 7 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/69/21869/1

diff --git a/pySim/utils.py b/pySim/utils.py
index 389964c..182bd80 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -530,12 +530,18 @@
 
 		# First byte in the value has the address type
 		addr_type = tlv[2][0]
-		# TODO: Support parsing of IPv4 and IPv6
+		# TODO: Support parsing of IPv6
 		# Address Type: 0x00 (FQDN), 0x01 (IPv4), 0x02 (IPv6), other (Reserved)
 		if addr_type == 0x00: #FQDN
 			# Skip address tye byte i.e. first byte in value list
 			content = tlv[2][1:]
 			s += "\t%s # %s\n" % (i2h(content), i2s(content))
+		elif addr_type == 0x01: #IPv4
+			# Skip address tye byte i.e. first byte in value list
+			# Skip the unused byte in Octect 4 after address type byte as per 3GPP TS 31.102
+			ipv4 = tlv[2][2:]
+			content = '.'.join(str(x) for x in ipv4)
+			s += "\t%s # %s\n" % (i2h(ipv4), content)
 
 	return s
 

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/21869
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I96c30c1fcc03e50c55e9db7e6a18297a3b1d889d
Gerrit-Change-Number: 21869
Gerrit-PatchSet: 1
Gerrit-Owner: herlesupreeth <herlesupreeth at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201224/57ea60c2/attachment.htm>


More information about the gerrit-log mailing list