2 * wrapper to call all the mib module initialization functions
5 #include <net-snmp/agent/mib_module_config.h>
6 #include <net-snmp/net-snmp-config.h>
18 #include <sys/types.h>
19 #if TIME_WITH_SYS_TIME
21 # include <sys/timeb.h>
23 # include <sys/time.h>
28 # include <sys/time.h>
34 #include <netinet/in.h>
44 #include <net-snmp/net-snmp-includes.h>
45 #include <net-snmp/agent/net-snmp-agent-includes.h>
48 #include "mibgroup/struct.h"
49 #include <net-snmp/agent/mib_modules.h>
50 #include <net-snmp/agent/table.h>
51 #include <net-snmp/agent/table_iterator.h>
52 #include "mib_module_includes.h"
53 #ifdef USING_AGENTX_SUBAGENT_MODULE
54 #include "mibgroup/agentx/subagent.h"
57 struct module_init_list
*initlist
= NULL
;
58 struct module_init_list
*noinitlist
= NULL
;
62 add_to_init_list(char *module_list
)
64 struct module_init_list
*newitem
, **list
;
67 if (module_list
== NULL
) {
70 cp
= (char *) module_list
;
73 if (*cp
== '-' || *cp
== '!') {
80 cp
= strtok(cp
, ", :");
82 newitem
= (struct module_init_list
*) calloc(1, sizeof(*initlist
));
83 newitem
->module_name
= strdup(cp
);
84 newitem
->next
= *list
;
86 cp
= strtok(NULL
, ", :");
91 should_init(const char *module_name
)
93 struct module_init_list
*listp
;
96 * a definitive list takes priority
101 if (strcmp(listp
->module_name
, module_name
) == 0) {
102 DEBUGMSGTL(("mib_init", "initializing: %s\n",
104 return DO_INITIALIZE
;
108 DEBUGMSGTL(("mib_init", "skipping: %s\n", module_name
));
109 return DONT_INITIALIZE
;
113 * initialize it only if not on the bad list (bad module, no bone)
118 if (strcmp(listp
->module_name
, module_name
) == 0) {
119 DEBUGMSGTL(("mib_init", "skipping: %s\n",
121 return DONT_INITIALIZE
;
126 DEBUGMSGTL(("mib_init", "initializing: %s\n", module_name
));
131 return DO_INITIALIZE
;
135 init_mib_modules(void)
137 # include "mib_module_inits.h"