On Thu, 19 Aug 2004 23:52:18 +0200 Magnus wrote:
MF> I have no registrations for
MF> type:agentx:snmpd,file:/tmp/snmp-test-1-22664/snmpd.conf
MF> 
MF> which I read as to mean that there are no handlers for "agentx:snmpd" so it
MF> seems as if the use of multiple config reader classes is somewhat broken.

I'll leave the real fix for Dave, but this should get you going til then:

Index: snmplib/read_config.c
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/snmplib/read_config.c,v
retrieving revision 5.24
diff -u -r5.24 read_config.c
--- snmplib/read_config.c       17 Aug 2004 09:08:54 -0000      5.24
+++ snmplib/read_config.c       21 Aug 2004 02:29:16 -0000
@@ -449,6 +449,34 @@
                     type, filename));
 }
 
+void
+read_config_with_types(const char *filename, const char *types)
+{
+    if (NULL != strchr(types, ':')) {
+        char *delim;
+        char *type_list;
+
+        type_list = strdup(types);
+        if (NULL == type_list) {
+            snmp_log(LOG_ERR,"malloc failed\n");
+            return;
+        }
+
+        while(type_list) {
+            delim = strchr(type_list, ':');
+            if (NULL != delim)
+                *delim = '\0';
+
+            read_config_with_type(filename, type_list);
+            if (NULL == delim)
+                break;
+
+            type_list = ++delim;
+        }
+    } else {
+        read_config_with_type(filename, types);
+    }
+}
 
 struct config_line *
 read_config_find_handler(struct config_line *line_handlers,
@@ -838,7 +866,7 @@
             DEBUGMSGTL(("read_config",
                         "Reading optional config file: \"%s\"\n",
                         cp));
-            read_config_with_type(cp, type);
+            read_config_with_types(cp, type);
         }
         cp = strtok(NULL, ",");
       }

-- 
Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/>
<irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to