laforge has uploaded this change for review. ( 
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
1 file changed, 23 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/24/35424/1

diff --git a/pySim/ts_31_103.py b/pySim/ts_31_103.py
index df91ea1..914a4dc 100644
--- a/pySim/ts_31_103.py
+++ b/pySim/ts_31_103.py
@@ -156,11 +156,25 @@
 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('length_of_rand'/Int8ub,
+                                 'rand'/HexAdapter(Bytes(this.length_of_rand)),
+                                 'length_of_b_tid'/Int8ub,
+                                 
'b_tid'/HexAdapter(Bytes(this.length_of_b_tid)),
+                                 'length_of_key_lifetime'/Int8ub,
+                                 
'key_lifetime'/HexAdapter(Bytes(this.length_of_key_lifetime)))

 # 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)
+    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):

--
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: 1
Gerrit-Owner: laforge <[email protected]>
Gerrit-MessageType: newchange

Reply via email to