Logo
Home page Net-SNMP

Archive Search:

Require all words?

Site Search:
Google
mib_modules.h File Reference
Main Page   Data Structures   File List   Data Fields   Globals  

mib_modules.h File Reference

Go to the source code of this file.


Data Structures

struct  module_init_list

Defines

#define DO_INITIALIZE   1
#define DONT_INITIALIZE   0

Functions

void add_to_init_list (const char *module_list)
int should_init (const char *module_name)
void init_mib_modules (void)

Define Documentation

#define DONT_INITIALIZE   0
 

Definition at line 2 of file mib_modules.h.

#define DO_INITIALIZE   1
 

Definition at line 1 of file mib_modules.h.


Function Documentation

void add_to_init_list const char *    module_list
 

Definition at line 77 of file mib_modules.c.

Referenced by main().

00077                                           {
00078     struct module_init_list *newitem, **list;
00079     char *cp;
00080 
00081     if (module_list == NULL) {
00082       return;
00083     } else {
00084       cp = (char *)module_list;
00085     }
00086 
00087     if (*cp == '-' || *cp == '!') {
00088         cp++;
00089         list = &noinitlist;
00090     } else {
00091         list = &initlist;
00092     }
00093 
00094     cp = strtok(cp, ", :");
00095     while(cp) {
00096         newitem = (struct module_init_list *)calloc(1, sizeof (*initlist));
00097         newitem->module_name = strdup(cp);
00098         newitem->next = *list;
00099         *list = newitem;
00100         cp = strtok(NULL, ", :");
00101     }
00102 }

void init_mib_modules void   
 

Definition at line 140 of file mib_modules.c.

00140                        {
00141 #  include "mib_module_inits.h"
00142 }

int should_init const char *    module_name
 

Definition at line 105 of file mib_modules.c.

00105                                      {
00106     struct module_init_list *listp;
00107     
00108     /* a definitive list takes priority */
00109     if (initlist) {
00110         listp = initlist;
00111         while (listp) {
00112             if (strcmp(listp->module_name, module_name) == 0) {
00113                 DEBUGMSGTL(("mib_init","initializing: %s\n",module_name));
00114                 return DO_INITIALIZE;
00115             }
00116             listp = listp->next;
00117         }
00118         DEBUGMSGTL(("mib_init","skipping:     %s\n",module_name));
00119         return DONT_INITIALIZE;
00120     }
00121 
00122     /* initialize it only if not on the bad list (bad module, no bone) */
00123     if (noinitlist) {
00124         listp = noinitlist;
00125         while (listp) {
00126             if (strcmp(listp->module_name, module_name) == 0) {
00127                 DEBUGMSGTL(("mib_init","skipping:     %s\n",module_name));
00128                 return DONT_INITIALIZE;
00129             }
00130             listp = listp->next;
00131         }
00132     }
00133     DEBUGMSGTL(("mib_init","initializing: %s\n",module_name));
00134     
00135     /* initialize it */
00136     return DO_INITIALIZE;
00137 }

Generated on Sat Nov 10 14:09:55 2001 for net-snmp by doxygen1.2.11 written by Dimitri van Heesch, © 1997-2001
[an error occurred while processing this directive] [an error occurred while processing this directive]

Valid CSS!


Last modified: Wednesday, 01-Aug-2018 04:41:28 UTC
For questions regarding web content and site functionality, please write to the net-snmp-users mail list.