net-snmp 5.7
agent_index.h
00001 #ifndef AGENT_INDEX_H
00002 #define AGENT_INDEX_H
00003 
00004 #ifdef __cplusplus
00005 extern          "C" {
00006 #endif
00007 
00008 #define ALLOCATE_THIS_INDEX             0x0
00009 #define ALLOCATE_ANY_INDEX              0x1
00010 #define ALLOCATE_NEW_INDEX              0x3
00011         /*
00012          * N.B: it's deliberate that NEW_INDEX & ANY_INDEX == ANY_INDEX 
00013          */
00014 
00015 #define ANY_INTEGER_INDEX               -1
00016 #define ANY_STRING_INDEX                NULL
00017 #define ANY_OID_INDEX                   NULL
00018 
00019 #define INDEX_ERR_GENERR                -1
00020 #define INDEX_ERR_WRONG_TYPE            -2
00021 #define INDEX_ERR_NOT_ALLOCATED         -3
00022 #define INDEX_ERR_WRONG_SESSION         -4
00023 
00024 char           *register_string_index(oid *, size_t, char *);
00025 int             register_int_index(oid *, size_t, int);
00026 netsnmp_variable_list *register_oid_index(oid *, size_t, oid *, size_t);
00027 netsnmp_variable_list *register_index(netsnmp_variable_list *, int,
00028                                       netsnmp_session *);
00029 
00030 int             unregister_string_index(oid *, size_t, char *);
00031 int             unregister_int_index(oid *, size_t, int);
00032 int             unregister_oid_index(oid *, size_t, oid *, size_t);
00033 
00034 int             release_index(netsnmp_variable_list *);
00035 int             remove_index(netsnmp_variable_list *, netsnmp_session *);
00036 void            unregister_index_by_session(netsnmp_session *);
00037 int             unregister_index(netsnmp_variable_list *, int,
00038                                  netsnmp_session *);
00039 
00040 unsigned long   count_indexes(oid * name, size_t namelen,
00041                               int include_unallocated);
00042 
00043 #ifdef __cplusplus
00044 }
00045 #endif
00046 #endif                          /* AGENT_INDEX_H */