ystero-dev / hampi

Rust ASN.1 Toolkit
Other
44 stars 17 forks source link

ASN.1 value notation output #128

Open harmic opened 1 month ago

harmic commented 1 month ago

Does Hampi currently support (or is there any plan to support) a mechanism to output decoded PDUs in the ASN.1 value notation?

Ie. something like this:

value UL-CCCH-Message ::= 
{
  message c1 : rrcConnectionRequest : 
  {
    criticalExtensions rrcConnectionRequest-r8 : 
    {
      ue-Identity s-TMSI : 
      {
        mmec '10101000'B,
        m-TMSI '11101110 01010000 10010111 11111100'B
      },
      establishmentCause mo-Data,
      spare '0'B
    }
  }
}

I know I can print them via the Debug trait, but that comes out in a rust debug format which is quite different to the above.

gabhijit commented 1 month ago

@harmic : This is currently not supported, but I believe a good idea to support this. In fact the Debug implementation can make use of this value notation. Any pointers to the documentation where this is specified?

This might be slightly involved and A PR is welcome. :-)