aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSupreeth Herle <herlesupreeth@gmail.com>2020-03-25 14:56:13 +0100
committerherlesupreeth <herlesupreeth@gmail.com>2021-01-05 11:46:41 +0100
commitc491dc019f46137e6700a918d589182b954eec8c (patch)
tree4aa124975da4066148ee9ed9f099c9ed6ee462db
parent43fd03b62774db3d39a5b61bca57dadd3b8e07e4 (diff)
sysmoISIM-SJA2: Add support for programming IPv4 address for Home ePDG Identifier
This commit allows programming of IPv4 or FQDN in EF.ePDGId 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 pcscf.testims.org --ims-hdomain testims.org Change-Id: I10a708d3e0c3ae398c942e3529e364dfe4bb23e7
-rw-r--r--pySim/cards.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pySim/cards.py b/pySim/cards.py
index d60b27a..b7be6e8 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -276,7 +276,10 @@ class UsimCard(Card):
def update_epdgid(self, epdgid):
size = self._scc.binary_size(EF_USIM_ADF_map['ePDGId']) * 2
if len(epdgid) > 0:
- epdgid_tlv = rpad(enc_addr_tlv(epdgid), size)
+ addr_type = get_addr_type(epdgid)
+ if addr_type == None:
+ raise ValueError("Unknown ePDG Id address type or invalid address provided")
+ epdgid_tlv = rpad(enc_addr_tlv(epdgid, ('%02x' % addr_type)), size)
else:
epdgid_tlv = rpad('ff', size)
data, sw = self._scc.update_binary(