MyWebUniversity.com Home Page
 



Darwin Mac OS X man pages main menu
tabledatable:dHataset:oHelpslyounimplement aitabletwithtautomatted.storage.(3)



NAME
       netsnmptabledataset - Helps you implement a table with automatted
       storage.



   Functions
       void netsnmpinittabledataset (void)
       netsnmptabledataset * netsnmpcreatetabledataset (const char
           *tablename)
           Create a netsnmptabledataset structure given a tabledata
           definition.
       netsnmpmibhandler * netsnmpgettabledatasethandler
           (netsnmptabledataset *dataset)
           Given a netsnmptabledataset definition, create a handler for it.
       int netsnmpregistertabledataset (netsnmphandlerregistration
           *reginfo, netsnmptabledataset *dataset,
           netsnmptableregistrationinfo *tableinfo)
           register a given dataset at a given oid (specified in the
           netsnmphandlerregistration pointer).
       netsnmptabledatasetstorage * netsnmptabledatasetfindcolumn
           (netsnmptabledatasetstorage *start, unsigned int column)
           Finds a column within a given storage set, given the pointer to the
           start of the storage set list.
       netsnmptabledatasetstorage * netsnmpextracttabledatasetcolumn
           (netsnmprequestinfo *request, unsigned int column)
           extracts a netsnmptabledataset pointer from a given request
       NETSNMPINLINE netsnmptabledataset * netsnmpextracttabledataset
           (netsnmprequestinfo *request)
           extracts a netsnmptabledataset pointer from a given request
       int netsnmpmarkrowcolumnwritable (netsnmptablerow *row, int
           column, int writable)
           marks a given column in a row as writable or not.
       int netsnmpsetrowcolumn (netsnmptablerow *row, unsigned int
           column, int type, const char *value, sizet valuelen)
           sets a given column in a row with data given a type, value, and
           length.
       int netsnmptablesetadddefaultrow (netsnmptabledataset
           *tableset, unsigned int column, int type, int writable, void
           *defaultvalue, sizet defaultvaluelen)
           adds a new default row to a tableset.
       netsnmptablerow * netsnmptabledatasetclonerow (netsnmptablerow
           *row)
           clones a dataset row, including all data.
       netsnmptablerow * netsnmptabledatasetcreaterowfromdefaults
           (netsnmptabledatasetstorage *defrow)
           creates a new row from an existing defined default set
       newrowstash * netsnmptabledatasetcreatenewrowstash
           (netsnmptabledataset *datatable, netsnmptablerequestinfo
           *tableinfo)
       int netsnmptabledatasethelperhandler (netsnmpmibhandler
           *handler, netsnmphandlerregistration *reginfo,
           netsnmpagentrequestinfo *reqinfo, netsnmprequestinfo
           *requests)
           implements the table data helper.
       void netsnmpregisterautodatatable (netsnmptabledataset
           *tableset, char *registrationname)
           registers a tabledataset so that the 'addrow' snmpd.conf token
           can be used to add data to this table.
       void netsnmpconfigparsetableset (const char *token, char *line)
       void netsnmpconfigparseaddrow (const char *token, char *line)
       NETSNMPINLINE void netsnmptabledatasetaddindex
           (netsnmptabledataset *table, uchar type)
           adds an index to the table.
       NETSNMPINLINE void netsnmptabledatasetaddrow
           (netsnmptabledataset *table, netsnmptablerow *row)
           adds a new row to a dataset table
       NETSNMPINLINE void netsnmptabledatasetreplacerow
           (netsnmptabledataset *table, netsnmptablerow *origrow,
           netsnmptablerow *newrow)
           adds a new row to a dataset table
       NETSNMPINLINE netsnmptabledatasetstorage *
           netsnmptabledatasetdeletedata (netsnmptabledatasetstorage
           *data)
           deletes a single dataset table data.
       NETSNMPINLINE void netsnmptabledatasetdeletealldata
           (netsnmptabledatasetstorage *data)
           deletes all the data from this node and beyond in the linked list
       NETSNMPINLINE void netsnmptabledatasetdeleterow (netsnmptablerow
           *row)
           deletes all the data from this node and beyond in the linked list
       NETSNMPINLINE void netsnmptabledatasetremoverow
           (netsnmptabledataset *table, netsnmptablerow *row)
           removes a row from the table, but doesn't delete/free anything
       NETSNMPINLINE void netsnmptabledatasetremoveanddeleterow
           (netsnmptabledataset *table, netsnmptablerow *row)
           removes a row from the table and then deletes it (and all it's
           data)
       void netsnmptablesetmultiadddefaultrow (vadcl)
           adds multiple data column definitions to each row.
       void netsnmptablesetaddindexes (vaalist)
           adds multiple indexes to a tabledataset helper object.
       int netsnmptablesetnumrows (netsnmptabledataset *table)

Detailed Description
       This 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. It handles all MIB requests including GETs, GETNEXTs and
       SETs. It's possible to simply create a table without actually ever
       defining a handler to be called when SNMP requests come in. To use the
       data, you can either attach a sub-handler that merely uses/manipulates
       the data further when requests come in, or you can loop through it
       externally when it's actually needed. This handler is most useful in
       cases where a table is holding configuration data for something which
       gets triggered via another event.

       NOTE NOTE NOTE: This helper isn't complete and is likely to change
       somewhat over time. Specifically, the way it stores data internally may
       change drastically.

Function Documentation
   netsnmptabledataset** netsnmpcreatetabledataset (const char **
       tablename)
       Create a netsnmptabledataset structure given a tabledata
       definition.

       Examples::
           dataset.c.

       Definition at line 74 of file tabledataset.c.

       References netsnmpcreatetabledata(), and SNMPMALOCTYPEDEF.

   NETSNMPINLINE netsnmptabledataset** netsnmpextracttabledataset
       (netsnmprequestinfo ** request)
       extracts a netsnmptabledataset pointer from a given request
       Definition at line 187 of file tabledataset.c.

       References netsnmprequestgetlistdata().

   netsnmptabledatasetstorage** netsnmpextracttabledatasetcolumn
       (netsnmprequestinfo ** request,, unsigned int column)
       extracts a netsnmptabledataset pointer from a given request
       Definition at line 173 of file tabledataset.c.

       References netsnmpextracttablerowdata(), and
       netsnmptabledatasetfindcolumn().

   netsnmpmibhandler** netsnmpgettabledatasethandler
       (netsnmptabledataset ** dataset)
       Given a netsnmptabledataset definition, create a handler for it.
       Definition at line 86 of file tabledataset.c.

       References netsnmpmibhandlers::flags, netsnmpmibhandlers::myvoid,
       netsnmpcreatehandler(), netsnmpmibhandler, and snmplog().

       Referenced by netsnmpregistertabledataset().

   int netsnmpmarkrowcolumnwritable (netsnmptablerow ** row,, int column,,
       int writable)
       marks a given column in a row as writable or not.

       Examples::
           dataset.c.

       Definition at line 197 of file tabledataset.c.

       References netsnmptabledatasetfindcolumn(), snmplog(), and
       SNMPMALOCTYPEDEF.

       Referenced by netsnmptabledatasetcreaterowfromdefaults().

   void netsnmpregisterautodatatable (netsnmptabledataset ** tableset,,
       char ** registrationname)
       registers a tabledataset so that the 'addrow' snmpd.conf token can be
       used to add data to this table. If registrationname is NUL then the
       name used when the table was created will be used instead.

       Todo
           create a properly free'ing registeration pointer for the datalist,
           and get the datalist freed at shutdown.



       Examples::
           dataset.c.

       Definition at line 783 of file tabledataset.c.

       References netsnmpaddlistdata(), netsnmpcreatedatalist(), and
       SNMPMALOCTYPEDEF.

   int netsnmpregistertabledataset (netsnmphandlerregistration **
       reginfo,, netsnmptabledataset ** dataset,,
       netsnmptableregistrationinfo ** tableinfo)
       register a given dataset at a given oid (specified in the
       netsnmphandlerregistration pointer). The
       reginfo->handler->accessmethod *may* be null if the call doesn't ever
       want to be called for SNMP operations.

       Examples::
           dataset.c.

       Definition at line 113 of file tabledataset.c.

       References netsnmptableregistrationinfos::indexes,
       netsnmptableregistrationinfos::maxcolumn,
       netsnmptableregistrationinfos::mincolumn,
       netsnmpgettabledatasethandler(), netsnmphandlerregistration,
       netsnmpinjecthandler(), netsnmpregistertabledata(),
       SNMPMALOCTYPEDEF, SNMPMAX, and SNMPMIN.

   int netsnmpsetrowcolumn (netsnmptablerow ** row,, unsigned int column,,
       int type,, const char ** value,, sizet valuelen)
       sets a given column in a row with data given a type, value, and length.
       Data is memdup'ed by the function.

       Examples::
           dataset.c.

       Definition at line 233 of file tabledataset.c.

       References memdup(), netsnmptabledatasetfindcolumn(), SNMPFRE,
       snmplog(), and SNMPMALOCTYPEDEF.

       Referenced by netsnmptabledatasetcreaterowfromdefaults().

   netsnmptablerow** netsnmptabledatasetclonerow (netsnmptablerow **
       row)
       clones a dataset row, including all data. Definition at line 347 of
       file tabledataset.c.

       References memdup(), netsnmptabledataclonerow(), and
       netsnmptabledatasetdeleterow().

       Referenced by netsnmptabledatasethelperhandler().

   netsnmptablerow** netsnmptabledatasetcreaterowfromdefaults
       (netsnmptabledatasetstorage ** defrow)
       creates a new row from an existing defined default set Definition at
       line 389 of file tabledataset.c.

       References netsnmpcreatetabledatarow(),
       netsnmpmarkrowcolumnwritable(), and netsnmpsetrowcolumn().

   netsnmptabledatasetstorage** netsnmptabledatasetfindcolumn
       (netsnmptabledatasetstorage ** start,, unsigned int column)
       Finds a column within a given storage set, given the pointer to the
       start of the storage set list. Definition at line 161 of file
       tabledataset.c.

       Referenced by netsnmpextracttabledatasetcolumn(),
       netsnmpmarkrowcolumnwritable(), netsnmpsetrowcolumn(),
       netsnmptabledatasethelperhandler(), and
       netsnmptablesetadddefaultrow().

   int netsnmptabledatasethelperhandler (netsnmpmibhandler ** handler,,
       netsnmphandlerregistration ** reginfo,, netsnmpagentrequestinfo **
       reqinfo,, netsnmprequestinfo ** requests)
       implements the table data helper. This is the routine that takes care
       of all SNMP requests coming into the table. Definition at line 427 of
       file tabledataset.c.

       References netsnmptablerequestinfos::colnum,
       netsnmptablerequestinfos::indexoid,
       netsnmptablerequestinfos::indexoidlen,
       netsnmpagentrequestinfos::mode, netsnmpmibhandlers::myvoid,
       netsnmpcreatedatalist(), netsnmpextracttableinfo(),
       netsnmpextracttablerow(), netsnmphandlerregistration,
       netsnmpmibhandler, netsnmpoidstashadddata(),
       netsnmpoidstashgetdata(), netsnmprequestaddlistdata(),
       netsnmpsetrequesterror(), netsnmpstrdupandnull(),
       netsnmptabledatabuildresult(), netsnmptabledatasetclonerow(),
       netsnmptabledatasetfindcolumn(), netsnmptabledatasetaddrow(),
       netsnmptabledatasetdeleterow(),
       netsnmptabledatasetremoveanddeleterow(),
       netsnmptabledatasetreplacerow(), netsnmprequestinfos::next,
       netsnmprequestinfos::processed, netsnmprequestinfos::requestvb,
       netsnmphandlerregistrations::rootoidlen, SNMPFRE, snmplog(),
       SNMPMALOCTYPEDEF, variablelist::type, variablelist::val, and
       variablelist::vallen.

   NETSNMPINLINE void netsnmptabledatasetaddindex (netsnmptabledataset
       ** table,, uchar type)
       adds an index to the table. Call this repeatly for each index.

       Examples::
           dataset.c.

       Definition at line 1052 of file tabledataset.c.

       Referenced by netsnmptablesetaddindexes().

   NETSNMPINLINE void netsnmptabledatasetaddrow (netsnmptabledataset **
       table,, netsnmptablerow ** row)
       adds a new row to a dataset table

       Examples::
           dataset.c.

       Definition at line 1061 of file tabledataset.c.

       References netsnmptabledataaddrow().

       Referenced by netsnmptabledatasethelperhandler().

   NETSNMPINLINE void netsnmptabledatasetdeletealldata
       (netsnmptabledatasetstorage ** data)
       deletes all the data from this node and beyond in the linked list
       Definition at line 1097 of file tabledataset.c.

       References netsnmptabledatasetdeletedata().

       Referenced by netsnmptabledatasetdeleterow(), and
       netsnmptabledatasetremoveanddeleterow().

   NETSNMPINLINE netsnmptabledatasetstorage**
       netsnmptabledatasetdeletedata (netsnmptabledatasetstorage **
       data)
       deletes a single dataset table data. returns the (possibly still good)
       next pointer of the deleted data object. Definition at line 1084 of
       file tabledataset.c.

       References SNMPFRE.

       Referenced by netsnmptabledatasetdeletealldata().

   NETSNMPINLINE void netsnmptabledatasetdeleterow (netsnmptablerow **
       row)
       deletes all the data from this node and beyond in the linked list
       Definition at line 1107 of file tabledataset.c.

       References netsnmptabledatadeleterow(), and
       netsnmptabledatasetdeletealldata().

       Referenced by netsnmptabledatasetclonerow(), and
       netsnmptabledatasethelperhandler().

   NETSNMPINLINE void netsnmptabledatasetremoveanddeleterow
       (netsnmptabledataset ** table,, netsnmptablerow ** row)
       removes a row from the table and then deletes it (and all it's data)
       Definition at line 1131 of file tabledataset.c.

       References netsnmptabledataremoveanddeleterow(), and
       netsnmptabledatasetdeletealldata().

       Referenced by netsnmptabledatasethelperhandler().

   NETSNMPINLINE void netsnmptabledatasetremoverow
       (netsnmptabledataset ** table,, netsnmptablerow ** row)
       removes a row from the table, but doesn't delete/free anything
       Definition at line 1120 of file tabledataset.c.

       References netsnmptabledataremoveanddeleterow().

   NETSNMPINLINE void netsnmptabledatasetreplacerow
       (netsnmptabledataset ** table,, netsnmptablerow ** origrow,,
       netsnmptablerow ** newrow)
       adds a new row to a dataset table Definition at line 1071 of file
       tabledataset.c.

       References netsnmptabledatareplacerow().

       Referenced by netsnmptabledatasethelperhandler().

   int netsnmptablesetadddefaultrow (netsnmptabledataset ** tableset,,
       unsigned int column,, int type,, int writable,, void ** defaultvalue,,
       sizet defaultvaluelen)
       adds a new default row to a tableset. Arguments should be the
       tableset, column number, variable type and finally a 1 if it is
       allowed to be writable, or a 0 if not. If the defaultvalue field is
       not NUL, it will be used to populate new valuse in that column fro
       newly created rows. It is copied into the storage template (free your
       calling argument).

       returns SNMPERSUCES or SNMPERFAILURE Definition at line 289 of
       file tabledataset.c.

       References memdup(), netsnmptabledatasetfindcolumn(), snmplog(),
       and SNMPMALOCTYPEDEF.

       Referenced by netsnmptablesetmultiadddefaultrow().

   void netsnmptablesetaddindexes (vaalist)
       adds multiple indexes to a tabledataset helper object. To end the
       list, use a 0 after the list of ASN index types. Definition at line
       1192 of file tabledataset.c.

       References netsnmptabledatasetaddindex().

   void netsnmptablesetmultiadddefaultrow (vadcl)
       adds multiple data column definitions to each row. Functionally, this
       is a wrapper around calling netsnmptablesetadddefaultrow
       repeatedly for you. Definition at line 1153 of file tabledataset.c.

       References netsnmptablesetadddefaultrow(), and
       netsnmptablesetmultiadddefaultrow().

       Referenced by netsnmptablesetmultiadddefaultrow().



net-snmptabledataset: Helps you implJement00a5table with automatted storage.(3)
Darwin Mac OS X man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™