~ubuntu-branches/ubuntu/trusty/net-snmp/trusty

« back to all changes in this revision

Viewing changes to man/netsnmp_table_data.3

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2004-09-13 12:06:21 UTC
  • Revision ID: james.westby@ubuntu.com-20040913120621-g952ntonlleihcvm
Tags: upstream-5.1.1
ImportĀ upstreamĀ versionĀ 5.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.TH "table_data: Helps you implement a table with datamatted storage." 3 "19 Mar 2004" "net-snmp" \" -*- nroff -*-
 
2
.ad l
 
3
.nh
 
4
.SH NAME
 
5
table_data: Helps you implement a table with datamatted storage. \- This helper helps you implement a table where all the indexes are expected to be stored within the agent itself and not in some external storage location. 
 
6
More...
 
7
.SS "Modules"
 
8
 
 
9
.in +1c
 
10
.ti -1c
 
11
.RI "\fBtable_dataset: Helps you implement a table with automatted storage.\fP"
 
12
.br
 
13
.RI "\fIThis 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.\fP"
 
14
.PP
 
15
 
 
16
.in -1c
 
17
.SS "Functions"
 
18
 
 
19
.in +1c
 
20
.ti -1c
 
21
.RI "void \fBnetsnmp_table_data_generate_index_oid\fP (netsnmp_table_row *row)"
 
22
.br
 
23
.RI "\fIgenerates the index portion of an table oid from a varlist.\fP"
 
24
.ti -1c
 
25
.RI "int \fBnetsnmp_table_data_add_row\fP (netsnmp_table_data *table, netsnmp_table_row *row)"
 
26
.br
 
27
.RI "\fIAdds a row of data to a given table (stored in proper lexographical order).\fP"
 
28
.ti -1c
 
29
.RI "netsnmp_table_row * \fBnetsnmp_table_data_remove_row\fP (netsnmp_table_data *table, netsnmp_table_row *row)"
 
30
.br
 
31
.RI "\fIremoves a row of data to a given table and returns it (no free's called)\fP"
 
32
.ti -1c
 
33
.RI "void * \fBnetsnmp_table_data_delete_row\fP (netsnmp_table_row *row)"
 
34
.br
 
35
.RI "\fIdeletes a row's memory.\fP"
 
36
.ti -1c
 
37
.RI "void * \fBnetsnmp_table_data_remove_and_delete_row\fP (netsnmp_table_data *table, netsnmp_table_row *row)"
 
38
.br
 
39
.RI "\fIremoves and frees a row of data to a given table and returns the void *\fP"
 
40
.ti -1c
 
41
.RI "NETSNMP_INLINE void \fBnetsnmp_table_data_replace_row\fP (netsnmp_table_data *table, netsnmp_table_row *origrow, netsnmp_table_row *newrow)"
 
42
.br
 
43
.RI "\fIswaps out origrow with newrow.\fP"
 
44
.ti -1c
 
45
.RI "netsnmp_table_row * \fBnetsnmp_table_data_get\fP (netsnmp_table_data *table, netsnmp_variable_list *indexes)"
 
46
.br
 
47
.RI "\fIfinds the data in 'datalist' stored at 'indexes'\fP"
 
48
.ti -1c
 
49
.RI "netsnmp_table_row * \fBnetsnmp_table_data_get_from_oid\fP (netsnmp_table_data *table, oid *searchfor, size_t searchfor_len)"
 
50
.br
 
51
.RI "\fIfinds the data in 'datalist' stored at the searchfor oid\fP"
 
52
.ti -1c
 
53
.RI "\fBnetsnmp_mib_handler\fP * \fBnetsnmp_get_table_data_handler\fP (netsnmp_table_data *table)"
 
54
.br
 
55
.RI "\fICreates a table_data handler and returns it.\fP"
 
56
.ti -1c
 
57
.RI "int \fBnetsnmp_register_table_data\fP (\fBnetsnmp_handler_registration\fP *reginfo, netsnmp_table_data *table, netsnmp_table_registration_info *table_info)"
 
58
.br
 
59
.RI "\fIregisters a handler as a data table.\fP"
 
60
.ti -1c
 
61
.RI "int \fBnetsnmp_register_read_only_table_data\fP (\fBnetsnmp_handler_registration\fP *reginfo, netsnmp_table_data *table, netsnmp_table_registration_info *table_info)"
 
62
.br
 
63
.RI "\fIregisters a handler as a read-only data table If table_info != NULL, it registers it as a normal table too.\fP"
 
64
.ti -1c
 
65
.RI "int \fBnetsnmp_table_data_helper_handler\fP (\fBnetsnmp_mib_handler\fP *handler, \fBnetsnmp_handler_registration\fP *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests)"
 
66
.br
 
67
.RI "\fIThe helper handler that takes care of passing a specific row of data down to the lower handler(s).\fP"
 
68
.ti -1c
 
69
.RI "netsnmp_table_data * \fBnetsnmp_create_table_data\fP (const char *name)"
 
70
.br
 
71
.RI "\fIcreates and returns a pointer to table data set\fP"
 
72
.ti -1c
 
73
.RI "netsnmp_table_row * \fBnetsnmp_create_table_data_row\fP (void)"
 
74
.br
 
75
.RI "\fIcreates and returns a pointer to table data set\fP"
 
76
.ti -1c
 
77
.RI "netsnmp_table_row * \fBnetsnmp_extract_table_row\fP (netsnmp_request_info *request)"
 
78
.br
 
79
.RI "\fIextracts the row being accessed passed from the table_data helper\fP"
 
80
.ti -1c
 
81
.RI "void * \fBnetsnmp_extract_table_row_data\fP (netsnmp_request_info *request)"
 
82
.br
 
83
.RI "\fIextracts the data from the row being accessed passed from the table_data helper\fP"
 
84
.ti -1c
 
85
.RI "int \fBnetsnmp_table_data_build_result\fP (\fBnetsnmp_handler_registration\fP *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *request, netsnmp_table_row *row, int column, u_char type, u_char *result_data, size_t result_data_len)"
 
86
.br
 
87
.RI "\fIbuilds a result given a row, a varbind to set and the data\fP"
 
88
.ti -1c
 
89
.RI "netsnmp_table_row * \fBnetsnmp_table_data_clone_row\fP (netsnmp_table_row *row)"
 
90
.br
 
91
.RI "\fIclones a data row.\fP"
 
92
.in -1c
 
93
.SH "DETAILED DESCRIPTION"
 
94
.PP 
 
95
This helper helps you implement a table where all the indexes are expected to be stored within the agent itself and not in some external storage location.
 
96
.PP
 
97
It can be used to store a list of rows, where a row consists of the indexes to the table and a generic data pointer. You can then implement a subhandler which is passed the exact row definition and data it must return data for or accept data for. Complex GETNEXT handling is greatly simplified in this case. 
 
98
.SH "FUNCTION DOCUMENTATION"
 
99
.PP 
 
100
.SS "netsnmp_table_data* netsnmp_create_table_data (const char * name)"
 
101
.PP
 
102
creates and returns a pointer to table data set
 
103
.PP
 
104
Definition at line 529 of file table_data.c.
 
105
.PP
 
106
References SNMP_MALLOC_TYPEDEF.
 
107
.PP
 
108
Referenced by netsnmp_create_table_data_set().
 
109
.SS "netsnmp_table_row* netsnmp_create_table_data_row (void)"
 
110
.PP
 
111
creates and returns a pointer to table data set
 
112
.PP
 
113
\fBExamples: \fP
 
114
.in +1c
 
115
\fBdata_set.c\fP.
 
116
.PP
 
117
Definition at line 539 of file table_data.c.
 
118
.PP
 
119
References SNMP_MALLOC_TYPEDEF.
 
120
.PP
 
121
Referenced by netsnmp_table_data_set_create_row_from_defaults().
 
122
.SS "netsnmp_table_row* netsnmp_extract_table_row (netsnmp_request_info * request)"
 
123
.PP
 
124
extracts the row being accessed passed from the table_data helper
 
125
.PP
 
126
Definition at line 547 of file table_data.c.
 
127
.PP
 
128
References netsnmp_request_get_list_data().
 
129
.PP
 
130
Referenced by netsnmp_extract_table_row_data(), and netsnmp_table_data_set_helper_handler().
 
131
.SS "void* netsnmp_extract_table_row_data (netsnmp_request_info * request)"
 
132
.PP
 
133
extracts the data from the row being accessed passed from the table_data helper
 
134
.PP
 
135
Definition at line 556 of file table_data.c.
 
136
.PP
 
137
References netsnmp_extract_table_row().
 
138
.PP
 
139
Referenced by netsnmp_extract_table_data_set_column().
 
140
.SS "\fBnetsnmp_mib_handler\fP* netsnmp_get_table_data_handler (netsnmp_table_data * table)"
 
141
.PP
 
142
Creates a table_data handler and returns it.
 
143
.PP
 
144
Definition at line 236 of file table_data.c.
 
145
.PP
 
146
References netsnmp_mib_handler_s::myvoid, netsnmp_create_handler(), netsnmp_table_data_helper_handler(), and snmp_log().
 
147
.PP
 
148
Referenced by netsnmp_register_table_data().
 
149
.SS "int netsnmp_register_read_only_table_data (\fBnetsnmp_handler_registration\fP * reginfo, netsnmp_table_data * table, netsnmp_table_registration_info * table_info)"
 
150
.PP
 
151
registers a handler as a read-only data table If table_info != NULL, it registers it as a normal table too.
 
152
.PP
 
153
Definition at line 269 of file table_data.c.
 
154
.PP
 
155
References netsnmp_get_read_only_handler(), netsnmp_inject_handler(), and netsnmp_register_table_data().
 
156
.SS "int netsnmp_register_table_data (\fBnetsnmp_handler_registration\fP * reginfo, netsnmp_table_data * table, netsnmp_table_registration_info * table_info)"
 
157
.PP
 
158
registers a handler as a data table.
 
159
.PP
 
160
If table_info != NULL, it registers it as a normal table too. 
 
161
.PP
 
162
Definition at line 258 of file table_data.c.
 
163
.PP
 
164
References netsnmp_get_table_data_handler(), netsnmp_inject_handler(), and netsnmp_register_table().
 
165
.PP
 
166
Referenced by netsnmp_register_read_only_table_data(), and netsnmp_register_table_data_set().
 
167
.SS "int netsnmp_table_data_add_row (netsnmp_table_data * table, netsnmp_table_row * row)"
 
168
.PP
 
169
Adds a row of data to a given table (stored in proper lexographical order).
 
170
.PP
 
171
returns SNMPERR_SUCCESS on successful addition. or SNMPERR_GENERR on failure (E.G., indexes already existed) 
 
172
.PP
 
173
Definition at line 51 of file table_data.c.
 
174
.PP
 
175
References netsnmp_table_data_generate_index_oid(), snmp_log(), and snmp_oid_compare().
 
176
.PP
 
177
Referenced by netsnmp_table_data_replace_row(), and netsnmp_table_dataset_add_row().
 
178
.SS "int netsnmp_table_data_build_result (\fBnetsnmp_handler_registration\fP * reginfo, netsnmp_agent_request_info * reqinfo, netsnmp_request_info * request, netsnmp_table_row * row, int column, u_char type, u_char * result_data, size_t result_data_len)"
 
179
.PP
 
180
builds a result given a row, a varbind to set and the data
 
181
.PP
 
182
Definition at line 568 of file table_data.c.
 
183
.PP
 
184
References netsnmp_agent_request_info_s::mode, netsnmp_request_info_s::requestvb, netsnmp_handler_registration_s::rootoid, netsnmp_handler_registration_s::rootoid_len, and snmp_set_var_typed_value().
 
185
.PP
 
186
Referenced by netsnmp_table_data_helper_handler(), and netsnmp_table_data_set_helper_handler().
 
187
.SS "netsnmp_table_row* netsnmp_table_data_clone_row (netsnmp_table_row * row)"
 
188
.PP
 
189
clones a data row.
 
190
.PP
 
191
DOES NOT CLONE THE CONTAINED DATA. 
 
192
.PP
 
193
Definition at line 602 of file table_data.c.
 
194
.PP
 
195
References memdup().
 
196
.PP
 
197
Referenced by netsnmp_table_data_set_clone_row().
 
198
.SS "void* netsnmp_table_data_delete_row (netsnmp_table_row * row)"
 
199
.PP
 
200
deletes a row's memory.
 
201
.PP
 
202
returns the void data that it doesn't know how to delete. 
 
203
.PP
 
204
Definition at line 150 of file table_data.c.
 
205
.PP
 
206
References SNMP_FREE.
 
207
.PP
 
208
Referenced by netsnmp_table_data_remove_and_delete_row(), and netsnmp_table_dataset_delete_row().
 
209
.SS "void netsnmp_table_data_generate_index_oid (netsnmp_table_row * row)"
 
210
.PP
 
211
generates the index portion of an table oid from a varlist.
 
212
.PP
 
213
Definition at line 39 of file table_data.c.
 
214
.PP
 
215
Referenced by netsnmp_table_data_add_row().
 
216
.SS "netsnmp_table_row* netsnmp_table_data_get (netsnmp_table_data * table, netsnmp_variable_list * indexes)"
 
217
.PP
 
218
finds the data in 'datalist' stored at 'indexes'
 
219
.PP
 
220
Definition at line 204 of file table_data.c.
 
221
.PP
 
222
References netsnmp_table_data_get_from_oid().
 
223
.SS "netsnmp_table_row* netsnmp_table_data_get_from_oid (netsnmp_table_data * table, oid * searchfor, size_t searchfor_len)"
 
224
.PP
 
225
finds the data in 'datalist' stored at the searchfor oid
 
226
.PP
 
227
Definition at line 218 of file table_data.c.
 
228
.PP
 
229
References snmp_oid_compare().
 
230
.PP
 
231
Referenced by netsnmp_table_data_get(), and netsnmp_table_data_helper_handler().
 
232
.SS "int netsnmp_table_data_helper_handler (\fBnetsnmp_mib_handler\fP * handler, \fBnetsnmp_handler_registration\fP * reginfo, netsnmp_agent_request_info * reqinfo, netsnmp_request_info * requests)"
 
233
.PP
 
234
The helper handler that takes care of passing a specific row of data down to the lower handler(s).
 
235
.PP
 
236
It sets request->processed if the request should not be handled. 
 
237
.PP
 
238
Definition at line 285 of file table_data.c.
 
239
.PP
 
240
References netsnmp_table_request_info_s::colnum, netsnmp_table_registration_info_s::max_column, netsnmp_table_registration_info_s::min_column, netsnmp_agent_request_info_s::mode, netsnmp_mib_handler_s::myvoid, variable_list::name, variable_list::name_length, netsnmp_call_next_handler(), netsnmp_extract_table_info(), netsnmp_find_table_registration_info(), netsnmp_request_add_list_data(), netsnmp_set_request_error(), netsnmp_table_data_build_result(), netsnmp_table_data_get_from_oid(), netsnmp_request_info_s::next, netsnmp_request_info_s::processed, netsnmp_request_info_s::requestvb, netsnmp_handler_registration_s::rootoid, netsnmp_handler_registration_s::rootoid_len, SNMP_MIN, snmp_oid_compare(), and variable_list::type.
 
241
.PP
 
242
Referenced by netsnmp_get_table_data_handler().
 
243
.SS "void* netsnmp_table_data_remove_and_delete_row (netsnmp_table_data * table, netsnmp_table_row * row)"
 
244
.PP
 
245
removes and frees a row of data to a given table and returns the void *
 
246
.PP
 
247
returns the void * data on successful deletion. or NULL on failure (bad arguments) 
 
248
.PP
 
249
Definition at line 179 of file table_data.c.
 
250
.PP
 
251
References netsnmp_table_data_delete_row(), and netsnmp_table_data_remove_row().
 
252
.PP
 
253
Referenced by netsnmp_table_dataset_remove_and_delete_row(), and netsnmp_table_dataset_remove_row().
 
254
.SS "netsnmp_table_row* netsnmp_table_data_remove_row (netsnmp_table_data * table, netsnmp_table_row * row)"
 
255
.PP
 
256
removes a row of data to a given table and returns it (no free's called)
 
257
.PP
 
258
returns the row pointer itself on successful removing. or NULL on failure (bad arguments) 
 
259
.PP
 
260
Definition at line 130 of file table_data.c.
 
261
.PP
 
262
Referenced by netsnmp_table_data_remove_and_delete_row(), and netsnmp_table_data_replace_row().
 
263
.SS "NETSNMP_INLINE void netsnmp_table_data_replace_row (netsnmp_table_data * table, netsnmp_table_row * origrow, netsnmp_table_row * newrow)"
 
264
.PP
 
265
swaps out origrow with newrow.
 
266
.PP
 
267
This does *not* delete/free anything! 
 
268
.PP
 
269
Definition at line 194 of file table_data.c.
 
270
.PP
 
271
References netsnmp_table_data_add_row(), and netsnmp_table_data_remove_row().
 
272
.PP
 
273
Referenced by netsnmp_table_dataset_replace_row().