1table_data(3) net-snmp table_data(3)
2
3
4
6 table_data - Helps you implement a table with datamatted storage.
7
8
9 Modules
10 table_dataset
11 Helps you implement a table with automatted storage.
12
13 Functions
14 void netsnmp_table_data_generate_index_oid (netsnmp_table_row *row)
15 netsnmp_table_data * netsnmp_create_table_data (const char *name)
16 creates and returns a pointer to table data set
17 netsnmp_table_row * netsnmp_create_table_data_row (void)
18 creates and returns a pointer to table data set
19 netsnmp_table_row * netsnmp_table_data_clone_row (netsnmp_table_row
20 *row)
21 clones a data row.
22 void * netsnmp_table_data_delete_row (netsnmp_table_row *row)
23 deletes a row's memory.
24 int netsnmp_table_data_add_row (netsnmp_table_data *table,
25 netsnmp_table_row *row)
26 Adds a row of data to a given table (stored in proper lexographical
27 order).
28 NETSNMP_INLINE void netsnmp_table_data_replace_row (netsnmp_table_data
29 *table, netsnmp_table_row *origrow, netsnmp_table_row *newrow)
30 swaps out origrow with newrow.
31 netsnmp_table_row * netsnmp_table_data_remove_row (netsnmp_table_data
32 *table, netsnmp_table_row *row)
33 removes a row of data to a given table and returns it (no free's
34 called)
35 void * netsnmp_table_data_remove_and_delete_row (netsnmp_table_data
36 *table, netsnmp_table_row *row)
37 removes and frees a row of data to a given table and returns the
38 void *
39 netsnmp_table_data * netsnmp_table_data_create_table (const char *name,
40 long flags)
41 void netsnmp_table_data_delete_table (netsnmp_table_data *table)
42 netsnmp_table_row * netsnmp_table_data_create_row (void *entry)
43 int netsnmp_table_data_copy_row (netsnmp_table_row *old_row,
44 netsnmp_table_row *new_row)
45 void * netsnmp_table_data_remove_delete_row (netsnmp_table_data *table,
46 netsnmp_table_row *row)
47 netsnmp_mib_handler * netsnmp_get_table_data_handler
48 (netsnmp_table_data *table)
49 Creates a table_data handler and returns it.
50 int netsnmp_register_table_data (netsnmp_handler_registration *reginfo,
51 netsnmp_table_data *table, netsnmp_table_registration_info
52 *table_info)
53 registers a handler as a data table.
54 int netsnmp_register_read_only_table_data (netsnmp_handler_registration
55 *reginfo, netsnmp_table_data *table,
56 netsnmp_table_registration_info *table_info)
57 registers a handler as a read-only data table If table_info !=
58 NULL, it registers it as a normal table too.
59 int netsnmp_table_data_helper_handler (netsnmp_mib_handler *handler,
60 netsnmp_handler_registration *reginfo, netsnmp_agent_request_info
61 *reqinfo, netsnmp_request_info *requests)
62 netsnmp_table_data * netsnmp_extract_table (netsnmp_request_info
63 *request)
64 extracts the table being accessed passed from the table_data helper
65 netsnmp_table_row * netsnmp_extract_table_row (netsnmp_request_info
66 *request)
67 extracts the row being accessed passed from the table_data helper
68 void * netsnmp_extract_table_row_data (netsnmp_request_info *request)
69 extracts the data from the row being accessed passed from the
70 table_data helper
71 NETSNMP_INLINE void netsnmp_insert_table_row (netsnmp_request_info
72 *request, netsnmp_table_row *row)
73 inserts a newly created table_data row into a request
74 int netsnmp_table_data_build_result (netsnmp_handler_registration
75 *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info
76 *request, netsnmp_table_row *row, int column, u_char type, u_char
77 *result_data, size_t result_data_len)
78 netsnmp_table_row * netsnmp_table_data_get_first_row
79 (netsnmp_table_data *table)
80 returns the first row in the table
81 netsnmp_table_row * netsnmp_table_data_get_next_row (netsnmp_table_data
82 *table, netsnmp_table_row *row)
83 returns the next row in the table
84 netsnmp_table_row * netsnmp_table_data_get (netsnmp_table_data *table,
85 netsnmp_variable_list *indexes)
86 finds the data in 'datalist' stored at 'indexes'
87 netsnmp_table_row * netsnmp_table_data_get_from_oid (netsnmp_table_data
88 *table, oid *searchfor, size_t searchfor_len)
89 finds the data in 'datalist' stored at the searchfor oid
90 int netsnmp_table_data_num_rows (netsnmp_table_data *table)
91 netsnmp_table_row * netsnmp_table_data_row_first (netsnmp_table_data
92 *table)
93 netsnmp_table_row * netsnmp_table_data_row_get (netsnmp_table_data
94 *table, netsnmp_table_row *row)
95 netsnmp_table_row * netsnmp_table_data_row_next (netsnmp_table_data
96 *table, netsnmp_table_row *row)
97 netsnmp_table_row * netsnmp_table_data_row_get_byoid
98 (netsnmp_table_data *table, oid *instance, size_t len)
99 netsnmp_table_row * netsnmp_table_data_row_next_byoid
100 (netsnmp_table_data *table, oid *instance, size_t len)
101 netsnmp_table_row * netsnmp_table_data_row_get_byidx
102 (netsnmp_table_data *table, netsnmp_variable_list *indexes)
103 netsnmp_table_row * netsnmp_table_data_row_next_byidx
104 (netsnmp_table_data *table, netsnmp_variable_list *indexes)
105 int netsnmp_table_data_row_count (netsnmp_table_data *table)
106 void * netsnmp_table_data_entry_first (netsnmp_table_data *table)
107 void * netsnmp_table_data_entry_get (netsnmp_table_data *table,
108 netsnmp_table_row *row)
109 void * netsnmp_table_data_entry_next (netsnmp_table_data *table,
110 netsnmp_table_row *row)
111 void * netsnmp_table_data_entry_get_byidx (netsnmp_table_data *table,
112 netsnmp_variable_list *indexes)
113 void * netsnmp_table_data_entry_next_byidx (netsnmp_table_data *table,
114 netsnmp_variable_list *indexes)
115 void * netsnmp_table_data_entry_get_byoid (netsnmp_table_data *table,
116 oid *instance, size_t len)
117 void * netsnmp_table_data_entry_next_byoid (netsnmp_table_data *table,
118 oid *instance, size_t len)
119
121 Helps you implement a table with datamatted storage.
122
123 This helper is obsolete. If you are writing a new module, please
124 consider using the table_tdata helper instead.
125
126 This helper helps you implement a table where all the indexes are
127 expected to be stored within the agent itself and not in some external
128 storage location. It can be used to store a list of rows, where a row
129 consists of the indexes to the table and a generic data pointer. You
130 can then implement a subhandler which is passed the exact row
131 definition and data it must return data for or accept data for. Complex
132 GETNEXT handling is greatly simplified in this case.
133
135 netsnmp_table_data* netsnmp_create_table_data (const char * name)
136 creates and returns a pointer to table data set
137
138 Definition at line 52 of file table_data.c.
139
140 References netsnmp_table_data_s::name, and SNMP_MALLOC_TYPEDEF.
141
142 Referenced by netsnmp_create_table_data_set(), and
143 netsnmp_table_data_create_table().
144
145 netsnmp_table_row* netsnmp_create_table_data_row (void)
146 creates and returns a pointer to table data set
147
148 Examples:
149 data_set.c.
150
151 Definition at line 62 of file table_data.c.
152
153 References SNMP_MALLOC_TYPEDEF.
154
155 Referenced by netsnmp_config_parse_add_row(), and
156 netsnmp_table_data_set_create_row_from_defaults().
157
158 netsnmp_table_data* netsnmp_extract_table (netsnmp_request_info * request)
159 extracts the table being accessed passed from the table_data helper
160
161 Definition at line 649 of file table_data.c.
162
163 References netsnmp_request_get_list_data().
164
165 netsnmp_table_row* netsnmp_extract_table_row (netsnmp_request_info *
166 request)
167 extracts the row being accessed passed from the table_data helper
168
169 Definition at line 657 of file table_data.c.
170
171 References netsnmp_request_get_list_data().
172
173 Referenced by netsnmp_extract_table_row_data(), and
174 netsnmp_table_data_set_helper_handler().
175
176 void* netsnmp_extract_table_row_data (netsnmp_request_info * request)
177 extracts the data from the row being accessed passed from the
178 table_data helper
179
180 Definition at line 666 of file table_data.c.
181
182 References netsnmp_table_row_s::data, netsnmp_extract_table_row(), and
183 NULL.
184
185 Referenced by netsnmp_extract_table_data_set_column().
186
187 netsnmp_mib_handler* netsnmp_get_table_data_handler (netsnmp_table_data *
188 table)
189 Creates a table_data handler and returns it.
190
191 Definition at line 371 of file table_data.c.
192
193 References netsnmp_mib_handler_s::flags, MIB_HANDLER_AUTO_NEXT,
194 netsnmp_mib_handler_s::myvoid, netsnmp_create_handler(),
195 netsnmp_table_data_helper_handler(), NULL, and snmp_log().
196
197 Referenced by netsnmp_register_table_data().
198
199 NETSNMP_INLINE void netsnmp_insert_table_row (netsnmp_request_info *
200 request, netsnmp_table_row * row)
201 inserts a newly created table_data row into a request
202
203 Definition at line 678 of file table_data.c.
204
205 References build_oid_noalloc(), netsnmp_table_request_info_s::indexes,
206 netsnmp_create_data_list(), netsnmp_extract_table_info(),
207 netsnmp_request_add_list_data(), netsnmp_request_info_s::next, NULL,
208 netsnmp_request_info_s::prev, and snmp_oid_compare().
209
210 int netsnmp_register_read_only_table_data (netsnmp_handler_registration *
211 reginfo, netsnmp_table_data * table, netsnmp_table_registration_info *
212 table_info)
213 registers a handler as a read-only data table If table_info != NULL, it
214 registers it as a normal table too.
215
216 Definition at line 405 of file table_data.c.
217
218 References netsnmp_get_read_only_handler(), netsnmp_inject_handler(),
219 and netsnmp_register_table_data().
220
221 int netsnmp_register_table_data (netsnmp_handler_registration * reginfo,
222 netsnmp_table_data * table, netsnmp_table_registration_info *
223 table_info)
224 registers a handler as a data table.
225
226 If table_info != NULL, it registers it as a normal table too.
227
228 Definition at line 394 of file table_data.c.
229
230 References netsnmp_get_table_data_handler(), netsnmp_inject_handler(),
231 and netsnmp_register_table().
232
233 Referenced by netsnmp_register_read_only_table_data(), and
234 netsnmp_register_table_data_set().
235
236 int netsnmp_table_data_add_row (netsnmp_table_data * table,
237 netsnmp_table_row * row)
238 Adds a row of data to a given table (stored in proper lexographical
239 order).
240
241 returns SNMPERR_SUCCESS on successful addition. or SNMPERR_GENERR on
242 failure (E.G., indexes already existed)
243
244 xxx-rks: remove invalid row?
245
246 Definition at line 130 of file table_data.c.
247
248 References netsnmp_table_data_s::first_row,
249 netsnmp_table_row_s::index_oid, netsnmp_table_row_s::index_oid_len,
250 netsnmp_table_row_s::indexes, netsnmp_table_data_s::last_row,
251 netsnmp_table_data_s::name, netsnmp_table_data_generate_index_oid(),
252 netsnmp_table_row_s::next, NULL, netsnmp_table_row_s::prev,
253 snmp_free_varbind(), snmp_log(), snmp_oid_compare(), and
254 netsnmp_table_data_s::store_indexes.
255
256 Referenced by netsnmp_config_parse_add_row(),
257 netsnmp_table_data_replace_row(), and netsnmp_table_dataset_add_row().
258
259 netsnmp_table_row* netsnmp_table_data_clone_row (netsnmp_table_row * row)
260 clones a data row.
261
262 DOES NOT CLONE THE CONTAINED DATA.
263
264 Definition at line 70 of file table_data.c.
265
266 References memdup(), NULL, and snmp_clone_varbind().
267
268 Referenced by netsnmp_table_data_set_clone_row().
269
270 void* netsnmp_table_data_delete_row (netsnmp_table_row * row)
271 deletes a row's memory.
272
273 returns the void data that it doesn't know how to delete.
274
275 Definition at line 101 of file table_data.c.
276
277 References netsnmp_table_row_s::data, netsnmp_table_row_s::index_oid,
278 netsnmp_table_row_s::indexes, NULL, SNMP_FREE, and snmp_free_varbind().
279
280 Referenced by netsnmp_table_data_delete_table(),
281 netsnmp_table_data_remove_and_delete_row(), and
282 netsnmp_table_dataset_delete_row().
283
284 netsnmp_table_row* netsnmp_table_data_get (netsnmp_table_data * table,
285 netsnmp_variable_list * indexes)
286 finds the data in 'datalist' stored at 'indexes'
287
288 Definition at line 804 of file table_data.c.
289
290 References build_oid_noalloc(), netsnmp_table_data_get_from_oid(), and
291 NULL.
292
293 Referenced by netsnmp_table_data_row_get_byidx().
294
295 netsnmp_table_row* netsnmp_table_data_get_first_row (netsnmp_table_data *
296 table)
297 returns the first row in the table
298
299 Definition at line 785 of file table_data.c.
300
301 References netsnmp_table_data_s::first_row, and NULL.
302
303 Referenced by netsnmp_table_data_entry_first(),
304 netsnmp_table_data_row_first(), and
305 netsnmp_table_data_set_get_first_row().
306
307 netsnmp_table_row* netsnmp_table_data_get_from_oid (netsnmp_table_data *
308 table, oid * searchfor, size_t searchfor_len)
309 finds the data in 'datalist' stored at the searchfor oid
310
311 Definition at line 818 of file table_data.c.
312
313 References netsnmp_table_data_s::first_row,
314 netsnmp_table_row_s::index_oid, netsnmp_table_row_s::index_oid_len,
315 netsnmp_table_row_s::next, NULL, and snmp_oid_compare().
316
317 Referenced by netsnmp_table_data_get(), netsnmp_table_data_row_get(),
318 and netsnmp_table_data_row_get_byoid().
319
320 netsnmp_table_row* netsnmp_table_data_get_next_row (netsnmp_table_data *
321 table, netsnmp_table_row * row)
322 returns the next row in the table
323
324 Definition at line 794 of file table_data.c.
325
326 References netsnmp_table_row_s::next, and NULL.
327
328 Referenced by netsnmp_table_data_row_next(), and
329 netsnmp_table_data_set_get_next_row().
330
331 void* netsnmp_table_data_remove_and_delete_row (netsnmp_table_data * table,
332 netsnmp_table_row * row)
333 removes and frees a row of data to a given table and returns the void *
334
335 returns the void * data on successful deletion. or NULL on failure (bad
336 arguments)
337
338 Definition at line 270 of file table_data.c.
339
340 References netsnmp_table_data_delete_row(),
341 netsnmp_table_data_remove_row(), and NULL.
342
343 Referenced by netsnmp_table_data_remove_delete_row(),
344 netsnmp_table_dataset_remove_and_delete_row(), and
345 netsnmp_table_dataset_remove_row().
346
347 netsnmp_table_row* netsnmp_table_data_remove_row (netsnmp_table_data *
348 table, netsnmp_table_row * row)
349 removes a row of data to a given table and returns it (no free's
350 called)
351
352 returns the row pointer itself on successful removing. or NULL on
353 failure (bad arguments)
354
355 Definition at line 244 of file table_data.c.
356
357 References netsnmp_table_data_s::first_row,
358 netsnmp_table_data_s::last_row, netsnmp_table_row_s::next, NULL, and
359 netsnmp_table_row_s::prev.
360
361 Referenced by netsnmp_table_data_remove_and_delete_row(), and
362 netsnmp_table_data_replace_row().
363
364 NETSNMP_INLINE void netsnmp_table_data_replace_row (netsnmp_table_data *
365 table, netsnmp_table_row * origrow, netsnmp_table_row * newrow)
366 swaps out origrow with newrow.
367
368 This does *not* delete/free anything!
369
370 Definition at line 229 of file table_data.c.
371
372 References netsnmp_table_data_add_row(), and
373 netsnmp_table_data_remove_row().
374
375 Referenced by netsnmp_table_dataset_replace_row().
376
377
378
379Version 5.4 24 Nov 2006 table_data(3)