Skip to content
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

Ask for an update in parser module cause parser fails to parse hex string in INTEGER syntax #18

Closed
MTamPham opened this issue Oct 8, 2020 · 2 comments
Labels

Comments

@MTamPham
Copy link

MTamPham commented Oct 8, 2020

Hi there,

It's me again. I've faced a rare MIB file that contains hex string under Integer syntax type. Would it be much trouble for you to update the parser module to be something like this?

Value string `parser:"\"(\" @( \"-\"? Int ) \")\""`

Value string              `parser:"\"(\" @( \"-\"? Int | HexString ) \")\""`

Please find the line 111 in the attached as a reference. This MIB can be found online from here too under the name "AprisaXECardType".

I look forward to hearing from you soon.
Cheers.
4RF-APRISAXE-TC.zip

@sleepinggenius2
Copy link
Owner

I have some mixed feelings about this item. To start with, the syntax referenced is not valid ASN.1 for a Named Number. This syntax is also not supported by libsmi, which is what this project was based on. It does appear to be supported by Net-SNMP, but looking through the source code, it appears to be a side-effect of the way that parser is written and not necessarily intended.

The goal of this project is to be as standards-compliant as possible. I understand that not all vendors consistently adhere to those same standards while developing their MIBs, so concessions have been made for some proposed/draft standards, but I do not want to encourage that practice. I know that ultimately comes back on the end-user though and not the vendor and want to be cognizant of that.

I have looked through all the MIBs (thousands) currently in my collection and this is the only file that I see using this syntax. The change is also more extensive than just the line of code referenced, as it breaks the API for any code consuming that Value and expecting an integer. If it was more widespread, then I would be more inclined to include support, but I will not be doing that for this one-off at this time.

@MTamPham
Copy link
Author

Thank you very much for your response.

Yeah, I can understand from your perspective. Let me take care of this.

Tam Pham

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants