laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/pysim/+/35424?usp=email )

Change subject: ts_31_103: Add construct for EF.GBABP and EF.GBANL
......................................................................

ts_31_103: Add construct for EF.GBABP and EF.GBANL

Change-Id: Ife06f54c2443f3e048bd36f706f309843703403a
---
M pySim/ts_31_103.py
M pysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
2 files changed, 22 insertions(+), 1 deletion(-)

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




diff --git a/pySim/ts_31_103.py b/pySim/ts_31_103.py
index df91ea1..e9275c5 100644
--- a/pySim/ts_31_103.py
+++ b/pySim/ts_31_103.py
@@ -156,11 +156,23 @@
 class EF_GBABP(TransparentEF):
     def __init__(self, fid='6fd5', sfid=None, name='EF.GBABP', desc='GBA 
Bootstrapping', **kwargs):
         super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, **kwargs)
+        self._construct = Struct('rand'/LV,
+                                 'b_tid'/LV,
+                                 'key_lifetime'/LV)

 # TS 31.103 Section 4.2.10
 class EF_GBANL(LinFixedEF):
+    class NAF_ID(BER_TLV_IE, tag=0x80):
+        _construct = Struct('fqdn'/Utf8Adapter(Bytes(this._.total_len-5)),
+                            'ua_spi'/HexAdapter(Bytes(5)))
+    class B_TID(BER_TLV_IE, tag=0x81):
+        _construct = Utf8Adapter(GreedyBytes)
+    # pylint: disable=undefined-variable
+    class GbaNlCollection(TLV_IE_Collection, nested=[NAF_ID, B_TID]):
+        pass
     def __init__(self, fid='6fd7', sfid=None, name='EF.GBANL', desc='GBA NAF 
List', **kwargs):
         super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, **kwargs)
+        self._tlv = EF_GBANL.GbaNlCollection

 # TS 31.103 Section 4.2.11
 class EF_NAFKCA(LinFixedEF):
diff --git a/pysim-testdata/pySim-trace_test_gsmtap.pcapng.ok 
b/pysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
index 2d9d951..047f9de 100644
--- a/pysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
+++ b/pysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
@@ -347,7 +347,7 @@
 ===============================
 01 READ BINARY      MF/ADF.ISIM/EF.IST                  -        9000 {1: 
{'activated': True, 'description': 'P-CSCF address'}, 2: {'activated': False, 
'description': 'Generic Bootstrapping Architecture (GBA)'}, 3: {'activated': 
False, 'description': 'HTTP Digest'}, 4: {'activated': True, 'description': 
'GBA-based Local Key Establishment Mechanism'}, 5: {'activated': True, 
'description': 'Support of P-CSCF discovery for IMS Local Break Out'}, 6: 
{'activated': False, 'description': 'Short Message Storage (SMS)'}, 7: 
{'activated': False, 'description': 'Short Message Status Reports (SMSR)'}, 8: 
{'activated': False, 'description': 'Support for SM-over-IP including data 
download via SMS-PP as defined in TS 31.111 [31]'}, 9: {'activated': False, 
'description': 'Communication Control for IMS by ISIM'}, 10: {'activated': 
True, 'description': 'Support of UICC access to IMS'}, 11: {'activated': False, 
'description': 'URI support by UICC'}, 12: {'activated': False, 'description': 
'Media Type support'}, 13: {'activated': False, 'description': 'IMS call 
disconnection cause'}, 14: {'activated': False, 'description': 'URI support for 
MO SHORT MESSAGE CONTROL'}, 15: {'activated': False, 'description': 'MCPTT'}, 
16: {'activated': False, 'description': 'URI support for SMS-PP DOWNLOAD as 
defined in 3GPP TS 31.111 [31]'}, 17: {'activated': False, 'description': 'From 
Preferred'}, 18: {'activated': False, 'description': 'IMS configuration data'}, 
19: {'activated': False, 'description': 'XCAP Configuration Data'}, 20: 
{'activated': False, 'description': 'WebRTC URI'}, 21: {'activated': False, 
'description': 'MuD and MiD configuration data'}, 22: {'activated': False}, 23: 
{'activated': False}, 24: {'activated': False}}
 ===============================
-01 READ BINARY      MF/ADF.ISIM/EF.GBABP                -        9000 {'raw': 
'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'}
+01 READ BINARY      MF/ADF.ISIM/EF.GBABP                -        9000 None
 ===============================
 01 READ RECORD      MF/ADF.ISIM/EF.IMPU                 02       9000 {'impu': 
None}
 ===============================

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35424?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ife06f54c2443f3e048bd36f706f309843703403a
Gerrit-Change-Number: 35424
Gerrit-PatchSet: 7
Gerrit-Owner: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-MessageType: merged

Reply via email to