-
Notifications
You must be signed in to change notification settings - Fork 129
Boilerplate Tuple for ASN1 object? #127
Comments
You may re-read https://github.com/P1sec/pycrate/wiki/Using-the-pycrate-asn1-runtime#rrc-3g : I just added a short section on attributes indicating optional components of constructed types. Besides of this, there is no magic however, as a protocol developer, you are required to know the content of the message structures to fill them appropriately. Moreover, those 2 exiting issues may be related to yours: Sorry to say, but maybe your development can wait till January. |
Maybe you could already contribute to the project by submitting the SBC-AP ASN.1 protocol definition to the pycrate_asn1dir subdirectory ? That would be very nice. |
Thanks @p1-bmu , I'll send a PR with the latest ASN1 definition for SBc-AP and some examples when I've got this working. As you suggested calling the names returned a list of what I needed to populate which is exactly what I was after:
And with fresh eyes and another read over the documentation I managed to make some progress! To create a Write-Replace-Warning-Request I need to include the two mandatory protocolIEs which are:
Which I set in a list named protocol_ies and try and compile using the set_val() function:
However when I try to run it I get the below, which I think relates to the BIT STRING encoding on the Message-Identifier, which I think I've got correct? (With
Any pointers? I know it's probably something dead simple. (The upper case V in value is used in the SBC.py library, which is compiled from the ASN1 definition attached to the first post. I parsed some S1 messages with some of the example code, and looked at the Maco-eNodeB-ID as that's also encoded as BIT STRING and confirmed the way I'm formatting it is the same as on the S1 messages, so I'm a bit out of ideas? |
This is a special case with all RAN protocols, where the
|
Thanks again @p1-bmu , That makes sense we need to define the reference to the type of value, I just tried running it with the changes you specified, same result though:
Is there something else I'm missing? I've attached the simplified Python script and contents of SBc.py generated by PyCrate for the ASN.1 dict, I'd appreciate any pointers, I know I've got a lot more IEs to populate after this, but hopefully once I know how to format one I can format all the others accordingly. |
I guess you need to set also the |
Any additional feedback @nickvsnetworking ? Or I'll close this. |
Hi!
|
Hi folks,
Apologies in advance for what may very well be a dumb question, I've had a read over the Wiki and the outputted code and it's still not clear to me:
I'm playing with the 3GPP SBc Interface which is ASN.1 encoded,
Using the magic of Pycrate I've created a Python file from the ASN1 definition and using it I'm able to take hex data containing an encoded ASN.1 message and turn it into a Python tuple - fantastic.
And I'm also able to encode a tuple back into ASN.1 using the set_val() function:
Considering the ASN.1 definition defines what elements need to be present and which are optional, I'm wondering if there is a function to generate list the required elements to be fed into set_val?
Manually populating the tuples from the elements in the spec seems above what my mind can process at this point in the year,
SBC.asn.txt
SBC.py.txt
The text was updated successfully, but these errors were encountered: