Change in pysim[master]: sysmoISIM-SJA2: Add support for programming IPv4 address for PCSCF

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/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Jan 5 14:23:33 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/21871 )

Change subject: sysmoISIM-SJA2: Add support for programming IPv4 address for PCSCF
......................................................................

sysmoISIM-SJA2: Add support for programming IPv4 address for PCSCF

This commit allows programming of IPv4 or FQDN in EF.PCSCF

Example:

./pySim-prog.py -p 0 -x 001 -y 01 -s 8988211900000000004 -i 001011234567895 -k 8baf473f2f8fd09487cccbd7097c6862 --op 11111111111111111111111111111111 -o 8E27B6AF0E692E750F32667A3B14605D -a 85524953 -n isim.test --msisdn 0598765432100 --epdgid 172.24.15.20 --pcscf 99.100.80.102 --ims-hdomain testims.org

Change-Id: I247a5413e9e5fef6b9d7b6cb8442313e72f9156a
---
M pySim/cards.py
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/pySim/cards.py b/pySim/cards.py
index b7be6e8..17da506 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -336,12 +336,16 @@
 
 	def update_pcscf(self, pcscf):
 		if len(pcscf) > 0:
-			content = enc_addr_tlv(pcscf)
+			addr_type = get_addr_type(pcscf)
+			if addr_type == None:
+				raise ValueError("Unknown PCSCF address type or invalid address provided")
+			content = enc_addr_tlv(pcscf, ('%02x' % addr_type))
 		else:
 			# Just the tag value
 			content = '80'
 		rec_size_bytes = self._scc.record_size(EF_ISIM_ADF_map['PCSCF'])
-		data, sw = self._scc.update_record(EF_ISIM_ADF_map['PCSCF'], 1, rpad(content, rec_size_bytes*2))
+		pcscf_tlv = rpad(content, rec_size_bytes*2)
+		data, sw = self._scc.update_record(EF_ISIM_ADF_map['PCSCF'], 1, pcscf_tlv)
 		return sw
 
 	def read_domain(self):

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I247a5413e9e5fef6b9d7b6cb8442313e72f9156a
Gerrit-Change-Number: 21871
Gerrit-PatchSet: 3
Gerrit-Owner: herlesupreeth <herlesupreeth at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210105/9f57e7fc/attachment.htm>


More information about the gerrit-log mailing list