fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/36140?usp=email )
Change subject: [RFC] ePDGId: allow passing both string and int type values ......................................................................
[RFC] ePDGId: allow passing both string and int type values
Change-Id: I231fad78f5c5b5c23f38a6c913df957cfa06259e Related: OS#6383 --- M pySim/ts_31_102.py 1 file changed, 15 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/40/36140/1
diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index 2536603..a13c1ce 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -858,11 +858,12 @@ ( '80110220010db8000000000000000000000023', {'e_pdg_id': {"type_of_ePDG_address": "IPv6", "ePDG_address" : "2001:db8::23" } } ), ] class ePDGId(BER_TLV_IE, tag=0x80): - _construct = Struct('type_of_ePDG_address'/Enum(Byte, FQDN=0, IPv4=1, IPv6=2), + AddrType = Enum(Byte, FQDN=0, IPv4=1, IPv6=2) + _construct = Struct('type_of_ePDG_address'/AddrType, 'ePDG_address'/Switch(this.type_of_ePDG_address, - {'FQDN': Utf8Adapter(GreedyBytes), - 'IPv4': Ipv4Adapter(GreedyBytes), - 'IPv6': Ipv6Adapter(GreedyBytes)})) + {AddrType.FQDN: Utf8Adapter(GreedyBytes), + AddrType.IPv4: Ipv4Adapter(GreedyBytes), + AddrType.IPv6: Ipv6Adapter(GreedyBytes)}))
def __init__(self, fid='6ff3', sfid=None, name='EF.ePDGId', desc='Home ePDG Identifier', **kwargs): super().__init__(fid, sfid=sfid, name=name, desc=desc, **kwargs)