Logo
Home page Net-SNMP

Archive Search:

Require all words?

Site Search:
Google
Main Page | Modules | Data Structures | File List | Data Fields | Related Pages | Examples

table_maintenance
[generic_table_API]

Routines for maintaining the contents of a table. More...

Functions

void *  netsnmp_generic_create_table (const char *name, int flags)
  Create a structure to represent the table.
void  netsnmp_generic_delete_table (void *table)
  Release the structure representing a table.
void *  netsnmp_generic_create_row (void)
  Create a new row structure suitable for this style of table.
void *  netsnmp_generic_clone_row (void *row)
  Create a new copy of the specified row.
int  netsnmp_generic_copy_row (void *dst_row, void *src_row)
  Copy the contents of one row into another.
void  netsnmp_generic_delete_row (void *row)
  Delete a row data structure.
int  netsnmp_generic_add_row (void *table, void *row)
  Add a row to the table.
int  netsnmp_generic_replace_row (void *table, void *old_row, void *new_row)
  Replace one row with another in the table.
void *  netsnmp_generic_remove_row (void *table, void *row)
  Remove a row from the table.
void  netsnmp_generic_remove_delete_row (void *table, void *row)
  Remove and delete a row from the table.

Detailed Description

Routines for maintaining the contents of a table.

This would typically be part of implementing an SNMP MIB, but could potentially also be used for a standalone table.

This section of the generic API is primarily relevant to table helpers where the representation of the table is constructed and maintained within the helper itself. "External" tables will typically look after such aspects directly, although this section of the abstract API framework could also help direct the design of such table-specific implementations.


Function Documentation

int netsnmp_generic_add_row void *  table,
void *  row
 

Add a row to the table.

Definition at line 105 of file table_generic.c.

void* netsnmp_generic_clone_row void *  row  ) 
 

Create a new copy of the specified row.

Definition at line 83 of file table_generic.c.

int netsnmp_generic_copy_row void *  dst_row,
void *  src_row
 

Copy the contents of one row into another.

The destination row structure should be created before this routine is called.

Definition at line 91 of file table_generic.c.

void* netsnmp_generic_create_row void   ) 
 

Create a new row structure suitable for this style of table.

Note that this would typically be a 'standalone' row, and would not automatically be inserted into an actual table.

Definition at line 77 of file table_generic.c.

void* netsnmp_generic_create_table const char *  name,
int  flags
 

Create a structure to represent the table.

This could be as simple as the head of a linked list, or a more complex container structure. The 'name' field would typically be used to distinguish between several tables implemented using the same table helper. The 'flags' field would be used to control various (helper-specific) aspects of table behaviour.

The table structure returned should typically be regarded as an opaque, private structure. All operations on the content of the table should ideally use the appropriate routines from this API.

Definition at line 61 of file table_generic.c.

void netsnmp_generic_delete_row void *  row  ) 
 

Delete a row data structure.

The row should be removed from any relevant table(s) before this routine is called.

Definition at line 99 of file table_generic.c.

void netsnmp_generic_delete_table void *  table  ) 
 

Release the structure representing a table.

Any rows still contained within the table should also be removed and deleted.

Definition at line 69 of file table_generic.c.

void netsnmp_generic_remove_delete_row void *  table,
void *  row
 

Remove and delete a row from the table.

Definition at line 128 of file table_generic.c.

void* netsnmp_generic_remove_row void *  table,
void *  row
 

Remove a row from the table.

The data structure for the row should not be released, and would be the return value of this routine.

Definition at line 122 of file table_generic.c.

int netsnmp_generic_replace_row void *  table,
void *  old_row,
void *  new_row
 

Replace one row with another in the table.

This will typically (but not necessarily) involve two rows sharing the same index information (e.g. to implement update/restore-style SET behaviour).

Definition at line 114 of file table_generic.c.


Generated on Fri Dec 30 13:48:01 2005 for net-snmp by  doxygen 1.3.9.1

Valid CSS!


Last modified: Thursday, 01-Mar-2007 16:20:01 PST
For questions regarding web content and site functionality, please write to the net-snmp-users mail list.