net-snmp 5.7
example.h
00001 /*
00002  *  Template MIB group interface - example.h
00003  *
00004  */
00005 
00006 /*
00007  * Don't include ourselves twice 
00008  */
00009 #ifndef _MIBGROUP_EXAMPLE_H
00010 #define _MIBGROUP_EXAMPLE_H
00011 
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif
00015 
00016     /*
00017      * We use 'header_generic' from the util_funcs/header_generic module,
00018      *  so make sure this module is included in the agent.
00019      */
00020 config_require(util_funcs/header_generic)
00021 
00022 
00023     /*
00024      * Declare our publically-visible functions.
00025      * Typically, these will include the initialization and shutdown functions,
00026      *  the main request callback routine and any writeable object methods.
00027      *
00028      * Function prototypes are provided for the callback routine ('FindVarMethod')
00029      *  and writeable object methods ('WriteMethod').
00030      */
00031      void     init_example(void);
00032      FindVarMethod var_example;
00033      WriteMethod write_exampleint;
00034      WriteMethod write_exampletrap;
00035      WriteMethod write_exampletrap2;
00036 
00037 
00038     /*
00039      * Magic number definitions.
00040      * These must be unique for each object implemented within a
00041      *  single mib module callback routine.
00042      *
00043      * Typically, these will be the last OID sub-component for
00044      *  each entry, or integers incrementing from 1.
00045      *  (which may well result in the same values anyway).
00046      *
00047      * Here, the second and third objects are form a 'sub-table' and
00048      *   the magic numbers are chosen to match these OID sub-components.
00049      * This is purely for programmer convenience.
00050      * All that really matters is that the numbers are unique.
00051      */
00052 
00053 #define EXAMPLESTRING           1
00054 #define EXAMPLEINTEGER          21
00055 #define EXAMPLEOBJECTID         22
00056 #define EXAMPLETIMETICKS        3
00057 #define EXAMPLEIPADDRESS        4
00058 #define EXAMPLECOUNTER          5
00059 #define EXAMPLEGAUGE            6
00060 #define EXAMPLETRIGGERTRAP      7
00061 #define EXAMPLETRIGGERTRAP2     8
00062 
00063 #ifdef __cplusplus
00064 }
00065 #endif
00066 
00067 #endif                          /* _MIBGROUP_EXAMPLE_H */