instance.h
上传用户:wxp200602
上传日期:2007-10-30
资源大小:4028k
文件大小:8k
源码类别:

SNMP编程

开发平台:

Unix_Linux

  1. /*
  2.  * testhandler.h 
  3.  */
  4. #ifndef NETSNMP_INSTANCE_H
  5. #define NETSNMP_INSTANCE_H
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. /*
  10.  * The instance helper is designed to simplify the task of adding simple
  11.  * * instances to the mib tree.
  12.  */
  13. /*
  14.  * GETNEXTs are auto-converted to a GET.
  15.  * * non-valid GETs are dropped.
  16.  * * The client can assume that if you're called for a GET, it shouldn't
  17.  * * have to check the oid at all.  Just answer.
  18.  */
  19. int             netsnmp_register_instance(netsnmp_handler_registration
  20.                                           *reginfo);
  21. int            
  22. netsnmp_register_read_only_instance(netsnmp_handler_registration *reginfo);
  23. #define INSTANCE_HANDLER_NAME "instance"
  24. netsnmp_mib_handler *netsnmp_get_instance_handler(void);
  25. int             netsnmp_register_read_only_ulong_instance(const char *name,
  26.                                                           oid * reg_oid,
  27.                                                           size_t
  28.                                                           reg_oid_len,
  29.                                                           u_long * it,
  30.                                                           Netsnmp_Node_Handler
  31.                                                           * subhandler);
  32. int             netsnmp_register_ulong_instance(const char *name,
  33.                                                 oid * reg_oid,
  34.                                                 size_t reg_oid_len,
  35.                                                 u_long * it,
  36.                                                 Netsnmp_Node_Handler *
  37.                                                 subhandler);
  38. int             netsnmp_register_read_only_counter32_instance(const char
  39.                                                               *name,
  40.                                                               oid *
  41.                                                               reg_oid,
  42.                                                               size_t
  43.                                                               reg_oid_len,
  44.                                                               u_long * it,
  45.                                                               Netsnmp_Node_Handler
  46.                                                               *
  47.                                                               subhandler);
  48. int             netsnmp_register_read_only_long_instance(const char *name,
  49.                                                          oid * reg_oid,
  50.                                                          size_t
  51.                                                          reg_oid_len,
  52.                                                          long *it,
  53.                                                          Netsnmp_Node_Handler
  54.                                                          * subhandler);
  55. int             netsnmp_register_long_instance(const char *name,
  56.                                                oid * reg_oid,
  57.                                                size_t reg_oid_len,
  58.                                                long *it,
  59.                                                Netsnmp_Node_Handler *
  60.                                                subhandler);
  61. int             netsnmp_register_read_only_int_instance(const char *name,
  62.                                               oid * reg_oid,
  63.                                               size_t reg_oid_len, int *it,
  64.                                               Netsnmp_Node_Handler *
  65.                                               subhandler);
  66. int             netsnmp_register_int_instance(const char *name,
  67.                                               oid * reg_oid,
  68.                                               size_t reg_oid_len, int *it,
  69.                                               Netsnmp_Node_Handler *
  70.                                               subhandler);
  71. /* identical functions that register a in a particular context */
  72. int  netsnmp_register_read_only_ulong_instance_context(const char *name,
  73.                                                        oid * reg_oid,
  74.                                                        size_t
  75.                                                        reg_oid_len,
  76.                                                        u_long * it,
  77.                                                        Netsnmp_Node_Handler
  78.                                                        * subhandler,
  79.                                                        const char *contextName);
  80. int  netsnmp_register_ulong_instance_context(const char *name,
  81.                                              oid * reg_oid,
  82.                                              size_t reg_oid_len,
  83.                                              u_long * it,
  84.                                              Netsnmp_Node_Handler *
  85.                                              subhandler,
  86.                                              const char *contextName);
  87. int  netsnmp_register_read_only_counter32_instance_context(const char
  88.                                                            *name,
  89.                                                            oid *
  90.                                                            reg_oid,
  91.                                                            size_t
  92.                                                            reg_oid_len,
  93.                                                            u_long * it,
  94.                                                            Netsnmp_Node_Handler
  95.                                                            *
  96.                                                            subhandler,
  97.                                                            const char *contextName);
  98. int  netsnmp_register_read_only_long_instance_context(const char *name,
  99.                                                       oid * reg_oid,
  100.                                                       size_t
  101.                                                       reg_oid_len,
  102.                                                       long *it,
  103.                                                       Netsnmp_Node_Handler
  104.                                                       * subhandler,
  105.                                                       const char *contextName);
  106. int  netsnmp_register_long_instance_context(const char *name,
  107.                                             oid * reg_oid,
  108.                                             size_t reg_oid_len,
  109.                                             long *it,
  110.                                             Netsnmp_Node_Handler *
  111.                                             subhandler,
  112.                                             const char *contextName);
  113. int  netsnmp_register_read_only_int_instance_context(const char *name,
  114.                                                      oid * reg_oid,
  115.                                                      size_t reg_oid_len, int *it,
  116.                                                      Netsnmp_Node_Handler *
  117.                                                      subhandler,
  118.                                                      const char *contextName);
  119. int  netsnmp_register_int_instance_context(const char *name,
  120.                                            oid * reg_oid,
  121.                                            size_t reg_oid_len, int *it,
  122.                                            Netsnmp_Node_Handler *
  123.                                            subhandler,
  124.                                            const char *contextName);
  125. Netsnmp_Node_Handler netsnmp_instance_helper_handler;
  126. Netsnmp_Node_Handler netsnmp_instance_ulong_handler;
  127. Netsnmp_Node_Handler netsnmp_instance_long_handler;
  128. Netsnmp_Node_Handler netsnmp_instance_int_handler;
  129. Netsnmp_Node_Handler netsnmp_instance_counter32_handler;
  130. #ifdef __cplusplus
  131. }
  132. #endif
  133. #endif /** NETSNMP_INSTANCE_H */