~ubuntu-branches/ubuntu/wily/net-snmp/wily-proposed

« back to all changes in this revision

Viewing changes to man/netsnmp_table_dataset.3

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-06-28 14:59:36 UTC
  • mfrom: (1.2.3 upstream) (1.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20100628145936-cbiallic69pn044g
Tags: 5.4.3~dfsg-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Set Ubuntu maintainer address.
  - net-snmp-config: Use bash. (LP: #104738)
  - Removed multiuser option when calling update-rc.d. (LP: #254261)
  - debian/snmpd.init: LSBify the init script.
  - debian/patches/52_fix_snmpcmd_1_typo.patch: Adjust a typo in snmpcmd.1
    (LP: #250459)
  - debian/snmpd.postinst: source debconf before doing work, LP: #589056
  - debian/snmp.preinst, debian/snmp.prerm: kill any/all processes owned by
    snmp user before install/uninstall, LP: #573391
  - Add apport hook (LP: #533603):
  - debian/{snmp,snmpd}.apport: Added.
  - debian/control: Build-depends on dh-apport.
  - debian/rules: 
    + Add --with apport.
    + override_dh_apport to install hook on snmpd package only.
 * Dropped patches:
   - debian/patches/99-fix-ubuntu-div0.patch: Fix dvision by zero.. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.TH "table_dataset" 3 "5 Sep 2008" "Version 5.4.2" "net-snmp" \" -*- nroff -*-
 
1
.TH "table_dataset" 3 "23 May 2010" "Version 5.4.3.pre1" "net-snmp" \" -*- nroff -*-
2
2
.ad l
3
3
.nh
4
4
.SH NAME
5
 
table_dataset \- Helps you implement a table with automatted storage.  
 
5
table_dataset \- 
 
6
.PP
 
7
Helps you implement a table with automatted storage.  
6
8
 
7
 
.PP
8
9
.SS "Functions"
9
10
 
10
11
.in +1c
26
27
.ti -1c
27
28
.RI "NETSNMP_INLINE void \fBnetsnmp_table_dataset_delete_all_data\fP (\fBnetsnmp_table_data_set_storage\fP *data)"
28
29
.br
29
 
.RI "\fIdeletes all the data from this node and beyond in the linked list \fP"
 
30
.RI "\fIdeletes all the data from this \fBnode\fP and beyond in the linked list \fP"
30
31
.ti -1c
31
32
.RI "NETSNMP_INLINE void \fBnetsnmp_table_dataset_delete_row\fP (\fBnetsnmp_table_row\fP *row)"
32
33
.br
33
 
.RI "\fIdeletes all the data from this node and beyond in the linked list \fP"
 
34
.RI "\fIdeletes all the data from this \fBnode\fP and beyond in the linked list \fP"
34
35
.ti -1c
35
36
.RI "NETSNMP_INLINE void \fBnetsnmp_table_dataset_add_row\fP (\fBnetsnmp_table_data_set\fP *table, \fBnetsnmp_table_row\fP *row)"
36
37
.br
115
116
.br
116
117
.RI "\fIsets a given column in a row with data given a type, value, and length. \fP"
117
118
.ti -1c
118
 
.RI "NETSNMP_INLINE void \fBnetsnmp_table_dataset_add_index\fP (\fBnetsnmp_table_data_set\fP *table, u_char type)"
 
119
.RI "void \fBnetsnmp_table_dataset_add_index\fP (\fBnetsnmp_table_data_set\fP *table, u_char type)"
119
120
.br
120
121
.RI "\fIadds an index to the table. \fP"
121
122
.ti -1c
126
127
.SH "Detailed Description"
127
128
.PP 
128
129
Helps you implement a table with automatted storage. 
129
 
.PP
130
 
This helper is obsolete. If you are writing a new module, please consider using the table_dataset2 helper instead.
131
 
.PP
 
130
 
132
131
This handler helps you implement a table where all the data is expected to be stored within the agent itself and not in some external storage location. It handles all MIB requests including GETs, GETNEXTs and SETs. It's possible to simply create a table without actually ever defining a handler to be called when SNMP requests come in. To use the data, you can either attach a sub-handler that merely uses/manipulates the data further when requests come in, or you can loop through it externally when it's actually needed. This handler is most useful in cases where a table is holding configuration data for something which gets triggered via another event.
133
132
.PP
134
133
NOTE NOTE NOTE: This helper isn't complete and is likely to change somewhat over time. Specifically, the way it stores data internally may change drastically. 
142
141
.in +1c
143
142
\fBdata_set.c\fP.
144
143
.PP
145
 
Definition at line 80 of file table_dataset.c.
146
 
.PP
147
 
References netsnmp_create_table_data(), NULL, SNMP_MALLOC_TYPEDEF, and netsnmp_table_data_set_s::table.
148
 
.PP
149
 
Referenced by netsnmp_config_parse_table_set().
 
144
Definition at line 77 of file table_dataset.c.
150
145
.SS "NETSNMP_INLINE \fBnetsnmp_table_data_set\fP* netsnmp_extract_table_data_set (\fBnetsnmp_request_info\fP * request)"
151
146
.PP
152
147
extracts a netsnmp_table_data_set pointer from a given request 
153
148
.PP
154
 
Definition at line 816 of file table_dataset.c.
155
 
.PP
156
 
References netsnmp_request_get_list_data().
 
149
Definition at line 813 of file table_dataset.c.
157
150
.SS "\fBnetsnmp_table_data_set_storage\fP* netsnmp_extract_table_data_set_column (\fBnetsnmp_request_info\fP * request, unsigned int column)"
158
151
.PP
159
152
extracts a netsnmp_table_data_set pointer from a given request 
160
153
.PP
161
 
Definition at line 826 of file table_dataset.c.
162
 
.PP
163
 
References netsnmp_extract_table_row_data(), and netsnmp_table_data_set_find_column().
 
154
Definition at line 823 of file table_dataset.c.
164
155
.SS "\fBnetsnmp_mib_handler\fP* netsnmp_get_table_data_set_handler (\fBnetsnmp_table_data_set\fP * data_set)"
165
156
.PP
166
157
Given a netsnmp_table_data_set definition, create a handler for it. 
167
158
.PP
168
 
Definition at line 356 of file table_dataset.c.
169
 
.PP
170
 
References netsnmp_mib_handler_s::flags, MIB_HANDLER_AUTO_NEXT, netsnmp_mib_handler_s::myvoid, netsnmp_create_handler(), netsnmp_table_data_set_helper_handler(), NULL, and snmp_log().
171
 
.PP
172
 
Referenced by netsnmp_register_table_data_set().
 
159
Definition at line 353 of file table_dataset.c.
173
160
.SS "int netsnmp_mark_row_column_writable (\fBnetsnmp_table_row\fP * row, int column, int writable)"
174
161
.PP
175
162
marks a given column in a row as writable or not. 
178
165
.in +1c
179
166
\fBdata_set.c\fP.
180
167
.PP
181
 
Definition at line 1187 of file table_dataset.c.
182
 
.PP
183
 
References netsnmp_table_data_set_storage_s::column, netsnmp_table_row_s::data, netsnmp_table_data_set_find_column(), netsnmp_table_data_set_storage_s::next, snmp_log(), SNMP_MALLOC_TYPEDEF, and netsnmp_table_data_set_storage_s::writable.
184
 
.PP
185
 
Referenced by netsnmp_config_parse_add_row(), and netsnmp_table_data_set_create_row_from_defaults().
 
168
Definition at line 1189 of file table_dataset.c.
186
169
.SS "void netsnmp_register_auto_data_table (\fBnetsnmp_table_data_set\fP * table_set, char * registration_name)"
187
170
.PP
188
 
registers a table_dataset so that the 'add_row' snmpd.conf token can be used to add data to this table. 
189
 
.PP
190
 
If registration_name is NULL then the name used when the table was created will be used instead.
 
171
registers a table_dataset so that the 'add_row' snmpd.conf token can be used to add data to this table. If registration_name is NULL then the name used when the table was created will be used instead.
191
172
.PP
192
173
\fBTodo\fP
193
174
.RS 4
200
181
.in +1c
201
182
\fBdata_set.c\fP.
202
183
.PP
203
 
Definition at line 853 of file table_dataset.c.
204
 
.PP
205
 
References netsnmp_table_data_s::name, netsnmp_add_list_data(), netsnmp_create_data_list(), NULL, SNMP_MALLOC_TYPEDEF, netsnmp_table_data_set_s::table, and data_set_tables_s::table_set.
206
 
.PP
207
 
Referenced by netsnmp_config_parse_table_set().
 
184
Definition at line 850 of file table_dataset.c.
208
185
.SS "int netsnmp_register_table_data_set (\fBnetsnmp_handler_registration\fP * reginfo, \fBnetsnmp_table_data_set\fP * data_set, \fBnetsnmp_table_registration_info\fP * table_info)"
209
186
.PP
210
 
register a given data_set at a given oid (specified in the netsnmp_handler_registration pointer). 
211
 
.PP
212
 
The reginfo->handler->access_method *may* be null if the call doesn't ever want to be called for SNMP operations. 
 
187
register a given data_set at a given oid (specified in the netsnmp_handler_registration pointer). The reginfo->handler->access_method *may* be null if the call doesn't ever want to be called for SNMP operations. 
213
188
.PP
214
189
\fBExamples: \fP
215
190
.in +1c
216
191
\fBdata_set.c\fP.
217
192
.PP
218
 
Definition at line 382 of file table_dataset.c.
219
 
.PP
220
 
References netsnmp_table_data_set_storage_s::column, netsnmp_table_data_set_s::default_row, netsnmp_table_registration_info_s::indexes, netsnmp_table_data_s::indexes_template, netsnmp_table_registration_info_s::max_column, netsnmp_table_registration_info_s::min_column, netsnmp_get_table_data_set_handler(), netsnmp_inject_handler(), netsnmp_register_table_data(), netsnmp_table_data_set_storage_s::next, NULL, snmp_clone_varbind(), SNMP_MALLOC_TYPEDEF, SNMP_MAX, SNMP_MIN, and netsnmp_table_data_set_s::table.
221
 
.PP
222
 
Referenced by netsnmp_config_parse_table_set().
 
193
Definition at line 379 of file table_dataset.c.
223
194
.SS "int netsnmp_set_row_column (\fBnetsnmp_table_row\fP * row, unsigned int column, int type, const char * value, size_t value_len)"
224
195
.PP
225
 
sets a given column in a row with data given a type, value, and length. 
226
 
.PP
227
 
Data is memdup'ed by the function. 
 
196
sets a given column in a row with data given a type, value, and length. Data is memdup'ed by the function. 
228
197
.PP
229
198
\fBExamples: \fP
230
199
.in +1c
231
200
\fBdata_set.c\fP.
232
201
.PP
233
 
Definition at line 1222 of file table_dataset.c.
234
 
.PP
235
 
References netsnmp_table_data_set_storage_s::column, netsnmp_table_row_s::data, netsnmp_table_data_set_storage_s::data, netsnmp_table_data_set_storage_s::data_len, memdup(), netsnmp_table_data_set_find_column(), netsnmp_table_data_set_storage_s::next, SNMP_FREE, snmp_log(), SNMP_MALLOC_TYPEDEF, netsnmp_table_data_set_storage_s::string, netsnmp_table_data_set_storage_s::type, and netsnmp_table_data_set_storage_s::voidp.
236
 
.PP
237
 
Referenced by netsnmp_config_parse_add_row(), and netsnmp_table_data_set_create_row_from_defaults().
 
202
Definition at line 1224 of file table_dataset.c.
238
203
.SS "\fBnetsnmp_table_row\fP* netsnmp_table_data_set_clone_row (\fBnetsnmp_table_row\fP * row)"
239
204
.PP
240
205
clones a dataset row, including all data. 
241
206
.PP
242
 
Definition at line 92 of file table_dataset.c.
243
 
.PP
244
 
References netsnmp_table_row_s::data, memdup(), netsnmp_table_data_clone_row(), netsnmp_table_dataset_delete_row(), netsnmp_table_data_set_storage_s::next, and NULL.
245
 
.PP
246
 
Referenced by netsnmp_table_data_set_helper_handler().
 
207
Definition at line 89 of file table_dataset.c.
247
208
.SS "\fBnetsnmp_table_row\fP* netsnmp_table_data_set_create_row_from_defaults (\fBnetsnmp_table_data_set_storage\fP * defrow)"
248
209
.PP
249
210
creates a new row from an existing defined default set 
250
211
.PP
251
 
Definition at line 226 of file table_dataset.c.
252
 
.PP
253
 
References netsnmp_table_data_set_storage_s::column, netsnmp_table_data_set_storage_s::data, netsnmp_table_data_set_storage_s::data_len, netsnmp_create_table_data_row(), netsnmp_mark_row_column_writable(), netsnmp_set_row_column(), netsnmp_table_data_set_storage_s::next, NULL, netsnmp_table_data_set_storage_s::type, netsnmp_table_data_set_storage_s::voidp, and netsnmp_table_data_set_storage_s::writable.
254
 
.PP
255
 
Referenced by netsnmp_table_data_set_create_newrowstash().
 
212
Definition at line 223 of file table_dataset.c.
256
213
.SS "\fBnetsnmp_table_data_set_storage\fP* netsnmp_table_data_set_find_column (\fBnetsnmp_table_data_set_storage\fP * start, unsigned int column)"
257
214
.PP
258
215
Finds a column within a given storage set, given the pointer to the start of the storage set list. 
259
216
.PP
260
 
Definition at line 1175 of file table_dataset.c.
261
 
.PP
262
 
References netsnmp_table_data_set_storage_s::column, and netsnmp_table_data_set_storage_s::next.
263
 
.PP
264
 
Referenced by netsnmp_extract_table_data_set_column(), netsnmp_mark_row_column_writable(), netsnmp_set_row_column(), netsnmp_table_data_set_helper_handler(), and netsnmp_table_set_add_default_row().
 
217
Definition at line 1177 of file table_dataset.c.
265
218
.SS "\fBnetsnmp_table_row\fP* netsnmp_table_data_set_get_first_row (\fBnetsnmp_table_data_set\fP * table)"
266
219
.PP
267
220
returns the first row in the table 
268
221
.PP
269
 
Definition at line 1144 of file table_dataset.c.
270
 
.PP
271
 
References netsnmp_table_data_get_first_row(), and netsnmp_table_data_set_s::table.
 
222
Definition at line 1146 of file table_dataset.c.
272
223
.SS "\fBnetsnmp_table_row\fP* netsnmp_table_data_set_get_next_row (\fBnetsnmp_table_data_set\fP * table, \fBnetsnmp_table_row\fP * row)"
273
224
.PP
274
225
returns the next row in the table 
275
226
.PP
276
 
Definition at line 1151 of file table_dataset.c.
277
 
.PP
278
 
References netsnmp_table_data_get_next_row(), and netsnmp_table_data_set_s::table.
279
 
.SS "NETSNMP_INLINE void netsnmp_table_dataset_add_index (\fBnetsnmp_table_data_set\fP * table, u_char type)"
280
 
.PP
281
 
adds an index to the table. 
282
 
.PP
283
 
Call this repeatly for each index. 
 
227
Definition at line 1153 of file table_dataset.c.
 
228
.SS "void netsnmp_table_dataset_add_index (\fBnetsnmp_table_data_set\fP * table, u_char type)"
 
229
.PP
 
230
adds an index to the table. Call this repeatly for each index. 
284
231
.PP
285
232
\fBExamples: \fP
286
233
.in +1c
287
234
\fBdata_set.c\fP.
288
235
.PP
289
 
Definition at line 1276 of file table_dataset.c.
290
 
.PP
291
 
References netsnmp_table_data_set_s::table.
292
 
.PP
293
 
Referenced by netsnmp_table_set_add_indexes().
 
236
Definition at line 1278 of file table_dataset.c.
294
237
.SS "NETSNMP_INLINE void netsnmp_table_dataset_add_row (\fBnetsnmp_table_data_set\fP * table, \fBnetsnmp_table_row\fP * row)"
295
238
.PP
296
239
adds a new row to a dataset table 
299
242
.in +1c
300
243
\fBdata_set.c\fP.
301
244
.PP
302
 
Definition at line 171 of file table_dataset.c.
303
 
.PP
304
 
References netsnmp_table_data_add_row(), and netsnmp_table_data_set_s::table.
305
 
.PP
306
 
Referenced by netsnmp_table_data_set_helper_handler().
 
245
Definition at line 168 of file table_dataset.c.
307
246
.SS "NETSNMP_INLINE void netsnmp_table_dataset_delete_all_data (\fBnetsnmp_table_data_set_storage\fP * data)"
308
247
.PP
309
 
deletes all the data from this node and beyond in the linked list 
310
 
.PP
311
 
Definition at line 148 of file table_dataset.c.
312
 
.PP
313
 
References netsnmp_table_dataset_delete_data().
314
 
.PP
315
 
Referenced by netsnmp_table_dataset_delete_row(), and netsnmp_table_dataset_remove_and_delete_row().
 
248
deletes all the data from this \fBnode\fP and beyond in the linked list 
 
249
.PP
 
250
Definition at line 145 of file table_dataset.c.
316
251
.SS "NETSNMP_INLINE \fBnetsnmp_table_data_set_storage\fP* netsnmp_table_dataset_delete_data (\fBnetsnmp_table_data_set_storage\fP * data)"
317
252
.PP
318
 
deletes a single dataset table data. 
319
 
.PP
320
 
returns the (possibly still good) next pointer of the deleted data object. 
321
 
.PP
322
 
Definition at line 135 of file table_dataset.c.
323
 
.PP
324
 
References netsnmp_table_data_set_storage_s::data, netsnmp_table_data_set_storage_s::next, NULL, SNMP_FREE, and netsnmp_table_data_set_storage_s::voidp.
325
 
.PP
326
 
Referenced by netsnmp_table_dataset_delete_all_data().
 
253
deletes a single dataset table data. returns the (possibly still good) next pointer of the deleted data object. 
 
254
.PP
 
255
Definition at line 132 of file table_dataset.c.
327
256
.SS "NETSNMP_INLINE void netsnmp_table_dataset_delete_row (\fBnetsnmp_table_row\fP * row)"
328
257
.PP
329
 
deletes all the data from this node and beyond in the linked list 
330
 
.PP
331
 
Definition at line 158 of file table_dataset.c.
332
 
.PP
333
 
References netsnmp_table_data_delete_row(), and netsnmp_table_dataset_delete_all_data().
334
 
.PP
335
 
Referenced by netsnmp_table_data_set_clone_row(), and netsnmp_table_data_set_helper_handler().
 
258
deletes all the data from this \fBnode\fP and beyond in the linked list 
 
259
.PP
 
260
Definition at line 155 of file table_dataset.c.
336
261
.SS "NETSNMP_INLINE void netsnmp_table_dataset_remove_and_delete_row (\fBnetsnmp_table_data_set\fP * table, \fBnetsnmp_table_row\fP * row)"
337
262
.PP
338
263
removes a row from the table and then deletes it (and all its data) 
339
264
.PP
340
 
Definition at line 203 of file table_dataset.c.
341
 
.PP
342
 
References netsnmp_table_data_remove_and_delete_row(), netsnmp_table_dataset_delete_all_data(), and netsnmp_table_data_set_s::table.
343
 
.PP
344
 
Referenced by netsnmp_table_data_set_helper_handler().
 
265
Definition at line 200 of file table_dataset.c.
345
266
.SS "NETSNMP_INLINE void netsnmp_table_dataset_remove_row (\fBnetsnmp_table_data_set\fP * table, \fBnetsnmp_table_row\fP * row)"
346
267
.PP
347
268
removes a row from the table, but doesn't delete/free the column values 
348
269
.PP
349
 
Definition at line 192 of file table_dataset.c.
350
 
.PP
351
 
References netsnmp_table_data_remove_and_delete_row(), and netsnmp_table_data_set_s::table.
 
270
Definition at line 189 of file table_dataset.c.
352
271
.SS "NETSNMP_INLINE void netsnmp_table_dataset_replace_row (\fBnetsnmp_table_data_set\fP * table, \fBnetsnmp_table_row\fP * origrow, \fBnetsnmp_table_row\fP * newrow)"
353
272
.PP
354
273
adds a new row to a dataset table 
355
274
.PP
356
 
Definition at line 181 of file table_dataset.c.
357
 
.PP
358
 
References netsnmp_table_data_replace_row(), and netsnmp_table_data_set_s::table.
359
 
.PP
360
 
Referenced by netsnmp_table_data_set_helper_handler().
 
275
Definition at line 178 of file table_dataset.c.
361
276
.SS "int netsnmp_table_set_add_default_row (\fBnetsnmp_table_data_set\fP * table_set, unsigned int column, int type, int writable, void * default_value, size_t default_value_len)"
362
277
.PP
363
 
adds a new default row to a table_set. 
364
 
.PP
365
 
Arguments should be the table_set, column number, variable type and finally a 1 if it is allowed to be writable, or a 0 if not. If the default_value field is not NULL, it will be used to populate new valuse in that column fro newly created rows. It is copied into the storage template (free your calling argument).
 
278
adds a new default row to a table_set. Arguments should be the table_set, column number, \fBvariable\fP type and finally a 1 if it is allowed to be writable, or a 0 if not. If the default_value field is not NULL, it will be used to populate new valuse in that column fro newly created rows. It is copied into the storage template (free your calling argument).
366
279
.PP
367
280
returns SNMPERR_SUCCESS or SNMPERR_FAILURE 
368
281
.PP
369
 
Definition at line 252 of file table_dataset.c.
370
 
.PP
371
 
References netsnmp_table_data_set_storage_s::column, netsnmp_table_data_set_storage_s::data, netsnmp_table_data_set_storage_s::data_len, netsnmp_table_data_set_s::default_row, memdup(), netsnmp_table_data_set_find_column(), netsnmp_table_data_set_storage_s::next, NULL, snmp_log(), SNMP_MALLOC_TYPEDEF, netsnmp_table_data_set_storage_s::type, netsnmp_table_data_set_storage_s::voidp, and netsnmp_table_data_set_storage_s::writable.
372
 
.PP
373
 
Referenced by netsnmp_config_parse_table_set(), and netsnmp_table_set_multi_add_default_row().
 
282
Definition at line 249 of file table_dataset.c.
374
283
.SS "void netsnmp_table_set_add_indexes (\fBnetsnmp_table_data_set\fP * tset,  ...)"
375
284
.PP
376
 
adds multiple indexes to a table_dataset helper object. 
377
 
.PP
378
 
To end the list, use a 0 after the list of ASN index types. 
379
 
.PP
380
 
Definition at line 1287 of file table_dataset.c.
381
 
.PP
382
 
References netsnmp_table_dataset_add_index().
 
285
adds multiple indexes to a table_dataset helper object. To end the list, use a 0 after the list of ASN index types. 
 
286
.PP
 
287
Definition at line 1289 of file table_dataset.c.
383
288
.SS "void netsnmp_table_set_multi_add_default_row (\fBnetsnmp_table_data_set\fP * tset,  ...)"
384
289
.PP
385
 
adds multiple data column definitions to each row. 
386
 
.PP
387
 
Functionally, this is a wrapper around calling netsnmp_table_set_add_default_row repeatedly for you. 
 
290
adds multiple data column definitions to each row. Functionally, this is a wrapper around calling netsnmp_table_set_add_default_row repeatedly for you. 
388
291
.PP
389
292
\fBExamples: \fP
390
293
.in +1c
391
294
\fBdata_set.c\fP.
392
295
.PP
393
 
Definition at line 313 of file table_dataset.c.
394
 
.PP
395
 
References netsnmp_table_set_add_default_row().
 
296
Definition at line 310 of file table_dataset.c.
 
297
.SH "Author"
 
298
.PP 
 
299
Generated automatically by Doxygen for net-snmp from the source code.