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 */ 00011 /* 00012 * Portions of this file are copyrighted by: 00013 * Copyright (C) 2007 Apple, Inc. All rights reserved. 00014 * Use is subject to license terms specified in the COPYING file 00015 * distributed with the Net-SNMP package. 00016 */ 00017 /* 00018 * @file table.h 00019 * 00020 * @addtogroup table 00021 * 00022 * @{ 00023 */ 00024 #ifndef _TABLE_HANDLER_H_ 00025 #define _TABLE_HANDLER_H_ 00026 00027 #ifdef __cplusplus 00028 extern "C" { 00029 #endif 00030 00049 #define TABLE_HANDLER_NAME "table" 00050 00058 typedef struct netsnmp_column_info_t { 00059 char isRange; 00061 char list_count; 00062 00063 union { 00064 unsigned int range[2]; 00065 unsigned int *list; 00066 } details; 00067 00068 struct netsnmp_column_info_t *next; 00069 00070 } netsnmp_column_info; 00071 00080 typedef struct netsnmp_table_registration_info_s { 00082 netsnmp_variable_list *indexes; 00084 unsigned int number_indexes; 00085 00091 unsigned int min_column; 00093 unsigned int max_column; 00094 00096 netsnmp_column_info *valid_columns; 00097 00098 } netsnmp_table_registration_info; 00099 00108 typedef struct netsnmp_table_request_info_s { 00110 unsigned int colnum; 00112 unsigned int number_indexes; 00114 netsnmp_variable_list *indexes; 00115 00116 oid index_oid[MAX_OID_LEN]; 00117 size_t index_oid_len; 00118 netsnmp_table_registration_info *reg_info; 00119 } netsnmp_table_request_info; 00120 00121 netsnmp_mib_handler 00122 *netsnmp_get_table_handler(netsnmp_table_registration_info 00123 *tabreq); 00124 int netsnmp_register_table( netsnmp_handler_registration *reginfo, 00125 netsnmp_table_registration_info *tabreq); 00126 int netsnmp_unregister_table(netsnmp_handler_registration *reginfo); 00127 int netsnmp_table_build_oid( netsnmp_handler_registration *reginfo, 00128 netsnmp_request_info *reqinfo, 00129 netsnmp_table_request_info *table_info); 00130 int 00131 netsnmp_table_build_oid_from_index(netsnmp_handler_registration 00132 *reginfo, 00133 netsnmp_request_info *reqinfo, 00134 netsnmp_table_request_info 00135 *table_info); 00136 int netsnmp_table_build_result(netsnmp_handler_registration 00137 *reginfo, 00138 netsnmp_request_info 00139 *reqinfo, 00140 netsnmp_table_request_info 00141 *table_info, u_char type, 00142 u_char * result, 00143 size_t result_len); 00144 int 00145 netsnmp_update_variable_list_from_index(netsnmp_table_request_info 00146 *); 00147 int 00148 netsnmp_update_indexes_from_variable_list 00149 (netsnmp_table_request_info *tri); 00150 netsnmp_table_registration_info 00151 *netsnmp_find_table_registration_info(netsnmp_handler_registration 00152 *reginfo); 00153 void netsnmp_table_registration_info_free(netsnmp_table_registration_info *); 00154 00155 netsnmp_index * netsnmp_table_index_find_next_row(netsnmp_container *c, 00156 netsnmp_table_request_info *tblreq); 00157 00158 unsigned int netsnmp_closest_column(unsigned int current, 00159 netsnmp_column_info 00160 *valid_columns); 00161 00162 Netsnmp_Node_Handler table_helper_handler; 00163 00164 #define netsnmp_table_helper_add_index(tinfo, type) snmp_varlist_add_variable(&tinfo->indexes, NULL, 0, (u_char)type, NULL, 0); 00165 00166 void 00167 netsnmp_table_helper_add_indexes(netsnmp_table_registration_info 00168 *tinfo, ...); 00169 00170 int netsnmp_check_getnext_reply(netsnmp_request_info *request, 00171 oid * prefix, size_t prefix_len, 00172 netsnmp_variable_list * newvar, 00173 netsnmp_variable_list ** outvar); 00174 00175 netsnmp_table_request_info 00176 *netsnmp_extract_table_info(netsnmp_request_info *); 00177 netsnmp_oid_stash_node 00178 **netsnmp_table_get_or_create_row_stash(netsnmp_agent_request_info 00179 *reqinfo, 00180 const u_char * 00181 storage_name); 00182 unsigned int 00183 netsnmp_table_next_column(netsnmp_table_request_info *table_info); 00184 00185 00186 int netsnmp_sparse_table_register(netsnmp_handler_registration *reginfo, 00187 netsnmp_table_registration_info *tabreq); 00188 00189 netsnmp_mib_handler *netsnmp_sparse_table_handler_get(void); 00190 00191 #ifdef __cplusplus 00192 } 00193 #endif 00194 00195 #endif /* _TABLE_HANDLER_H_ */ 00196
Last modified: Wednesday, 01-Aug-2018 04:41:28 UTC
For questions regarding web content and site functionality, please write to the net-snmp-users mail list.