Erlang/OTP Forums

Author Message

<  Erlang patches mailing list  ~  snmp_compile_lib.erl patch

luke at bluetail.com
Posted: Tue Jan 13, 2004 1:39 pm Reply with quote
Guest
Ahoy,

This patch lets the SNMP compiler handle MIBs with no object
definitions. I had to process a MIB with only textual conventions.

Index: snmp_compile_lib.erl
===================================================================
RCS file: /home/share/erlang/cvsroot/otp/lib/snmp/src/snmp_compile_lib.erl,v
retrieving revision 1.5
diff -u -u -r1.5 snmp_compile_lib.erl
--- snmp_compile_lib.erl 3 Sep 2003 13:54:14 -0000 1.5
+++ snmp_compile_lib.erl 7 Jan 2004 15:04:39 -0000
_at__at_ -1475,8 +1475,13 _at__at_


resolve_oids(OidEts) ->
- [{_, _, _, _, RootChildren}] = ets:lookup(OidEts, root),
- resolve_oids(RootChildren, [], OidEts).
+ case ets:lookup(OidEts, root) of
+ [{_, _, _, _, RootChildren}] ->
+ resolve_oids(RootChildren, [], OidEts);
+ [] ->
+ %% No OIDs registered
+ ok
+ end.

resolve_oids([Name | T], FatherOid, OidEts) ->
{MyOid, MyChildren, MyLine} =



Post generated using Mail2Forum (http://m2f.sourceforge.net)

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum