added files
[bcm963xx.git] / userapps / opensource / net-snmp / man / netsnmp_table_data.3
1 .TH "table_data: Helps you implement a table with datamatted storage." 3 "17 Mar 2003" "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 "netsnmp_mib_handler * \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 (netsnmp_handler_registration *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 (netsnmp_handler_registration *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 (netsnmp_mib_handler *handler, netsnmp_handler_registration *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 (netsnmp_handler_registration *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 525 of file table_data.c.
105 .SS "netsnmp_table_row* netsnmp_create_table_data_row (void)"
106 .PP
107 creates and returns a pointer to table data set.
108 .PP
109 \fBExamples: \fP
110 .in +1c
111 \fBdata_set.c\fP.
112 .PP
113 Definition at line 535 of file table_data.c.
114 .SS "netsnmp_table_row* netsnmp_extract_table_row (netsnmp_request_info * request)"
115 .PP
116 extracts the row being accessed passed from the table_data helper.
117 .PP
118 Definition at line 543 of file table_data.c.
119 .SS "void* netsnmp_extract_table_row_data (netsnmp_request_info * request)"
120 .PP
121 extracts the data from the row being accessed passed from the table_data helper.
122 .PP
123 Definition at line 552 of file table_data.c.
124 .SS "netsnmp_mib_handler* netsnmp_get_table_data_handler (netsnmp_table_data * table)"
125 .PP
126 Creates a table_data handler and returns it.
127 .PP
128 Definition at line 236 of file table_data.c.
129 .SS "int netsnmp_register_read_only_table_data (netsnmp_handler_registration * reginfo, netsnmp_table_data * table, netsnmp_table_registration_info * table_info)"
130 .PP
131 registers a handler as a read-only data table If table_info != NULL, it registers it as a normal table too.
132 .PP
133 Definition at line 269 of file table_data.c.
134 .SS "int netsnmp_register_table_data (netsnmp_handler_registration * reginfo, netsnmp_table_data * table, netsnmp_table_registration_info * table_info)"
135 .PP
136 registers a handler as a data table.
137 .PP
138 If table_info != NULL, it registers it as a normal table too. 
139 .PP
140 Definition at line 258 of file table_data.c.
141 .SS "int netsnmp_table_data_add_row (netsnmp_table_data * table, netsnmp_table_row * row)"
142 .PP
143 Adds a row of data to a given table (stored in proper lexographical order).
144 .PP
145 returns SNMPERR_SUCCESS on successful addition. or SNMPERR_GENERR on failure (E.G., indexes already existed) 
146 .PP
147 Definition at line 51 of file table_data.c.
148 .SS "int netsnmp_table_data_build_result (netsnmp_handler_registration * 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)"
149 .PP
150 builds a result given a row, a varbind to set and the data.
151 .PP
152 Definition at line 564 of file table_data.c.
153 .SS "netsnmp_table_row* netsnmp_table_data_clone_row (netsnmp_table_row * row)"
154 .PP
155 clones a data row.
156 .PP
157 DOES NOT CLONE THE CONTAINED DATA. 
158 .PP
159 Definition at line 598 of file table_data.c.
160 .SS "void* netsnmp_table_data_delete_row (netsnmp_table_row * row)"
161 .PP
162 deletes a row's memory.
163 .PP
164 returns the void data that it doesn't know how to delete. 
165 .PP
166 Definition at line 150 of file table_data.c.
167 .SS "void netsnmp_table_data_generate_index_oid (netsnmp_table_row * row)"
168 .PP
169 generates the index portion of an table oid from a varlist.
170 .PP
171 Definition at line 39 of file table_data.c.
172 .SS "netsnmp_table_row* netsnmp_table_data_get (netsnmp_table_data * table, netsnmp_variable_list * indexes)"
173 .PP
174 finds the data in 'datalist' stored at 'indexes'.
175 .PP
176 Definition at line 204 of file table_data.c.
177 .SS "netsnmp_table_row* netsnmp_table_data_get_from_oid (netsnmp_table_data * table, oid * searchfor, size_t searchfor_len)"
178 .PP
179 finds the data in 'datalist' stored at the searchfor oid.
180 .PP
181 Definition at line 218 of file table_data.c.
182 .SS "int netsnmp_table_data_helper_handler (netsnmp_mib_handler * handler, netsnmp_handler_registration * reginfo, netsnmp_agent_request_info * reqinfo, netsnmp_request_info * requests)"
183 .PP
184 The helper handler that takes care of passing a specific row of data down to the lower handler(s).
185 .PP
186 It sets request->processed if the request should not be handled. 
187 .PP
188 Definition at line 285 of file table_data.c.
189 .SS "void* netsnmp_table_data_remove_and_delete_row (netsnmp_table_data * table, netsnmp_table_row * row)"
190 .PP
191 removes and frees a row of data to a given table and returns the void *.
192 .PP
193 returns the void * data on successful deletion. or NULL on failure (bad arguments) 
194 .PP
195 Definition at line 179 of file table_data.c.
196 .SS "netsnmp_table_row* netsnmp_table_data_remove_row (netsnmp_table_data * table, netsnmp_table_row * row)"
197 .PP
198 removes a row of data to a given table and returns it (no free's called).
199 .PP
200 returns the row pointer itself on successful removing. or NULL on failure (bad arguments) 
201 .PP
202 Definition at line 130 of file table_data.c.
203 .SS "NETSNMP_INLINE void netsnmp_table_data_replace_row (netsnmp_table_data * table, netsnmp_table_row * origrow, netsnmp_table_row * newrow)"
204 .PP
205 swaps out origrow with newrow.
206 .PP
207 This does *not* delete/free anything! 
208 .PP
209 Definition at line 194 of file table_data.c.