-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find macro by tag #5
Comments
I think I'll have a try at this if I get time... The alternative seems to be external peeking into the response before decoding or changing the ASN.1 to wrap all req/resp. in the same macro as you did with Net::LDAP::Message. |
... had a look at this. |
Ok... given that the application needs to know which macro is used to decode a PDU and a simple way to do that without changing existing API is to only provide methods to return the macro name (which could then be used with find() - I suggest adding subs like this to ASN1.pm
|
Actually... I seem to manage fine by just calling asn_decode_tag and maintaining a hash of APPLICATION tags to Macro names in my application. |
I am ok with adding the subs, except they should end with return undef, not croak. It should be up to the application to croak if it wants to |
On 2012-06-12 23:26, Graham Barr wrote:
Of course... The reason I posted the example here and not sumbmitted a patch was that Right now I'm just calling asn_decode_tag on the incoming PDU and then The problem I wanted to solve was when having an incoming network package with a PDU of unknown type but with an application tag. I think my current solution could be cleaner if I could get the TAG=>macro hash from Convert::ASN1 instead of manually creating and hardcoding it, but apart from that it's working just as well as the above subs. /Peter |
Add a method to find a macro by its tag.
This could be used within decode if called on an object that has no selected macro
The text was updated successfully, but these errors were encountered: