net-snmp 5.7
instance.h
00001 /*
00002  * instance.h 
00003  */
00004 #ifndef NETSNMP_INSTANCE_H
00005 #define NETSNMP_INSTANCE_H
00006 
00007 #ifdef __cplusplus
00008 extern "C" {
00009 #endif
00010 
00011 /*
00012  * The instance helper is designed to simplify the task of adding simple
00013  * * instances to the mib tree.
00014  */
00015 
00016 /*
00017  * GETNEXTs are auto-converted to a GET.
00018  * * non-valid GETs are dropped.
00019  * * The client can assume that if you're called for a GET, it shouldn't
00020  * * have to check the oid at all.  Just answer.
00021  */
00022 
00023 int
00024 netsnmp_register_instance(netsnmp_handler_registration * reginfo);
00025 
00026 int            
00027 netsnmp_register_read_only_instance(netsnmp_handler_registration *reginfo);
00028 
00029 #define INSTANCE_HANDLER_NAME "instance"
00030 
00031 netsnmp_mib_handler *netsnmp_get_instance_handler(void);
00032 
00033 int
00034 netsnmp_register_read_only_ulong_instance(const char * name,
00035                                           const oid * reg_oid,
00036                                           size_t reg_oid_len,
00037                                           u_long * it,
00038                                           Netsnmp_Node_Handler * subhandler);
00039 int
00040 netsnmp_register_ulong_instance(const char * name,
00041                                 const oid * reg_oid,
00042                                 size_t reg_oid_len,
00043                                 u_long * it,
00044                                 Netsnmp_Node_Handler * subhandler);
00045 int
00046 netsnmp_register_read_only_counter32_instance(const char *name,
00047                                               const oid * reg_oid,
00048                                               size_t reg_oid_len,
00049                                               u_long * it,
00050                                               Netsnmp_Node_Handler *subhandler);
00051 int
00052 netsnmp_register_read_only_long_instance(const char *name,
00053                                          const oid * reg_oid,
00054                                          size_t reg_oid_len,
00055                                          long *it,
00056                                          Netsnmp_Node_Handler * subhandler);
00057 int
00058 netsnmp_register_long_instance(const char *name,
00059                                const oid * reg_oid,
00060                                size_t reg_oid_len,
00061                                long *it,
00062                                Netsnmp_Node_Handler * subhandler);
00063 
00064 int
00065 netsnmp_register_read_only_int_instance(const char *name,
00066                                         const oid * reg_oid,
00067                                         size_t reg_oid_len, int *it,
00068                                         Netsnmp_Node_Handler * subhandler);
00069 
00070 int
00071 netsnmp_register_int_instance(const char *name,
00072                               const oid * reg_oid,
00073                               size_t reg_oid_len, int *it,
00074                               Netsnmp_Node_Handler * subhandler);
00075 
00076 /* identical functions that register a in a particular context */
00077 int
00078 netsnmp_register_read_only_ulong_instance_context(const char *name,
00079                                                   const oid * reg_oid,
00080                                                   size_t reg_oid_len,
00081                                                   u_long * it,
00082                                                   Netsnmp_Node_Handler
00083                                                   * subhandler,
00084                                                   const char *contextName);
00085 int
00086 netsnmp_register_ulong_instance_context(const char *name,
00087                                         const oid * reg_oid,
00088                                         size_t reg_oid_len,
00089                                         u_long * it,
00090                                         Netsnmp_Node_Handler * subhandler,
00091                                         const char *contextName);
00092 int
00093 netsnmp_register_read_only_counter32_instance_context(const char *name,
00094                                                       const oid * reg_oid,
00095                                                       size_t reg_oid_len,
00096                                                       u_long * it,
00097                                                       Netsnmp_Node_Handler
00098                                                       * subhandler,
00099                                                       const char *contextName);
00100 int
00101 netsnmp_register_read_only_long_instance_context(const char *name,
00102                                                  const oid * reg_oid,
00103                                                  size_t reg_oid_len,
00104                                                  long *it,
00105                                                  Netsnmp_Node_Handler
00106                                                  * subhandler,
00107                                                  const char *contextName);
00108 int
00109 netsnmp_register_long_instance_context(const char *name,
00110                                        const oid * reg_oid,
00111                                        size_t reg_oid_len,
00112                                        long *it,
00113                                        Netsnmp_Node_Handler * subhandler,
00114                                        const char *contextName);
00115 
00116 int
00117 netsnmp_register_read_only_int_instance_context(const char *name,
00118                                                 const oid * reg_oid,
00119                                                 size_t reg_oid_len, int *it,
00120                                                 Netsnmp_Node_Handler *
00121                                                 subhandler,
00122                                                 const char *contextName);
00123 
00124 int
00125 netsnmp_register_int_instance_context(const char *name,
00126                                       const oid * reg_oid,
00127                                       size_t reg_oid_len, int *it,
00128                                       Netsnmp_Node_Handler * subhandler,
00129                                       const char *contextName);
00130 
00131 int
00132 netsnmp_register_num_file_instance(const char *name,
00133                                    const oid * reg_oid, size_t reg_oid_len,
00134                                    const char *file_name, int asn_type, int mode,
00135                                    Netsnmp_Node_Handler * subhandler,
00136                                    const char *contextName);
00137 
00138 Netsnmp_Node_Handler netsnmp_instance_helper_handler;
00139 Netsnmp_Node_Handler netsnmp_instance_num_file_handler;
00140 
00141 #ifdef __cplusplus
00142 }
00143 #endif
00144 
00145 #endif