net-snmp 5.7
baby_steps.h
00001 /*
00002  * $Id$
00003  */
00004 #ifndef BABY_STEPS_H
00005 #define BABY_STEPS_H
00006 
00007 #ifdef __cplusplus
00008 extern          "C" {
00009 #endif
00010 
00011 #include <net-snmp/agent/agent_handler.h>
00012 
00013     /*
00014      * Flags for baby step modes
00015      */
00016 #define BABY_STEP_NONE                  0
00017 #define BABY_STEP_PRE_REQUEST           (0x1 <<  1)
00018 #define BABY_STEP_OBJECT_LOOKUP         (0x1 <<  2)
00019 #ifndef NETSNMP_NO_WRITE_SUPPORT
00020 #define BABY_STEP_CHECK_VALUE           (0x1 <<  3)
00021 #define BABY_STEP_ROW_CREATE            (0x1 <<  4)
00022 #define BABY_STEP_UNDO_SETUP            (0x1 <<  5)
00023 #define BABY_STEP_SET_VALUE             (0x1 <<  6)
00024 #define BABY_STEP_CHECK_CONSISTENCY     (0x1 <<  7)
00025 #define BABY_STEP_UNDO_SET              (0x1 <<  8)
00026 #define BABY_STEP_COMMIT                (0x1 <<  9)
00027 #define BABY_STEP_UNDO_COMMIT           (0x1 << 10)
00028 #define BABY_STEP_IRREVERSIBLE_COMMIT   (0x1 << 11)
00029 #define BABY_STEP_UNDO_CLEANUP          (0x1 << 12)
00030 #endif /* NETSNMP_NO_WRITE_SUPPORT */
00031 #define BABY_STEP_POST_REQUEST          (0x1 << 13)
00032 
00033 #define BABY_STEP_ALL                   (0xffffffff)
00034 
00035 
00036 #ifndef NETSNMP_NO_WRITE_SUPPORT
00037 #define BABY_STEP_CHECK_OBJECT          BABY_STEP_CHECK_VALUE
00038 #define BABY_STEP_SET_VALUES            BABY_STEP_SET_VALUE
00039 #define BABY_STEP_UNDO_SETS             BABY_STEP_UNDO_SET
00040 #endif /* NETSNMP_NO_WRITE_SUPPORT */
00041 
00049     typedef struct netsnmp_baby_steps_modes_s {
00051        int         refcnt;
00052        u_int       registered;
00053        u_int       completed;
00054     } netsnmp_baby_steps_modes;
00055 
00056 void                 netsnmp_baby_steps_init(void);
00057 
00058 netsnmp_mib_handler *netsnmp_baby_steps_handler_get(u_long modes);
00059 
00075 typedef struct netsnmp_baby_steps_access_methods_s {
00076       
00077    /*
00078     * baby step modes
00079     */
00080    Netsnmp_Node_Handler *pre_request;
00081    Netsnmp_Node_Handler *object_lookup;
00082    Netsnmp_Node_Handler *get_values;
00083 #ifndef NETSNMP_NO_WRITE_SUPPORT
00084    Netsnmp_Node_Handler *object_syntax_checks;
00085    Netsnmp_Node_Handler *row_creation;
00086    Netsnmp_Node_Handler *undo_setup;
00087    Netsnmp_Node_Handler *set_values;
00088    Netsnmp_Node_Handler *consistency_checks;
00089    Netsnmp_Node_Handler *commit;
00090    Netsnmp_Node_Handler *undo_sets;
00091    Netsnmp_Node_Handler *undo_cleanup;
00092    Netsnmp_Node_Handler *undo_commit;
00093    Netsnmp_Node_Handler *irreversible_commit;
00094 #endif /* NETSNMP_NO_WRITE_SUPPORT */
00095    Netsnmp_Node_Handler *post_request;
00096 
00097    void                 *my_access_void;
00098 
00099 } netsnmp_baby_steps_access_methods;
00100 
00101     netsnmp_mib_handler * netsnmp_baby_steps_access_multiplexer_get(
00102         netsnmp_baby_steps_access_methods *);
00103 
00104     int netsnmp_baby_step_mode2flag( u_int mode );
00105 
00110 #define netsnmp_get_baby_steps_handler netsnmp_baby_steps_handler_get
00111 #define netsnmp_init_baby_steps_helper netsnmp_baby_steps_handler_init
00112 
00113 
00114 #ifdef __cplusplus
00115 }
00116 #endif
00117 #endif /* baby_steps */