net-snmp
5.4.1
|
00001 /* Portions of this file are subject to the following copyright(s). See 00002 * the Net-SNMP's COPYING file for more details and other copyrights 00003 * that may apply: 00004 */ 00005 /* 00006 * Portions of this file are copyrighted by: 00007 * Copyright © 2003 Sun Microsystems, Inc. All rights reserved. 00008 * Use is subject to license terms specified in the COPYING file 00009 * distributed with the Net-SNMP package. 00010 */ 00016 #ifndef _TABLE_ITERATOR_HANDLER_H_ 00017 #define _TABLE_ITERATOR_HANDLER_H_ 00018 00019 #ifdef __cplusplus 00020 extern "C" { 00021 #endif 00022 00023 struct netsnmp_iterator_info_s; 00024 00025 typedef netsnmp_variable_list * 00026 (Netsnmp_First_Data_Point) (void **loop_context, 00027 void **data_context, 00028 netsnmp_variable_list *, 00029 struct netsnmp_iterator_info_s *); 00030 typedef netsnmp_variable_list * 00031 (Netsnmp_Next_Data_Point) (void **loop_context, 00032 void **data_context, 00033 netsnmp_variable_list *, 00034 struct netsnmp_iterator_info_s *); 00035 typedef void *(Netsnmp_Make_Data_Context) (void *loop_context, 00036 struct netsnmp_iterator_info_s *); 00037 typedef void (Netsnmp_Free_Loop_Context) (void *, 00038 struct netsnmp_iterator_info_s *); 00039 typedef void (Netsnmp_Free_Data_Context) (void *, 00040 struct netsnmp_iterator_info_s *); 00041 00053 typedef struct netsnmp_iterator_info_s { 00057 Netsnmp_First_Data_Point *get_first_data_point; 00058 00062 Netsnmp_Next_Data_Point *get_next_data_point; 00063 00068 Netsnmp_Make_Data_Context *make_data_context; 00069 00075 Netsnmp_Free_Loop_Context *free_loop_context; 00076 00082 Netsnmp_Free_Data_Context *free_data_context; 00083 00090 Netsnmp_Free_Loop_Context *free_loop_context_at_end; 00091 00094 void *myvoid; 00095 int flags; 00096 #define NETSNMP_ITERATOR_FLAG_SORTED 0x01 00097 00100 netsnmp_table_registration_info *table_reginfo; 00101 00102 /* Experimental extension - Use At Your Own Risk 00103 (these two fields may change/disappear without warning) */ 00104 Netsnmp_First_Data_Point *get_row_indexes; 00105 netsnmp_variable_list *indexes; 00106 } netsnmp_iterator_info; 00107 00108 #define TABLE_ITERATOR_NAME "table_iterator" 00109 00110 /* ============================ 00111 * Iterator API: Table maintenance 00112 * ============================ */ 00113 /* N/A */ 00114 00115 /* ============================ 00116 * Iterator API: MIB maintenance 00117 * ============================ */ 00118 00119 netsnmp_mib_handler 00120 *netsnmp_get_table_iterator_handler(netsnmp_iterator_info *iinfo); 00121 int netsnmp_register_table_iterator( netsnmp_handler_registration 00122 *reginfo, 00123 netsnmp_iterator_info *iinfo); 00124 void netsnmp_iterator_delete_table(netsnmp_iterator_info *iinfo); 00125 00126 void *netsnmp_extract_iterator_context(netsnmp_request_info *); 00127 void netsnmp_insert_iterator_context(netsnmp_request_info *, void *); 00128 00129 Netsnmp_Node_Handler netsnmp_table_iterator_helper_handler; 00130 00131 00132 /* ============================ 00133 * Iterator API: Row operations 00134 * ============================ */ 00135 00136 void *netsnmp_iterator_row_first( netsnmp_iterator_info *); 00137 void *netsnmp_iterator_row_get( netsnmp_iterator_info *, void *); 00138 void *netsnmp_iterator_row_next( netsnmp_iterator_info *, void *); 00139 void *netsnmp_iterator_row_get_byidx( netsnmp_iterator_info *, 00140 netsnmp_variable_list *); 00141 void *netsnmp_iterator_row_next_byidx( netsnmp_iterator_info *, 00142 netsnmp_variable_list *); 00143 void *netsnmp_iterator_row_get_byoid( netsnmp_iterator_info *, oid *, size_t); 00144 void *netsnmp_iterator_row_next_byoid( netsnmp_iterator_info *, oid *, size_t); 00145 int netsnmp_iterator_row_count( netsnmp_iterator_info *); 00146 00147 00148 /* ============================ 00149 * Iterator API: Index operations 00150 * ============================ */ 00151 00152 #ifdef __cplusplus 00153 } 00154 #endif 00155 00156 #endif /* _TABLE_ITERATOR_HANDLER_H_ */ 00157