---
name: "netsnmp_table_data"
section: "3snmp"
platform: "linux"
package: "libsnmp-dev"
version: "5.4.3~dfsg-2.8+deb7u1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/netsnmp_table_data"
---

# netsnmp\_table\_data(3snmp)

Helps you implement a table with datamatted storage.

## NAME

table\_data -

Helps you implement a table with datamatted storage.

### Modules

**table\_dataset**\

*Helps you implement a table with automatted storage.*

### Functions

void **netsnmp\_table\_data\_generate\_index\_oid** (**netsnmp\_table\_row** \*row)\
 **netsnmp\_table\_data** \* **netsnmp\_create\_table\_data** (const char \*name)\
 *creates and returns a pointer to table data set*  **netsnmp\_table\_row** \* **netsnmp\_create\_table\_data\_row** (void)\
 *creates and returns a pointer to table data set*  **netsnmp\_table\_row** \* **netsnmp\_table\_data\_clone\_row** (**netsnmp\_table\_row** \*row)\
 *clones a data row.*  void \* **netsnmp\_table\_data\_delete\_row** (**netsnmp\_table\_row** \*row)\
 *deletes a row's memory.*  int **netsnmp\_table\_data\_add\_row** (**netsnmp\_table\_data** \*table, **netsnmp\_table\_row** \*row)\
 *Adds a row of data to a given table (stored in proper lexographical order).*  NETSNMP\_INLINE void **netsnmp\_table\_data\_replace\_row** (**netsnmp\_table\_data** \*table, **netsnmp\_table\_row** \*origrow, **netsnmp\_table\_row** \*newrow)\
 *swaps out origrow with newrow.*  **netsnmp\_table\_row** \* **netsnmp\_table\_data\_remove\_row** (**netsnmp\_table\_data** \*table, **netsnmp\_table\_row** \*row)\
 *removes a row of data to a given table and returns it (no free's called)*  void \* **netsnmp\_table\_data\_remove\_and\_delete\_row** (**netsnmp\_table\_data** \*table, **netsnmp\_table\_row** \*row)\
 *removes and frees a row of data to a given table and returns the void \**  **netsnmp\_table\_data** \* **netsnmp\_table\_data\_create\_table** (const char \*name, long flags)\
 void **netsnmp\_table\_data\_delete\_table** (**netsnmp\_table\_data** \*table)\
 **netsnmp\_table\_row** \* **netsnmp\_table\_data\_create\_row** (void \*entry)\
 int **netsnmp\_table\_data\_copy\_row** (**netsnmp\_table\_row** \*old\_row, **netsnmp\_table\_row** \*new\_row)\
 void \* **netsnmp\_table\_data\_remove\_delete\_row** (**netsnmp\_table\_data** \*table, **netsnmp\_table\_row** \*row)\
 **netsnmp\_mib\_handler** \* **netsnmp\_get\_table\_data\_handler** (**netsnmp\_table\_data** \*table)\
 *Creates a table\_data handler and returns it.*  int **netsnmp\_register\_table\_data** (**netsnmp\_handler\_registration** \*reginfo, **netsnmp\_table\_data** \*table, **netsnmp\_table\_registration\_info** \*table\_info)\
 *registers a handler as a data table.*  int **netsnmp\_register\_read\_only\_table\_data** (**netsnmp\_handler\_registration** \*reginfo, **netsnmp\_table\_data** \*table, **netsnmp\_table\_registration\_info** \*table\_info)\
 *registers a handler as a read-only data table If table\_info != NULL, it registers it as a normal table too.*  int **netsnmp\_table\_data\_helper\_handler** (**netsnmp\_mib\_handler** \*handler, **netsnmp\_handler\_registration** \*reginfo, **netsnmp\_agent\_request\_info** \*reqinfo, **netsnmp\_request\_info** \*requests)\
 **netsnmp\_table\_data** \* **netsnmp\_extract\_table** (**netsnmp\_request\_info** \*request)\
 *extracts the table being accessed passed from the table\_data helper*  **netsnmp\_table\_row** \* **netsnmp\_extract\_table\_row** (**netsnmp\_request\_info** \*request)\
 *extracts the row being accessed passed from the table\_data helper*  void \* **netsnmp\_extract\_table\_row\_data** (**netsnmp\_request\_info** \*request)\
 *extracts the data from the row being accessed passed from the table\_data helper*  NETSNMP\_INLINE void **netsnmp\_insert\_table\_row** (**netsnmp\_request\_info** \*request, **netsnmp\_table\_row** \*row)\
 *inserts a newly created table\_data row into a request*  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)\
 **netsnmp\_table\_row** \* **netsnmp\_table\_data\_get\_first\_row** (**netsnmp\_table\_data** \*table)\
 *returns the first row in the table*  **netsnmp\_table\_row** \* **netsnmp\_table\_data\_get\_next\_row** (**netsnmp\_table\_data** \*table, **netsnmp\_table\_row** \*row)\
 *returns the next row in the table*  **netsnmp\_table\_row** \* **netsnmp\_table\_data\_get** (**netsnmp\_table\_data** \*table, **netsnmp\_variable\_list** \*indexes)\
 *finds the data in 'datalist' stored at 'indexes'*  **netsnmp\_table\_row** \* **netsnmp\_table\_data\_get\_from\_oid** (**netsnmp\_table\_data** \*table, oid \*searchfor, size\_t searchfor\_len)\
 *finds the data in 'datalist' stored at the searchfor oid*  int **netsnmp\_table\_data\_num\_rows** (**netsnmp\_table\_data** \*table)\
 **netsnmp\_table\_row** \* **netsnmp\_table\_data\_row\_first** (**netsnmp\_table\_data** \*table)\
 **netsnmp\_table\_row** \* **netsnmp\_table\_data\_row\_get** (**netsnmp\_table\_data** \*table, **netsnmp\_table\_row** \*row)\
 **netsnmp\_table\_row** \* **netsnmp\_table\_data\_row\_next** (**netsnmp\_table\_data** \*table, **netsnmp\_table\_row** \*row)\
 **netsnmp\_table\_row** \* **netsnmp\_table\_data\_row\_get\_byoid** (**netsnmp\_table\_data** \*table, oid \*instance, size\_t len)\
 **netsnmp\_table\_row** \* **netsnmp\_table\_data\_row\_next\_byoid** (**netsnmp\_table\_data** \*table, oid \*instance, size\_t len)\
 **netsnmp\_table\_row** \* **netsnmp\_table\_data\_row\_get\_byidx** (**netsnmp\_table\_data** \*table, **netsnmp\_variable\_list** \*indexes)\
 **netsnmp\_table\_row** \* **netsnmp\_table\_data\_row\_next\_byidx** (**netsnmp\_table\_data** \*table, **netsnmp\_variable\_list** \*indexes)\
 int **netsnmp\_table\_data\_row\_count** (**netsnmp\_table\_data** \*table)\
 void \* **netsnmp\_table\_data\_entry\_first** (**netsnmp\_table\_data** \*table)\
 void \* **netsnmp\_table\_data\_entry\_get** (**netsnmp\_table\_data** \*table, **netsnmp\_table\_row** \*row)\
 void \* **netsnmp\_table\_data\_entry\_next** (**netsnmp\_table\_data** \*table, **netsnmp\_table\_row** \*row)\
 void \* **netsnmp\_table\_data\_entry\_get\_byidx** (**netsnmp\_table\_data** \*table, **netsnmp\_variable\_list** \*indexes)\
 void \* **netsnmp\_table\_data\_entry\_next\_byidx** (**netsnmp\_table\_data** \*table, **netsnmp\_variable\_list** \*indexes)\
 void \* **netsnmp\_table\_data\_entry\_get\_byoid** (**netsnmp\_table\_data** \*table, oid \*instance, size\_t len)\
 void \* **netsnmp\_table\_data\_entry\_next\_byoid** (**netsnmp\_table\_data** \*table, oid \*instance, size\_t len)\

## Detailed Description

Helps you implement a table with datamatted storage.

This helper is obsolete. If you are writing a new **module**, please consider using the table\_tdata helper instead.

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. 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.

## Function Documentation

### netsnmp\_table\_data\* netsnmp\_create\_table\_data (const char \* name)

creates and returns a pointer to table data set

Definition at line 52 of file table\_data.c.

### netsnmp\_table\_row\* netsnmp\_create\_table\_data\_row (void)

creates and returns a pointer to table data set

**Examples:**  **data\_set.c**.

Definition at line 62 of file table\_data.c.

### netsnmp\_table\_data\* netsnmp\_extract\_table (netsnmp\_request\_info \* request)

extracts the table being accessed passed from the table\_data helper

Definition at line 653 of file table\_data.c.

### netsnmp\_table\_row\* netsnmp\_extract\_table\_row (netsnmp\_request\_info \* request)

extracts the row being accessed passed from the table\_data helper

Definition at line 661 of file table\_data.c.

### void\* netsnmp\_extract\_table\_row\_data (netsnmp\_request\_info \* request)

extracts the data from the row being accessed passed from the table\_data helper

Definition at line 670 of file table\_data.c.

### netsnmp\_mib\_handler\* netsnmp\_get\_table\_data\_handler (netsnmp\_table\_data \* table)

Creates a table\_data handler and returns it.

Definition at line 375 of file table\_data.c.

### NETSNMP\_INLINE void netsnmp\_insert\_table\_row (netsnmp\_request\_info \* request, netsnmp\_table\_row \* row)

inserts a newly created table\_data row into a request

Definition at line 682 of file table\_data.c.

### int netsnmp\_register\_read\_only\_table\_data (netsnmp\_handler\_registration \* reginfo, netsnmp\_table\_data \* table, netsnmp\_table\_registration\_info \* table\_info)

registers a handler as a read-only data table If table\_info != NULL, it registers it as a normal table too.

Definition at line 409 of file table\_data.c.

### int netsnmp\_register\_table\_data (netsnmp\_handler\_registration \* reginfo, netsnmp\_table\_data \* table, netsnmp\_table\_registration\_info \* table\_info)

registers a handler as a data table. If table\_info != NULL, it registers it as a normal table too.

Definition at line 398 of file table\_data.c.

### int netsnmp\_table\_data\_add\_row (netsnmp\_table\_data \* table, netsnmp\_table\_row \* row)

Adds a row of data to a given table (stored in proper lexographical order). returns SNMPERR\_SUCCESS on successful addition. or SNMPERR\_GENERR on failure (E.G., indexes already existed)

xxx-rks: remove invalid row?

Definition at line 134 of file table\_data.c.

### netsnmp\_table\_row\* netsnmp\_table\_data\_clone\_row (netsnmp\_table\_row \* row)

clones a data row. DOES NOT CLONE THE CONTAINED DATA.

Definition at line 70 of file table\_data.c.

### void\* netsnmp\_table\_data\_delete\_row (netsnmp\_table\_row \* row)

deletes a row's memory. returns the void data that it doesn't know how to delete.

Definition at line 105 of file table\_data.c.

### netsnmp\_table\_row\* netsnmp\_table\_data\_get (netsnmp\_table\_data \* table, netsnmp\_variable\_list \* indexes)

finds the data in 'datalist' stored at 'indexes'

Definition at line 808 of file table\_data.c.

### netsnmp\_table\_row\* netsnmp\_table\_data\_get\_first\_row (netsnmp\_table\_data \* table)

returns the first row in the table

Definition at line 789 of file table\_data.c.

### netsnmp\_table\_row\* netsnmp\_table\_data\_get\_from\_oid (netsnmp\_table\_data \* table, oid \* searchfor, size\_t searchfor\_len)

finds the data in 'datalist' stored at the searchfor oid

Definition at line 822 of file table\_data.c.

### netsnmp\_table\_row\* netsnmp\_table\_data\_get\_next\_row (netsnmp\_table\_data \* table, netsnmp\_table\_row \* row)

returns the next row in the table

Definition at line 798 of file table\_data.c.

### void\* netsnmp\_table\_data\_remove\_and\_delete\_row (netsnmp\_table\_data \* table, netsnmp\_table\_row \* row)

removes and frees a row of data to a given table and returns the void \* returns the void \* data on successful deletion. or NULL on failure (bad arguments)

Definition at line 274 of file table\_data.c.

### netsnmp\_table\_row\* netsnmp\_table\_data\_remove\_row (netsnmp\_table\_data \* table, netsnmp\_table\_row \* row)

removes a row of data to a given table and returns it (no free's called) returns the row pointer itself on successful removing. or NULL on failure (bad arguments)

Definition at line 248 of file table\_data.c.

### NETSNMP\_INLINE void netsnmp\_table\_data\_replace\_row (netsnmp\_table\_data \* table, netsnmp\_table\_row \* origrow, netsnmp\_table\_row \* newrow)

swaps out origrow with newrow. This does \*not\* delete/free anything!

Definition at line 233 of file table\_data.c.

## Author

Generated automatically by Doxygen for net-snmp from the source code.
