herlesupreeth has uploaded this change for review. ( 
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(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/71/21871/1

diff --git a/pySim/cards.py b/pySim/cards.py
index 911bd05..79d5889 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -328,9 +328,13 @@
                return pcscf_recs

        def update_pcscf(self, pcscf):
-               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")
+
                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(enc_addr_tlv(pcscf, ('%02x' % addr_type)), 
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: 1
Gerrit-Owner: herlesupreeth <herlesupre...@gmail.com>
Gerrit-MessageType: newchange

Reply via email to