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

Invalid text declaration #16

Closed
nrolans opened this issue Sep 11, 2020 · 2 comments
Closed

Invalid text declaration #16

nrolans opened this issue Sep 11, 2020 · 2 comments

Comments

@nrolans
Copy link

nrolans commented Sep 11, 2020

I'm trying to generate files with mib2go (v0.2.0). I think some types are dropped by the clause below, everything is fine if I comment it out.

if parentType.Decl == types.DeclTextualConvention {
// This is invalid
break
}

Here is an example of a field that is not found when loading the RMON2-MIB. LastCreateTime has TimeStamp as a parent type with a textual convention.

$ ./mib2go generate -d mibs -M /<redacted>/snmp-mibs RMON2-MIB
2020/09/11 11:23:33 [I] Setting path /<redacted>/snmp-mibs
2020/09/11 11:23:33 [E] Module RMON2-MIB: Type not found for node etherStatsCreateTime

RMON2-MIB (LAST-UPDATED "9605270000Z")

IMPORTS TEXTUAL-CONVENTION, RowStatus, DisplayString, TimeStamp FROM SNMPv2-TC
etherStatsCreateTime OBJECT-TYPE
    SYNTAX     LastCreateTime
    MAX-ACCESS read-only
    STATUS     current
    DESCRIPTION
        "The value of sysUpTime when this control entry was last
        activated. This can be used by the management station to
        ensure that the table has not been deleted and recreated
        between polls."
    ::= { etherStats2Entry 2 }


LastCreateTime ::= TEXTUAL-CONVENTION
    STATUS current
    DESCRIPTION
        "This TC describes an object that stores the last time its
        entry was created.

        This can be used for polling applications to determine that an
        entry has been deleted and re-created between polls, causing
        an otherwise undetectable discontinuity in the data."
    SYNTAX TimeStamp

SNMPv2-TC

TimeStamp ::= TEXTUAL-CONVENTION
    STATUS       current
    DESCRIPTION
            "The value of the sysUpTime object at which a specific
            occurrence happened.  The specific occurrence must be
            defined in the description of any object defined using this
            type."
    SYNTAX       TimeTicks

I have the same issues with LLDP-MIB (revision 200505060000Z): LLDP-MIB::lldpRemTimeMark -> RMON2-MIB::TimeFilter -> SNMPv2-SMI::TimeTicks.

These are very common MIBs so I'm probably doing something wrong. What am I missing?

@sleepinggenius2
Copy link
Owner

Per RFC 2579 Section 3.5 "... the SYNTAX clause of a Textual Convention can not refer to a previously defined Textual Convention." That's why the referenced lines of code are in there. It looks like revision 200605020000Z of RMON2-MIB (RFC 4502) corrected this issue.

@nrolans
Copy link
Author

nrolans commented Sep 12, 2020

Thank you for the very quick response! Problem solved :)

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

No branches or pull requests

2 participants