Quantcast

snmpc: Compiling LLDP-MIB failled

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

snmpc: Compiling LLDP-MIB failled

fxmy wang-2

Hi guys,
So recently I’m toying with SNMP Development Toolkit and having trouble compiling standard LLDP-MIB. Errors shown below

2> snmpc:compile("LLDP-MIB.mib").
LLDP-MIB.mib: 655: Cannot AUGMENT the non-existing table entry lldpLocManAddrEntry
[LLDP-MIB.mib][WAR]: No RowStatus column in table lldpPortConfigTable => The default functions won't work properly
[LLDP-MIB.mib][WAR]: No RowStatus column in table lldpConfigManAddrTable => The default functions won't work properly
[LLDP-MIB.mib][WAR]: No RowStatus column in table lldpStatsTxPortTable => The default functions won't work properly
[LLDP-MIB.mib][WAR]: No RowStatus column in table lldpStatsRxPortTable => The default functions won't work properly
[LLDP-MIB.mib][WAR]: No RowStatus column in table lldpLocPortTable => The default functions won't work properly
[LLDP-MIB.mib][WAR]: No RowStatus column in table lldpLocManAddrTable => The default functions won't work properly
[LLDP-MIB.mib][WAR]: No RowStatus column in table lldpRemTable => The default functions won't work properly
[LLDP-MIB.mib][WAR]: No RowStatus column in table lldpRemManAddrTable => The default functions won't work properly
[LLDP-MIB.mib][WAR]: No RowStatus column in table lldpRemUnknownTLVTable => The default functions won't work properly
[LLDP-MIB.mib][WAR]: No RowStatus column in table lldpRemOrgDefInfoTable => The default functions won't work properly
{error,compilation_failed}
3>

The LLDP-MIB file is hosted on ieee802.org.

How should I deal with this?

Cheers,


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: snmpc: Compiling LLDP-MIB failled

Raimo Niskanen-2
There was a fix committed to the maint branch at Jan 12.  I do not know if
it is this problem it fixes; it allows refinements of enum usertypes.

See https://bugs.erlang.org/browse/ERL-325

It will be released in OTP-19.3 shortly.



On Thu, Mar 09, 2017 at 11:00:39AM +0800, fxmy wang wrote:

> Hi guys,
> So recently I’m toying with SNMP Development Toolkit and having trouble
> compiling standard LLDP-MIB. Errors shown below
>
> 2> snmpc:compile("LLDP-MIB.mib").
> LLDP-MIB.mib: 655: Cannot AUGMENT the non-existing table entry
> lldpLocManAddrEntry
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpPortConfigTable
> => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table
> lldpConfigManAddrTable => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpStatsTxPortTable
> => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpStatsRxPortTable
> => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpLocPortTable =>
> The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpLocManAddrTable
> => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpRemTable => The
> default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpRemManAddrTable
> => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table
> lldpRemUnknownTLVTable => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table
> lldpRemOrgDefInfoTable => The default functions won't work properly
> {error,compilation_failed}
> 3>
>
> The LLDP-MIB file is hosted on ieee802.org
> <http://www.ieee802.org/1/files/public/MIBs/LLDP-MIB-200505060000Z.txt>.
>
> How should I deal with this?
>
> Cheers,
> ​

> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions


--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: snmpc: Compiling LLDP-MIB failled

fxmy wang-2
In reply to this post by fxmy wang-2
Good to know that Raimo.
Thanks, I'm gonna wait for 19.3 and see what happens.
Cheers,

2017-03-09 17:01 GMT+08:00 Raimo Niskanen <[hidden email]>:
There was a fix committed to the maint branch at Jan 12.  I do not know if
it is this problem it fixes; it allows refinements of enum usertypes.

See https://bugs.erlang.org/browse/ERL-325

It will be released in OTP-19.3 shortly.



On Thu, Mar 09, 2017 at 11:00:39AM +0800, fxmy wang wrote:
> Hi guys,
> So recently I’m toying with SNMP Development Toolkit and having trouble
> compiling standard LLDP-MIB. Errors shown below
>
> 2> snmpc:compile("LLDP-MIB.mib").
> LLDP-MIB.mib: 655: Cannot AUGMENT the non-existing table entry
> lldpLocManAddrEntry
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpPortConfigTable
> => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table
> lldpConfigManAddrTable => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpStatsTxPortTable
> => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpStatsRxPortTable
> => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpLocPortTable =>
> The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpLocManAddrTable
> => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpRemTable => The
> default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpRemManAddrTable
> => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table
> lldpRemUnknownTLVTable => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table
> lldpRemOrgDefInfoTable => The default functions won't work properly
> {error,compilation_failed}
> 3>
>
> The LLDP-MIB file is hosted on ieee802.org
> <http://www.ieee802.org/1/files/public/MIBs/LLDP-MIB-200505060000Z.txt>.
>
> How should I deal with this?
>
> Cheers,
> ​

> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions


--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: snmpc: Compiling LLDP-MIB failled

fxmy wang-2

Hi guys,
I’ve checked out 7f52af8 and tried again but the compilation still fails. =(

I’v updated the mib-compiling log to gist in case anyone interested.

Hope this log holds some useful information for the SNMP experts.
Cheers,


2017-03-11 14:01 GMT+08:00 fxmy wang <[hidden email]>:
Hi guys,
  I've checked out [7f52af8](https://github.com/erlang/otp/tree/7f52af8875a1ab1ba96c6cb2403211bfc876639c) and tried again but the compilation still fails. =(
  Below attaches the log file when compiling LLDP-MIB (also uploaded to [gits](https://gist.github.com/fxmy/0c84243d387f972a725c68004cc02933)).
  Hope this log holds some useful information for the SNMP experts.
Cheers,

2017-03-09 21:28 GMT+08:00 fxmy wang <[hidden email]>:
Good to know that Raimo.
Thanks, I'm gonna wait for 19.3 and see what happens.
Cheers,

2017-03-09 17:01 GMT+08:00 Raimo Niskanen <[hidden email]>:
There was a fix committed to the maint branch at Jan 12.  I do not know if
it is this problem it fixes; it allows refinements of enum usertypes.

See https://bugs.erlang.org/browse/ERL-325

It will be released in OTP-19.3 shortly.



On Thu, Mar 09, 2017 at 11:00:39AM +0800, fxmy wang wrote:
> Hi guys,
> So recently I’m toying with SNMP Development Toolkit and having trouble
> compiling standard LLDP-MIB. Errors shown below
>
> 2> snmpc:compile("LLDP-MIB.mib").
> LLDP-MIB.mib: 655: Cannot AUGMENT the non-existing table entry
> lldpLocManAddrEntry
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpPortConfigTable
> => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table
> lldpConfigManAddrTable => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpStatsTxPortTable
> => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpStatsRxPortTable
> => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpLocPortTable =>
> The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpLocManAddrTable
> => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpRemTable => The
> default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpRemManAddrTable
> => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table
> lldpRemUnknownTLVTable => The default functions won't work properly
> [LLDP-MIB.mib][WAR]: No RowStatus column in table
> lldpRemOrgDefInfoTable => The default functions won't work properly
> {error,compilation_failed}
> 3>
>
> The LLDP-MIB file is hosted on ieee802.org
> <http://www.ieee802.org/1/files/public/MIBs/LLDP-MIB-200505060000Z.txt>.
>
> How should I deal with this?
>
> Cheers,
> ​

> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions


--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions




_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: snmpc: Compiling LLDP-MIB failled

Raimo Niskanen-2
Hello.

We have debugged your issue, and the problem seems to be that
lldpLocManAddrEntry is used before defined, so if you move lines 640
through 698 down to before line 1296 in LLDP-MIB the compilation succedes.

Now we are trying to figure out if that MIB is valid or not.



On Sat, Mar 11, 2017 at 05:23:07PM +0800, fxmy wang wrote:

> Hi guys,
> I’ve checked out 7f52af8
> <https://github.com/erlang/otp/tree/7f52af8875a1ab1ba96c6cb2403211bfc876639c>
> and tried again but the compilation still fails. =(
>
> I’v updated the mib-compiling log to gist
> <https://gist.github.com/fxmy/0c84243d387f972a725c68004cc02933> in case
> anyone interested.
>
> Hope this log holds some useful information for the SNMP experts.
> Cheers,
> ​
>
> 2017-03-11 14:01 GMT+08:00 fxmy wang <[hidden email]>:
>
> > Hi guys,
> >   I've checked out [7f52af8](https://github.com/erlang/otp/tree/
> > 7f52af8875a1ab1ba96c6cb2403211bfc876639c) and tried again but the
> > compilation still fails. =(
> >   Below attaches the log file when compiling LLDP-MIB (also uploaded to
> > [gits](https://gist.github.com/fxmy/0c84243d387f972a725c68004cc02933)).
> >   Hope this log holds some useful information for the SNMP experts.
> > Cheers,
> >
> > 2017-03-09 21:28 GMT+08:00 fxmy wang <[hidden email]>:
> >
> >> Good to know that Raimo.
> >> Thanks, I'm gonna wait for 19.3 and see what happens.
> >> Cheers,
> >>
> >> 2017-03-09 17:01 GMT+08:00 Raimo Niskanen <[hidden email]
> >> ricsson.se>:
> >>
> >>> There was a fix committed to the maint branch at Jan 12.  I do not know
> >>> if
> >>> it is this problem it fixes; it allows refinements of enum usertypes.
> >>>
> >>> See https://bugs.erlang.org/browse/ERL-325
> >>>
> >>> It will be released in OTP-19.3 shortly.
> >>>
> >>>
> >>>
> >>> On Thu, Mar 09, 2017 at 11:00:39AM +0800, fxmy wang wrote:
> >>> > Hi guys,
> >>> > So recently I’m toying with SNMP Development Toolkit and having trouble
> >>> > compiling standard LLDP-MIB. Errors shown below
> >>> >
> >>> > 2> snmpc:compile("LLDP-MIB.mib").
> >>> > LLDP-MIB.mib: 655: Cannot AUGMENT the non-existing table entry
> >>> > lldpLocManAddrEntry
> >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpPortConfigTable
> >>> > => The default functions won't work properly
> >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table
> >>> > lldpConfigManAddrTable => The default functions won't work properly
> >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpStatsTxPortTable
> >>> > => The default functions won't work properly
> >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpStatsRxPortTable
> >>> > => The default functions won't work properly
> >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpLocPortTable =>
> >>> > The default functions won't work properly
> >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpLocManAddrTable
> >>> > => The default functions won't work properly
> >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpRemTable => The
> >>> > default functions won't work properly
> >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpRemManAddrTable
> >>> > => The default functions won't work properly
> >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table
> >>> > lldpRemUnknownTLVTable => The default functions won't work properly
> >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table
> >>> > lldpRemOrgDefInfoTable => The default functions won't work properly
> >>> > {error,compilation_failed}
> >>> > 3>
> >>> >
> >>> > The LLDP-MIB file is hosted on ieee802.org
> >>> > <http://www.ieee802.org/1/files/public/MIBs/LLDP-MIB-200505060000Z.txt
> >>> >.
> >>> >
> >>> > How should I deal with this?
> >>> >
> >>> > Cheers,
> >>> > ​
> >>>
> >>> > _______________________________________________
> >>> > erlang-questions mailing list
> >>> > [hidden email]
> >>> > http://erlang.org/mailman/listinfo/erlang-questions
> >>>
> >>>
> >>> --
> >>>
> >>> / Raimo Niskanen, Erlang/OTP, Ericsson AB
> >>> _______________________________________________
> >>> erlang-questions mailing list
> >>> [hidden email]
> >>> http://erlang.org/mailman/listinfo/erlang-questions
> >>>
> >>
> >>
> >

> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions


--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: snmpc: Compiling LLDP-MIB failled

Raimo Niskanen-2
I have now tried with the 'smilint' tool and it does not find any errors,
so this is probably a legitimate way to write a MIB.

If so our MIB compiler needs to be rewritten to do two passes; one handling
anything not augmented, and one handling augmentation.

Please write a Jira ticket at bugs.erlang.org so we get a case to
prioritize, if the workaround below to restructure the LLDP-MIB is not good
enough for you...

Best regards
/ Raimo Niskanen, Erlang/OTP


On Mon, Mar 13, 2017 at 04:11:30PM +0100, Raimo Niskanen wrote:

> Hello.
>
> We have debugged your issue, and the problem seems to be that
> lldpLocManAddrEntry is used before defined, so if you move lines 640
> through 698 down to before line 1296 in LLDP-MIB the compilation succedes.
>
> Now we are trying to figure out if that MIB is valid or not.
>
>
>
> On Sat, Mar 11, 2017 at 05:23:07PM +0800, fxmy wang wrote:
> > Hi guys,
> > I’ve checked out 7f52af8
> > <https://github.com/erlang/otp/tree/7f52af8875a1ab1ba96c6cb2403211bfc876639c>
> > and tried again but the compilation still fails. =(
> >
> > I’v updated the mib-compiling log to gist
> > <https://gist.github.com/fxmy/0c84243d387f972a725c68004cc02933> in case
> > anyone interested.
> >
> > Hope this log holds some useful information for the SNMP experts.
> > Cheers,
> > ​
> >
> > 2017-03-11 14:01 GMT+08:00 fxmy wang <[hidden email]>:
> >
> > > Hi guys,
> > >   I've checked out [7f52af8](https://github.com/erlang/otp/tree/
> > > 7f52af8875a1ab1ba96c6cb2403211bfc876639c) and tried again but the
> > > compilation still fails. =(
> > >   Below attaches the log file when compiling LLDP-MIB (also uploaded to
> > > [gits](https://gist.github.com/fxmy/0c84243d387f972a725c68004cc02933)).
> > >   Hope this log holds some useful information for the SNMP experts.
> > > Cheers,
> > >
> > > 2017-03-09 21:28 GMT+08:00 fxmy wang <[hidden email]>:
> > >
> > >> Good to know that Raimo.
> > >> Thanks, I'm gonna wait for 19.3 and see what happens.
> > >> Cheers,
> > >>
> > >> 2017-03-09 17:01 GMT+08:00 Raimo Niskanen <[hidden email]
> > >> ricsson.se>:
> > >>
> > >>> There was a fix committed to the maint branch at Jan 12.  I do not know
> > >>> if
> > >>> it is this problem it fixes; it allows refinements of enum usertypes.
> > >>>
> > >>> See https://bugs.erlang.org/browse/ERL-325
> > >>>
> > >>> It will be released in OTP-19.3 shortly.
> > >>>
> > >>>
> > >>>
> > >>> On Thu, Mar 09, 2017 at 11:00:39AM +0800, fxmy wang wrote:
> > >>> > Hi guys,
> > >>> > So recently I’m toying with SNMP Development Toolkit and having trouble
> > >>> > compiling standard LLDP-MIB. Errors shown below
> > >>> >
> > >>> > 2> snmpc:compile("LLDP-MIB.mib").
> > >>> > LLDP-MIB.mib: 655: Cannot AUGMENT the non-existing table entry
> > >>> > lldpLocManAddrEntry
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpPortConfigTable
> > >>> > => The default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table
> > >>> > lldpConfigManAddrTable => The default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpStatsTxPortTable
> > >>> > => The default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpStatsRxPortTable
> > >>> > => The default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpLocPortTable =>
> > >>> > The default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpLocManAddrTable
> > >>> > => The default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpRemTable => The
> > >>> > default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpRemManAddrTable
> > >>> > => The default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table
> > >>> > lldpRemUnknownTLVTable => The default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table
> > >>> > lldpRemOrgDefInfoTable => The default functions won't work properly
> > >>> > {error,compilation_failed}
> > >>> > 3>
> > >>> >
> > >>> > The LLDP-MIB file is hosted on ieee802.org
> > >>> > <http://www.ieee802.org/1/files/public/MIBs/LLDP-MIB-200505060000Z.txt
> > >>> >.
> > >>> >
> > >>> > How should I deal with this?
> > >>> >
> > >>> > Cheers,
> > >>> > ​
> > >>>
> > >>> > _______________________________________________
> > >>> > erlang-questions mailing list
> > >>> > [hidden email]
> > >>> > http://erlang.org/mailman/listinfo/erlang-questions
> > >>>
> > >>>
> > >>> --
> > >>>
> > >>> / Raimo Niskanen, Erlang/OTP, Ericsson AB
> > >>> _______________________________________________
> > >>> erlang-questions mailing list
> > >>> [hidden email]
> > >>> http://erlang.org/mailman/listinfo/erlang-questions
> > >>>
> > >>
> > >>
> > >
>
> > _______________________________________________
> > erlang-questions mailing list
> > [hidden email]
> > http://erlang.org/mailman/listinfo/erlang-questions
>
>
> --
>
> / Raimo Niskanen, Erlang/OTP, Ericsson AB
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: snmpc: Compiling LLDP-MIB failled

fxmy wang-2
Nice to hear that Raimo.
I'll fire a bug then. =)

Cheers,

2017-03-14 22:53 GMT+08:00 Raimo Niskanen <[hidden email]>:
I have now tried with the 'smilint' tool and it does not find any errors,
so this is probably a legitimate way to write a MIB.

If so our MIB compiler needs to be rewritten to do two passes; one handling
anything not augmented, and one handling augmentation.

Please write a Jira ticket at bugs.erlang.org so we get a case to
prioritize, if the workaround below to restructure the LLDP-MIB is not good
enough for you...

Best regards
/ Raimo Niskanen, Erlang/OTP


On Mon, Mar 13, 2017 at 04:11:30PM +0100, Raimo Niskanen wrote:
> Hello.
>
> We have debugged your issue, and the problem seems to be that
> lldpLocManAddrEntry is used before defined, so if you move lines 640
> through 698 down to before line 1296 in LLDP-MIB the compilation succedes.
>
> Now we are trying to figure out if that MIB is valid or not.
>
>
>
> On Sat, Mar 11, 2017 at 05:23:07PM +0800, fxmy wang wrote:
> > Hi guys,
> > I’ve checked out 7f52af8
> > <https://github.com/erlang/otp/tree/7f52af8875a1ab1ba96c6cb2403211bfc876639c>
> > and tried again but the compilation still fails. =(
> >
> > I’v updated the mib-compiling log to gist
> > <https://gist.github.com/fxmy/0c84243d387f972a725c68004cc02933> in case
> > anyone interested.
> >
> > Hope this log holds some useful information for the SNMP experts.
> > Cheers,
> > ​
> >
> > 2017-03-11 14:01 GMT+08:00 fxmy wang <[hidden email]>:
> >
> > > Hi guys,
> > >   I've checked out [7f52af8](https://github.com/erlang/otp/tree/
> > > 7f52af8875a1ab1ba96c6cb2403211bfc876639c) and tried again but the
> > > compilation still fails. =(
> > >   Below attaches the log file when compiling LLDP-MIB (also uploaded to
> > > [gits](https://gist.github.com/fxmy/0c84243d387f972a725c68004cc02933)).
> > >   Hope this log holds some useful information for the SNMP experts.
> > > Cheers,
> > >
> > > 2017-03-09 21:28 GMT+08:00 fxmy wang <[hidden email]>:
> > >
> > >> Good to know that Raimo.
> > >> Thanks, I'm gonna wait for 19.3 and see what happens.
> > >> Cheers,
> > >>
> > >> 2017-03-09 17:01 GMT+08:00 Raimo Niskanen <[hidden email]
> > >> ricsson.se>:
> > >>
> > >>> There was a fix committed to the maint branch at Jan 12.  I do not know
> > >>> if
> > >>> it is this problem it fixes; it allows refinements of enum usertypes.
> > >>>
> > >>> See https://bugs.erlang.org/browse/ERL-325
> > >>>
> > >>> It will be released in OTP-19.3 shortly.
> > >>>
> > >>>
> > >>>
> > >>> On Thu, Mar 09, 2017 at 11:00:39AM +0800, fxmy wang wrote:
> > >>> > Hi guys,
> > >>> > So recently I’m toying with SNMP Development Toolkit and having trouble
> > >>> > compiling standard LLDP-MIB. Errors shown below
> > >>> >
> > >>> > 2> snmpc:compile("LLDP-MIB.mib").
> > >>> > LLDP-MIB.mib: 655: Cannot AUGMENT the non-existing table entry
> > >>> > lldpLocManAddrEntry
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpPortConfigTable
> > >>> > => The default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table
> > >>> > lldpConfigManAddrTable => The default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpStatsTxPortTable
> > >>> > => The default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpStatsRxPortTable
> > >>> > => The default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpLocPortTable =>
> > >>> > The default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpLocManAddrTable
> > >>> > => The default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpRemTable => The
> > >>> > default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table lldpRemManAddrTable
> > >>> > => The default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table
> > >>> > lldpRemUnknownTLVTable => The default functions won't work properly
> > >>> > [LLDP-MIB.mib][WAR]: No RowStatus column in table
> > >>> > lldpRemOrgDefInfoTable => The default functions won't work properly
> > >>> > {error,compilation_failed}
> > >>> > 3>
> > >>> >
> > >>> > The LLDP-MIB file is hosted on ieee802.org
> > >>> > <http://www.ieee802.org/1/files/public/MIBs/LLDP-MIB-200505060000Z.txt
> > >>> >.
> > >>> >
> > >>> > How should I deal with this?
> > >>> >
> > >>> > Cheers,
> > >>> > ​
> > >>>
> > >>> > _______________________________________________
> > >>> > erlang-questions mailing list
> > >>> > [hidden email]
> > >>> > http://erlang.org/mailman/listinfo/erlang-questions
> > >>>
> > >>>
> > >>> --
> > >>>
> > >>> / Raimo Niskanen, Erlang/OTP, Ericsson AB
> > >>> _______________________________________________
> > >>> erlang-questions mailing list
> > >>> [hidden email]
> > >>> http://erlang.org/mailman/listinfo/erlang-questions
> > >>>
> > >>
> > >>
> > >
>
> > _______________________________________________
> > erlang-questions mailing list
> > [hidden email]
> > http://erlang.org/mailman/listinfo/erlang-questions
>
>
> --
>
> / Raimo Niskanen, Erlang/OTP, Ericsson AB
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: snmpc: Compiling LLDP-MIB failled

Martin Bjorklund
Hi,

fxmy wang <[hidden email]> wrote:
> 2017-03-14 22:53 GMT+08:00 Raimo Niskanen <
> [hidden email]>:
>
> > I have now tried with the 'smilint' tool and it does not find any errors,
> > so this is probably a legitimate way to write a MIB.
> >
> > If so our MIB compiler needs to be rewritten to do two passes; one handling
> > anything not augmented, and one handling augmentation.

We have a fix for this bug in our (forked) snmp implementation.  A
patch is included if you're interested.  The idea is that the
definitions are sorted so that any augment ends up after the augment
target; then the processing can be left as-is.

Unfortunately the code is not 100% correct; specifically it puts the
definition after the MODULE-COMPLIANCE so the compiler later complains
that the compliance reference is invalid (which is not correct (but it
works for us)).

In order to be really correct, the code needs to be completely
order-independent...


/martin

diff --git lib/snmp/src/compile/snmpc.erl lib/snmp/src/compile/snmpc.erl
index db1f9ee..d5041b9 100644
--- lib/snmp/src/compile/snmpc.erl
+++ lib/snmp/src/compile/snmpc.erl
@@ -449,9 +449,88 @@ compile_parsed_data(#pdata{mib_name = MibName,
     RelChk = get_relaxed_row_name_assign_check(Opts),
     Data = #dldata{deprecated                    = Deprecated,
    relaxed_row_name_assign_check = RelChk},
-    definitions_loop(Definitions, Data),
+    definitions_loop(sort_defs(Definitions, []), Data),
     MibName.
 
+sort_defs([{#mc_object_type{name = NameOfTable,
+                            syntax = {{sequence_of,SeqName},_}}, _} = H | T],
+          Acc) ->
+    case search2(#mc_object_type.name_assign, {NameOfTable, [1]}, T, Acc) of
+        not_found ->
+            sort_defs(T, [H | Acc]);
+        {TableEntry, T1, Acc1} ->
+            case search2(#mc_sequence.name, SeqName, T1, Acc1) of
+                not_found ->
+                    sort_defs(T, [H | Acc]);
+                {Sequence, T2, Acc2} ->
+                    {#mc_object_type{name = NameOfEntry, kind = Kind}, _} =
+                        TableEntry,
+                    {Cols, T3, Acc3} = get_cols(NameOfEntry, T2, Acc2),
+                    case Kind of
+                        {table_entry, {augments, BaseEntry}} ->
+                            case
+                                search1(#mc_object_type.name, BaseEntry, T, [])
+                            of
+                                not_found ->
+                                    %% augmented table not defined after us; ok
+                                    sort_defs(T3, Cols ++
+                                              [Sequence, TableEntry, H | Acc3]);
+                                _ ->
+                                    %% move ourselvs after the base
+                                    %% NOTE: this does not detect AUGMENT loops
+                                    sort_defs(T3 ++ [H, TableEntry, Sequence] ++
+                                              Cols, Acc3)
+                            end;
+                        _ ->
+                            sort_defs(T3, Cols ++
+                                      [Sequence, TableEntry, H | Acc3])
+                    end
+            end
+    end;
+sort_defs([H | T], Acc) ->
+    sort_defs(T, [H | Acc]);
+sort_defs([], Acc) ->
+    lists:reverse(Acc).
+
+search2(Index, Val, L1, L2) ->
+    case search1(Index, Val, L1, []) of
+        not_found ->
+            case search1(Index, Val, L2, []) of
+                not_found ->
+                    not_found;
+                {Res2, NewL2} ->
+                    {Res2, L1, NewL2}
+            end;
+        {Res1, NewL1} ->
+            {Res1, NewL1, L2}
+    end.
+
+search1(Index, Val, [{H, Line} | T], Acc) when element(Index, H) == Val ->
+    {{H, Line}, lists:reverse(Acc) ++ T};
+search1(Index, Val, [H | T], Acc) ->
+    search1(Index, Val, T, [H | Acc]);
+search1(_, _, [], _) ->
+    not_found.
+
+get_cols(NameOfEntry, L1, L2) ->
+    {Cols1, NewL1} = get_cols2(L1, NameOfEntry, [], []),
+    {Cols2, NewL2} = get_cols2(L2, NameOfEntry, Cols1, []),
+    {Cols2, NewL1, NewL2}.
+
+get_cols2([{#mc_object_type{name_assign = {NameOfEntry, [Idx]}}, _} = H | T],
+          NameOfEntry, Cols, Acc) ->
+    get_cols2(T, NameOfEntry, add_col(Idx, H, Cols), Acc);
+get_cols2([H | T], NameOfEntry, Cols, Acc) ->
+    get_cols2(T, NameOfEntry, Cols, [H | Acc]);
+get_cols2([], _, Cols, Acc) ->
+    {Cols, lists:reverse(Acc)}.
+
+add_col(Idx, X, [{#mc_object_type{name_assign = {_, [N]}}, _} = H | T])
+  when N > Idx ->
+    [H | add_col(Idx, X, T)];
+add_col(_Idx, X, Cols) ->
+    [X | Cols].
+
 update_imports(Imports) ->
     case lists:member(imports, get(options)) of
  true ->

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: snmpc: Compiling LLDP-MIB failled

fxmy wang-2

That was indeed fast Martin. =)
For now I could live with restructuring LLDP-MIB though.

And bug reported here: ERL-375.

Cheers,


2017-03-15 18:06 GMT+08:00 Martin Bjorklund <[hidden email]>:
Hi,

fxmy wang <[hidden email]> wrote:
> 2017-03-14 22:53 GMT+08:00 Raimo Niskanen <
> [hidden email]>:
>
> > I have now tried with the 'smilint' tool and it does not find any errors,
> > so this is probably a legitimate way to write a MIB.
> >
> > If so our MIB compiler needs to be rewritten to do two passes; one handling
> > anything not augmented, and one handling augmentation.

We have a fix for this bug in our (forked) snmp implementation.  A
patch is included if you're interested.  The idea is that the
definitions are sorted so that any augment ends up after the augment
target; then the processing can be left as-is.

Unfortunately the code is not 100% correct; specifically it puts the
definition after the MODULE-COMPLIANCE so the compiler later complains
that the compliance reference is invalid (which is not correct (but it
works for us)).

In order to be really correct, the code needs to be completely
order-independent...


/martin


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Loading...