<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hello.</div>
<div> </div>
<div>I'm really struggling with the data structures provided by asn1ct when compiling the 3GPP ASN.1 protocol. Somehow the combination of the complex S1AP ASN.1 definition with the record-based structures provided by the tool seems... frustrating. (Actually, the eRRC seems even worse.)</div>
<div> </div>
<div>For context I will provide the data structure the decoder produces (and the encoder accepts):</div>
<div> </div>
<div>{initiatingMessage,<br/>
{'InitiatingMessage',9,reject,<br/>
{'InitialContextSetupRequest',<br/>
[{'ProtocolIE-Field',0,reject,0},<br/>
{'ProtocolIE-Field',8,reject,1},<br/>
{'ProtocolIE-Field',66,reject,<br/>
{'UEAggregateMaximumBitrate',2112000,2112000,asn1_NOVALUE}},<br/>
{'ProtocolIE-Field',24,reject,<br/>
[{'ProtocolIE-Field',52,reject,<br/>
{'E-RABToBeSetupItemCtxtSUReq',4,<br/>
{'E-RABLevelQoSParameters',5,<br/>
{'AllocationAndRetentionPriority',2,<br/>
'shall-not-trigger-pre-emption',<br/>
'not-pre-emptable',asn1_NOVALUE},<br/>
asn1_NOVALUE,asn1_NOVALUE},<br/>
<<"\n.¾G">>,<br/>
<<0,0,0,42>>,<br/>
asn1_NOVALUE,asn1_NOVALUE}},<br/>
{'ProtocolIE-Field',52,reject,<br/>
{'E-RABToBeSetupItemCtxtSUReq',7,<br/>
{'E-RABLevelQoSParameters',5,<br/>
{'AllocationAndRetentionPriority',2,<br/>
'shall-not-trigger-pre-emption',<br/>
'not-pre-emptable',asn1_NOVALUE},<br/>
asn1_NOVALUE,asn1_NOVALUE},<br/>
<<"\n.¾G">>,<br/>
<<0,0,0,42>>,<br/>
asn1_NOVALUE,asn1_NOVALUE}}]},</div>
<div><etc></div>
<div> </div>
<div>So, it's basically some outer elements which I can efficiently match - tuple containing record (message type) containing message-specific record, which in turn contains the list of top-level information elements.</div>
<div> </div>
<div>Each information element has a potential tree structure:</div>
<div>* an information element is a record with fields id, criticality, and value</div>
<div>* value can be a number, a record, or a list of information elements </div>
<div> </div>
<div>I have written a function that reorders this tree into a dict of protocolIEs while flattening the tree (and the reversal).</div>
<div> </div>
<div>But is there no generic/elegant solution to querying and/or updating such big and complex data structures? </div>
<div> </div>
<div>Thanks and regards,</div>
<div>Oliver</div>
<div> </div>
<div> </div></div></body></html>