OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / user / net-snmp / man / netsnmp_data_list.3
1 .TH "generic linked-list data handling with a string as a key." 3 "23 Sep 2009" "Version 5.5" "net-snmp" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 generic linked-list data handling with a string as a key. \- 
6 .SS "Functions"
7
8 .in +1c
9 .ti -1c
10 .RI "NETSNMP_INLINE void \fBnetsnmp_free_list_data\fP (\fBnetsnmp_data_list\fP *\fBnode\fP)"
11 .br
12 .RI "\fIfrees the data and a name at a given data_list \fBnode\fP. \fP"
13 .ti -1c
14 .RI "NETSNMP_INLINE void \fBnetsnmp_free_all_list_data\fP (\fBnetsnmp_data_list\fP *head)"
15 .br
16 .RI "\fIfrees all data and nodes in a list. \fP"
17 .ti -1c
18 .RI "NETSNMP_INLINE \fBnetsnmp_data_list\fP * \fBnetsnmp_create_data_list\fP (const char *name, void *data, Netsnmp_Free_List_Data *beer)"
19 .br
20 .RI "\fIadds creates a data_list \fBnode\fP given a name, data and a free function ptr. \fP"
21 .ti -1c
22 .RI "NETSNMP_INLINE void \fBnetsnmp_data_list_add_node\fP (\fBnetsnmp_data_list\fP **head, \fBnetsnmp_data_list\fP *\fBnode\fP)"
23 .br
24 .RI "\fIadds data to a datalist \fP"
25 .ti -1c
26 .RI "NETSNMP_INLINE void \fBnetsnmp_add_list_data\fP (\fBnetsnmp_data_list\fP **head, \fBnetsnmp_data_list\fP *\fBnode\fP)"
27 .br
28 .RI "\fIadds data to a datalist \fP"
29 .ti -1c
30 .RI "NETSNMP_INLINE \fBnetsnmp_data_list\fP * \fBnetsnmp_data_list_add_data\fP (\fBnetsnmp_data_list\fP **head, const char *name, void *data, Netsnmp_Free_List_Data *beer)"
31 .br
32 .RI "\fIadds data to a datalist \fP"
33 .ti -1c
34 .RI "NETSNMP_INLINE void * \fBnetsnmp_get_list_data\fP (\fBnetsnmp_data_list\fP *head, const char *name)"
35 .br
36 .RI "\fIreturns a data_list node's data for a given name within a data_list \fP"
37 .ti -1c
38 .RI "NETSNMP_INLINE \fBnetsnmp_data_list\fP * \fBnetsnmp_get_list_node\fP (\fBnetsnmp_data_list\fP *head, const char *name)"
39 .br
40 .RI "\fIreturns a data_list \fBnode\fP for a given name within a data_list \fP"
41 .ti -1c
42 .RI "int \fBnetsnmp_remove_list_node\fP (\fBnetsnmp_data_list\fP **realhead, const char *name)"
43 .br
44 .RI "\fIRemoves a named \fBnode\fP from a data_list (and frees it). \fP"
45 .ti -1c
46 .RI "void \fBnetsnmp_register_save_list\fP (\fBnetsnmp_data_list\fP **datalist, const char *type, const char *token, Netsnmp_Save_List_Data *data_list_save_ptr, Netsnmp_Read_List_Data *data_list_read_ptr, Netsnmp_Free_List_Data *data_list_free_ptr)"
47 .br
48 .RI "\fIregisters to store a data_list set of data at persistent storage time \fP"
49 .ti -1c
50 .RI "int \fBnetsnmp_save_all_data_callback\fP (int major, int minor, void *serverarg, void *clientarg)"
51 .br
52 .RI "\fIintended to be registerd as a callback operation. \fP"
53 .ti -1c
54 .RI "int \fBnetsnmp_save_all_data\fP (\fBnetsnmp_data_list\fP *head, const char *type, const char *token, Netsnmp_Save_List_Data *data_list_save_ptr)"
55 .br
56 .RI "\fIintended to be called as a callback during persistent save operations. \fP"
57 .ti -1c
58 .RI "void \fBnetsnmp_read_data_callback\fP (const char *token, char *line)"
59 .br
60 .RI "\fIintended to be registerd as a .conf parser It should be registered using: \fP"
61 .in -1c
62 .SH "Function Documentation"
63 .PP 
64 .SS "NETSNMP_INLINE void netsnmp_add_list_data (\fBnetsnmp_data_list\fP ** head, \fBnetsnmp_data_list\fP * node)"
65 .PP
66 adds data to a datalist depreciated: use \fBnetsnmp_data_list_add_node()\fP
67 .PP
68 \fBNote:\fP
69 .RS 4
70 netsnmp_data_list_add_node is preferred 
71 .RE
72 .PP
73 \fBParameters:\fP
74 .RS 4
75 \fIhead\fP a pointer to the head \fBnode\fP of a data_list 
76 .br
77 \fI\fBnode\fP\fP a \fBnode\fP to stash in the data_list 
78 .RE
79 .PP
80
81 .PP
82 Definition at line 117 of file data_list.c.
83 .SS "NETSNMP_INLINE \fBnetsnmp_data_list\fP* netsnmp_create_data_list (const char * name, void * data, Netsnmp_Free_List_Data * beer)"
84 .PP
85 adds creates a data_list \fBnode\fP given a name, data and a free function ptr. \fBParameters:\fP
86 .RS 4
87 \fIname\fP the name of the \fBnode\fP to cache the data. 
88 .br
89 \fIdata\fP the data to be stored under that name 
90 .br
91 \fIbeer\fP A function that can free the data pointer (in the future) 
92 .RE
93 .PP
94 \fBReturns:\fP
95 .RS 4
96 a newly created data_list \fBnode\fP which can be given to the netsnmp_add_list_data function. 
97 .RE
98 .PP
99
100 .PP
101 \fBExamples: \fP
102 .in +1c
103 \fBdelayed_instance.c\fP.
104 .PP
105 Definition at line 53 of file data_list.c.
106 .SS "NETSNMP_INLINE \fBnetsnmp_data_list\fP* netsnmp_data_list_add_data (\fBnetsnmp_data_list\fP ** head, const char * name, void * data, Netsnmp_Free_List_Data * beer)"
107 .PP
108 adds data to a datalist \fBParameters:\fP
109 .RS 4
110 \fIhead\fP a pointer to the head \fBnode\fP of a data_list 
111 .br
112 \fIname\fP the name of the \fBnode\fP to cache the data. 
113 .br
114 \fIdata\fP the data to be stored under that name 
115 .br
116 \fIbeer\fP A function that can free the data pointer (in the future) 
117 .RE
118 .PP
119 \fBReturns:\fP
120 .RS 4
121 a newly created data_list \fBnode\fP which was inserted in the list 
122 .RE
123 .PP
124
125 .PP
126 Definition at line 130 of file data_list.c.
127 .SS "NETSNMP_INLINE void netsnmp_data_list_add_node (\fBnetsnmp_data_list\fP ** head, \fBnetsnmp_data_list\fP * node)"
128 .PP
129 adds data to a datalist \fBParameters:\fP
130 .RS 4
131 \fIhead\fP a pointer to the head \fBnode\fP of a data_list 
132 .br
133 \fI\fBnode\fP\fP a \fBnode\fP to stash in the data_list 
134 .RE
135 .PP
136
137 .PP
138 Definition at line 74 of file data_list.c.
139 .SS "NETSNMP_INLINE void netsnmp_free_all_list_data (\fBnetsnmp_data_list\fP * head)"
140 .PP
141 frees all data and nodes in a list. \fBParameters:\fP
142 .RS 4
143 \fIhead\fP the top \fBnode\fP of the list to be freed. 
144 .RE
145 .PP
146
147 .PP
148 Definition at line 35 of file data_list.c.
149 .SS "NETSNMP_INLINE void netsnmp_free_list_data (\fBnetsnmp_data_list\fP * node)"
150 .PP
151 frees the data and a name at a given data_list \fBnode\fP. Note that this doesn't free the \fBnode\fP itself. 
152 .PP
153 \fBParameters:\fP
154 .RS 4
155 \fI\fBnode\fP\fP the \fBnode\fP for which the data should be freed 
156 .RE
157 .PP
158
159 .PP
160 Definition at line 19 of file data_list.c.
161 .SS "NETSNMP_INLINE void* netsnmp_get_list_data (\fBnetsnmp_data_list\fP * head, const char * name)"
162 .PP
163 returns a data_list node's data for a given name within a data_list \fBParameters:\fP
164 .RS 4
165 \fIhead\fP the head \fBnode\fP of a data_list 
166 .br
167 \fIname\fP the name to find 
168 .RE
169 .PP
170 \fBReturns:\fP
171 .RS 4
172 a pointer to the data cached at that \fBnode\fP 
173 .RE
174 .PP
175
176 .PP
177 Definition at line 155 of file data_list.c.
178 .SS "NETSNMP_INLINE \fBnetsnmp_data_list\fP* netsnmp_get_list_node (\fBnetsnmp_data_list\fP * head, const char * name)"
179 .PP
180 returns a data_list \fBnode\fP for a given name within a data_list \fBParameters:\fP
181 .RS 4
182 \fIhead\fP the head \fBnode\fP of a data_list 
183 .br
184 \fIname\fP the name to find 
185 .RE
186 .PP
187 \fBReturns:\fP
188 .RS 4
189 a pointer to the data_list \fBnode\fP 
190 .RE
191 .PP
192
193 .PP
194 Definition at line 173 of file data_list.c.
195 .SS "void netsnmp_read_data_callback (const char * token, char * line)"
196 .PP
197 intended to be registerd as a .conf parser It should be registered using: register_app_config_handler('token', netsnmp_read_data_callback, XXX)
198 .PP
199 where INFO_POINTER is a pointer to a netsnmp_data_list_saveinfo object containing apporpriate registration information 
200 .PP
201 \fBTodo\fP
202 .RS 4
203 make netsnmp_read_data_callback deal with a free routine 
204 .RE
205 .PP
206
207 .PP
208 Definition at line 326 of file data_list.c.
209 .SS "void netsnmp_register_save_list (\fBnetsnmp_data_list\fP ** datalist, const char * type, const char * token, Netsnmp_Save_List_Data * data_list_save_ptr, Netsnmp_Read_List_Data * data_list_read_ptr, Netsnmp_Free_List_Data * data_list_free_ptr)"
210 .PP
211 registers to store a data_list set of data at persistent storage time \fBParameters:\fP
212 .RS 4
213 \fIdatalist\fP the data to be saved 
214 .br
215 \fItype\fP the name of the application to save the data as. If left NULL the default application name that was registered during the init_snmp call will be used (recommended). 
216 .br
217 \fItoken\fP the unique token identifier string to use as the first word in the persistent file line. 
218 .br
219 \fIdata_list_save_ptr\fP a function pointer which will be called to save the rest of the data to a buffer. 
220 .br
221 \fIdata_list_read_ptr\fP a function pointer which can read the remainder of a saved line and return the application specific void * pointer. 
222 .br
223 \fIdata_list_free_ptr\fP a function pointer which will be passed to the data \fBnode\fP for freeing it in the future when/if the list/node is cleaned up or destroyed. 
224 .RE
225 .PP
226
227 .PP
228 \fBTodo\fP
229 .RS 4
230 netsnmp_register_save_list should handle the same token name being saved from different types? 
231 .RE
232 .PP
233
234 .PP
235 Definition at line 224 of file data_list.c.
236 .SS "int netsnmp_remove_list_node (\fBnetsnmp_data_list\fP ** realhead, const char * name)"
237 .PP
238 Removes a named \fBnode\fP from a data_list (and frees it). \fBParameters:\fP
239 .RS 4
240 \fIrealhead\fP a pointer to the head \fBnode\fP of a data_list 
241 .br
242 \fIname\fP the name to find and remove 
243 .RE
244 .PP
245 \fBReturns:\fP
246 .RS 4
247 0 on successful find-and-delete, 1 otherwise. 
248 .RE
249 .PP
250
251 .PP
252 Definition at line 191 of file data_list.c.
253 .SS "int netsnmp_save_all_data (\fBnetsnmp_data_list\fP * head, const char * type, const char * token, Netsnmp_Save_List_Data * data_list_save_ptr)"
254 .PP
255 intended to be called as a callback during persistent save operations. See the netsnmp_save_all_data_callback for where this is typically used. 
256 .PP
257 Definition at line 290 of file data_list.c.
258 .SS "int netsnmp_save_all_data_callback (int major, int minor, void * serverarg, void * clientarg)"
259 .PP
260 intended to be registerd as a callback operation. It should be registered using:
261 .PP
262 snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA, netsnmp_save_all_data_callback, INFO_POINTER);
263 .PP
264 where INFO_POINTER is a pointer to a netsnmp_data_list_saveinfo object containing apporpriate registration information 
265 .PP
266 Definition at line 273 of file data_list.c.
267 .SH "Author"
268 .PP 
269 Generated automatically by Doxygen for net-snmp from the source code.