blob: cca108a9d87a4692a036d25c82f4559b5c5e3bd0 [file] [log] [blame]
.TH "generic linked-list data handling with a string as a key." 3 "31 May 2012" "Version 5.5.2.rc2" "net-snmp" \" -*- nroff -*-
.ad l
.nh
.SH NAME
generic linked-list data handling with a string as a key. \-
.SS "Functions"
.in +1c
.ti -1c
.RI "NETSNMP_INLINE void \fBnetsnmp_free_list_data\fP (\fBnetsnmp_data_list\fP *\fBnode\fP)"
.br
.RI "\fIfrees the data and a name at a given data_list \fBnode\fP. \fP"
.ti -1c
.RI "NETSNMP_INLINE void \fBnetsnmp_free_all_list_data\fP (\fBnetsnmp_data_list\fP *head)"
.br
.RI "\fIfrees all data and nodes in a list. \fP"
.ti -1c
.RI "NETSNMP_INLINE \fBnetsnmp_data_list\fP * \fBnetsnmp_create_data_list\fP (const char *name, void *data, Netsnmp_Free_List_Data *beer)"
.br
.RI "\fIadds creates a data_list \fBnode\fP given a name, data and a free function ptr. \fP"
.ti -1c
.RI "NETSNMP_INLINE void \fBnetsnmp_data_list_add_node\fP (\fBnetsnmp_data_list\fP **head, \fBnetsnmp_data_list\fP *\fBnode\fP)"
.br
.RI "\fIadds data to a datalist \fP"
.ti -1c
.RI "NETSNMP_INLINE void \fBnetsnmp_add_list_data\fP (\fBnetsnmp_data_list\fP **head, \fBnetsnmp_data_list\fP *\fBnode\fP)"
.br
.RI "\fIadds data to a datalist \fP"
.ti -1c
.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)"
.br
.RI "\fIadds data to a datalist \fP"
.ti -1c
.RI "NETSNMP_INLINE void * \fBnetsnmp_get_list_data\fP (\fBnetsnmp_data_list\fP *head, const char *name)"
.br
.RI "\fIreturns a data_list node's data for a given name within a data_list \fP"
.ti -1c
.RI "NETSNMP_INLINE \fBnetsnmp_data_list\fP * \fBnetsnmp_get_list_node\fP (\fBnetsnmp_data_list\fP *head, const char *name)"
.br
.RI "\fIreturns a data_list \fBnode\fP for a given name within a data_list \fP"
.ti -1c
.RI "int \fBnetsnmp_remove_list_node\fP (\fBnetsnmp_data_list\fP **realhead, const char *name)"
.br
.RI "\fIRemoves a named \fBnode\fP from a data_list (and frees it). \fP"
.ti -1c
.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)"
.br
.RI "\fIregisters to store a data_list set of data at persistent storage time \fP"
.ti -1c
.RI "int \fBnetsnmp_save_all_data_callback\fP (int major, int minor, void *serverarg, void *clientarg)"
.br
.RI "\fIintended to be registerd as a callback operation. \fP"
.ti -1c
.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)"
.br
.RI "\fIintended to be called as a callback during persistent save operations. \fP"
.ti -1c
.RI "void \fBnetsnmp_read_data_callback\fP (const char *token, char *line)"
.br
.RI "\fIintended to be registerd as a .conf parser It should be registered using: \fP"
.in -1c
.SH "Function Documentation"
.PP
.SS "NETSNMP_INLINE void netsnmp_add_list_data (\fBnetsnmp_data_list\fP ** head, \fBnetsnmp_data_list\fP * node)"
.PP
adds data to a datalist depreciated: use \fBnetsnmp_data_list_add_node()\fP
.PP
\fBNote:\fP
.RS 4
netsnmp_data_list_add_node is preferred
.RE
.PP
\fBParameters:\fP
.RS 4
\fIhead\fP a pointer to the head \fBnode\fP of a data_list
.br
\fI\fBnode\fP\fP a \fBnode\fP to stash in the data_list
.RE
.PP
.PP
Definition at line 121 of file data_list.c.
.SS "NETSNMP_INLINE \fBnetsnmp_data_list\fP* netsnmp_create_data_list (const char * name, void * data, Netsnmp_Free_List_Data * beer)"
.PP
adds creates a data_list \fBnode\fP given a name, data and a free function ptr. \fBParameters:\fP
.RS 4
\fIname\fP the name of the \fBnode\fP to cache the data.
.br
\fIdata\fP the data to be stored under that name
.br
\fIbeer\fP A function that can free the data pointer (in the future)
.RE
.PP
\fBReturns:\fP
.RS 4
a newly created data_list \fBnode\fP which can be given to the netsnmp_add_list_data function.
.RE
.PP
.PP
\fBExamples: \fP
.in +1c
\fBdelayed_instance.c\fP.
.PP
Definition at line 53 of file data_list.c.
.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)"
.PP
adds data to a datalist \fBParameters:\fP
.RS 4
\fIhead\fP a pointer to the head \fBnode\fP of a data_list
.br
\fIname\fP the name of the \fBnode\fP to cache the data.
.br
\fIdata\fP the data to be stored under that name
.br
\fIbeer\fP A function that can free the data pointer (in the future)
.RE
.PP
\fBReturns:\fP
.RS 4
a newly created data_list \fBnode\fP which was inserted in the list
.RE
.PP
.PP
Definition at line 134 of file data_list.c.
.SS "NETSNMP_INLINE void netsnmp_data_list_add_node (\fBnetsnmp_data_list\fP ** head, \fBnetsnmp_data_list\fP * node)"
.PP
adds data to a datalist \fBParameters:\fP
.RS 4
\fIhead\fP a pointer to the head \fBnode\fP of a data_list
.br
\fI\fBnode\fP\fP a \fBnode\fP to stash in the data_list
.RE
.PP
.PP
Definition at line 78 of file data_list.c.
.SS "NETSNMP_INLINE void netsnmp_free_all_list_data (\fBnetsnmp_data_list\fP * head)"
.PP
frees all data and nodes in a list. \fBParameters:\fP
.RS 4
\fIhead\fP the top \fBnode\fP of the list to be freed.
.RE
.PP
.PP
Definition at line 35 of file data_list.c.
.SS "NETSNMP_INLINE void netsnmp_free_list_data (\fBnetsnmp_data_list\fP * node)"
.PP
frees the data and a name at a given data_list \fBnode\fP. Note that this doesn't free the \fBnode\fP itself.
.PP
\fBParameters:\fP
.RS 4
\fI\fBnode\fP\fP the \fBnode\fP for which the data should be freed
.RE
.PP
.PP
Definition at line 19 of file data_list.c.
.SS "NETSNMP_INLINE void* netsnmp_get_list_data (\fBnetsnmp_data_list\fP * head, const char * name)"
.PP
returns a data_list node's data for a given name within a data_list \fBParameters:\fP
.RS 4
\fIhead\fP the head \fBnode\fP of a data_list
.br
\fIname\fP the name to find
.RE
.PP
\fBReturns:\fP
.RS 4
a pointer to the data cached at that \fBnode\fP
.RE
.PP
.PP
Definition at line 159 of file data_list.c.
.SS "NETSNMP_INLINE \fBnetsnmp_data_list\fP* netsnmp_get_list_node (\fBnetsnmp_data_list\fP * head, const char * name)"
.PP
returns a data_list \fBnode\fP for a given name within a data_list \fBParameters:\fP
.RS 4
\fIhead\fP the head \fBnode\fP of a data_list
.br
\fIname\fP the name to find
.RE
.PP
\fBReturns:\fP
.RS 4
a pointer to the data_list \fBnode\fP
.RE
.PP
.PP
Definition at line 177 of file data_list.c.
.SS "void netsnmp_read_data_callback (const char * token, char * line)"
.PP
intended to be registerd as a .conf parser It should be registered using: register_app_config_handler('token', netsnmp_read_data_callback, XXX)
.PP
where INFO_POINTER is a pointer to a netsnmp_data_list_saveinfo object containing apporpriate registration information
.PP
\fBTodo\fP
.RS 4
make netsnmp_read_data_callback deal with a free routine
.RE
.PP
.PP
Definition at line 335 of file data_list.c.
.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)"
.PP
registers to store a data_list set of data at persistent storage time \fBParameters:\fP
.RS 4
\fIdatalist\fP the data to be saved
.br
\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).
.br
\fItoken\fP the unique token identifier string to use as the first word in the persistent file line.
.br
\fIdata_list_save_ptr\fP a function pointer which will be called to save the rest of the data to a buffer.
.br
\fIdata_list_read_ptr\fP a function pointer which can read the remainder of a saved line and return the application specific void * pointer.
.br
\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.
.RE
.PP
.PP
\fBTodo\fP
.RS 4
netsnmp_register_save_list should handle the same token name being saved from different types?
.RE
.PP
.PP
Definition at line 228 of file data_list.c.
.SS "int netsnmp_remove_list_node (\fBnetsnmp_data_list\fP ** realhead, const char * name)"
.PP
Removes a named \fBnode\fP from a data_list (and frees it). \fBParameters:\fP
.RS 4
\fIrealhead\fP a pointer to the head \fBnode\fP of a data_list
.br
\fIname\fP the name to find and remove
.RE
.PP
\fBReturns:\fP
.RS 4
0 on successful find-and-delete, 1 otherwise.
.RE
.PP
.PP
Definition at line 195 of file data_list.c.
.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)"
.PP
intended to be called as a callback during persistent save operations. See the netsnmp_save_all_data_callback for where this is typically used.
.PP
Definition at line 299 of file data_list.c.
.SS "int netsnmp_save_all_data_callback (int major, int minor, void * serverarg, void * clientarg)"
.PP
intended to be registerd as a callback operation. It should be registered using:
.PP
snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA, netsnmp_save_all_data_callback, INFO_POINTER);
.PP
where INFO_POINTER is a pointer to a netsnmp_data_list_saveinfo object containing apporpriate registration information
.PP
Definition at line 282 of file data_list.c.
.SH "Author"
.PP
Generated automatically by Doxygen for net-snmp from the source code.