Manual Pages for UNIX Darwin command on man netsnmp_table
MyWebUniversity

Manual Pages for UNIX Darwin command on man netsnmp_table

table: Helps you implement a table.(3) table: Helps you implement a table.(3)

NAME

netsnmptable - Helps you implement a table.

MMoodduulleess groupttaabblleeaarrrraayy:: HHeellppss yyoouu iimmpplleemmeenntt aa ttaabbllee wwhheenn ddaattaa ccaann bbee ssttoorreedd locally. The data is stored in a sorted array, using a binary sseeaarrcchh ffoorr llooookkuuppss.. The tablearray handler is used (automatically) in conjuntion with the ttaabbllee handler. groupttaabblleeccoonnttaaiinneerr:: HHeellppss yyoouu iimmpplleemmeenntt aa ttaabbllee wwhheenn ddaattaa ccaann bbee ffoouunndd vviiaa aa nneettssnnmmppccoonnttaaiinneerr.. The tablecontainer handler is used (automatically) in conjuntion with the ttaabbllee handler. groupttaabblleeddaattaa:: HHeellppss yyoouu iimmpplleemmeenntt aa ttaabbllee wwiitthh ddaattaammaatttteedd ssttoorraaggee.. 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. rutableiterator: The table iterator helper is designed to simplify

tthhee ttaasskk ooff wwrriittiinngg aa ttaabbllee hhaannddlleerr ffoorr tthhee nneett-ssnnmmpp aaggeenntt wwhheenn tthhee

ddaattaa bbeeiinngg aacccceesssseedd iiss nnoott iinn aann ooiidd ssoorrtteedd ffoorrmm aanndd mmuusstt bbee aacccceesssseedd eexxtteerrnnaallllyy.. Functionally, it is a specialized version of the more generic table helper but easies the burden of GETNEXT processing by manually looping through all the data indexes retrieved through function calls which should be supplied by the module that wishes help. DDeeffiinneess

dfn SPARSETABLEHANDLERNAME 'preal'

FFuunnccttiioonnss nneettssnnmmppmmiibbhhaannddlleerr * nneettssnnmmppggeettttaabblleehhaannddlleerr (nneettssnnmmppttaabblleerreeggiissttrraattiioonniinnffoo *tabreq) Given a netsnmptableregistrationinfo object, creates a table handler. int nneettssnnmmpprreeggiisstteerrttaabbllee (nneettssnnmmpphhaannddlleerrrreeggiissttrraattiioonn *reginfo, nneettssnnmmppttaabblleerreeggiissttrraattiioonniinnffoo *tabreq) creates a table handler given the netsnmptableregistrationinfo object, inserts it into the request chain and then calls nneettssnnmmpprreeggiisstteerrhhaannddlleerr(()) to register the table into the agent. NETSNMPINLINE nneettssnnmmppttaabblleerreeqquueessttiinnffoo * nneettssnnmmppeexxttrraaccttttaabblleeiinnffoo (nneettssnnmmpprreeqquueessttiinnffoo *request) Extracts the processed table information from a given request. nneettssnnmmppttaabblleerreeggiissttrraattiioonniinnffoo * nneettssnnmmppffiinnddttaabblleerreeggiissttrraattiioonniinnffoo (nneettssnnmmpphhaannddlleerrrreeggiissttrraattiioonn *reginfo) extracts the registered netsnmptableregistrationinfo object from a netsnmphandlerregistration object int ttaabblleehheellppeerrhhaannddlleerr (nneettssnnmmppmmiibbhhaannddlleerr *handler, nneettssnnmmpphhaannddlleerrrreeggiissttrraattiioonn *reginfo, nneettssnnmmppaaggeennttrreeqquueessttiinnffoo *reqinfo, nneettssnnmmpprreeqquueessttiinnffoo *requests) implements the table helper handler nneettssnnmmppmmiibbhhaannddlleerr * nneettssnnmmppssppaarrsseettaabblleehhaannddlleerrggeett (void) create sparse table handler int nneettssnnmmppssppaarrsseettaabblleerreeggiisstteerr (nneettssnnmmpphhaannddlleerrrreeggiissttrraattiioonn *reginfo, nneettssnnmmppttaabblleerreeggiissttrraattiioonniinnffoo *tabreq) creates a table handler given the netsnmptableregistrationinfo object, inserts it into the request chain and then calls nneettssnnmmpprreeggiisstteerrhhaannddlleerr(()) to register the table into the agent. int nneettssnnmmppttaabblleebbuuiillddrreessuulltt (nneettssnnmmpphhaannddlleerrrreeggiissttrraattiioonn *reginfo, nneettssnnmmpprreeqquueessttiinnffoo *reqinfo, nneettssnnmmppttaabblleerreeqquueessttiinnffoo *tableinfo, uchar type, uchar *result, sizet resultlen) Builds the result to be returned to the agent given the table information. int nneettssnnmmppttaabblleebbuuiillddooiidd (nneettssnnmmpphhaannddlleerrrreeggiissttrraattiioonn *reginfo, nneettssnnmmpprreeqquueessttiinnffoo *reqinfo, nneettssnnmmppttaabblleerreeqquueessttiinnffoo *tableinfo) given a registration info object, a request object and the table

info object it builds the request->requestvb->name oid from the

index values and column information found in the tableinfo object. int nneettssnnmmppttaabblleebbuuiillddooiiddffrroommiinnddeexx (nneettssnnmmpphhaannddlleerrrreeggiissttrraattiioonn *reginfo, nneettssnnmmpprreeqquueessttiinnffoo *reqinfo, nneettssnnmmppttaabblleerreeqquueessttiinnffoo *tableinfo) given a registration info object, a request object and the table

info object it builds the request->requestvb->name oid from the

index values and column information found in the tableinfo object. int nneettssnnmmppuuppddaatteevvaarriiaabblleelliissttffrroommiinnddeexx (nneettssnnmmppttaabblleerreeqquueessttiinnffoo *tri) parses an OID into table indexses int nneettssnnmmppuuppddaatteeiinnddeexxeessffrroommvvaarriiaabblleelliisstt (nneettssnnmmppttaabblleerreeqquueessttiinnffoo *tri) builds an oid given a set of indexes. int nneettssnnmmppcchheecckkggeettnneexxttrreeppllyy (nneettssnnmmpprreeqquueessttiinnffoo *request, oid *prefix, sizet prefixlen, nneettssnnmmppvvaarriiaabblleelliisstt *newvar, nneettssnnmmppvvaarriiaabblleelliisstt **outvar) checks the original request against the current data being passed in if its greater than the request oid but less than the current valid return, set the current valid return to the new value. DDeettaaiilleedd DDeessccrriippttiioonn This handler helps you implement a table by doing some of the processing for you. This handler truly shows the power of the new handler mechanism. By creating a table handler and injecting it into your calling chain, or by using the nneettssnnmmpprreeggiisstteerrttaabbllee(()) function

to register your table, you get access to some pre-parsed information.

Specifically, the table handler pulls out the column number and indexes from the request oid so that you don't have to do the complex work to do that parsing within your own code. To do this, the table handler needs to know up front how your table is structured. To inform it about this, you fill in a tableregisterationinfo structure that is passed to the table handler. It contains the asn index types for the table as well as the minimum and maximum column that should be used. FFuunnccttiioonn DDooccuummeennttaattiioonn iinntt nneettssnnmmppcchheecckkggeettnneexxttrreeppllyy ((nneettssnnmmpprreeqquueessttiinnffoo ** rreeqquueesstt,, ooiidd ** pprreeffiixx,, ssiizzeett pprreeffiixxlleenn,, nneettssnnmmppvvaarriiaabblleelliisstt ** nneewwvvaarr,, nneettssnnmmppvvaarriiaabblleelliisstt **** oouuttvvaarr)) checks the original request against the current data being passed in if its greater than the request oid but less than the current valid return, set the current valid return to the new value. returns 1 if outvar was replaced with the oid from newvar (success). returns 0 if not. Definition at line 872 of file table.c. References variablelist::name, variablelist::namelength, netsnmprequestinfos::requestvb, snmpoidcompare(), snmpsetvartypedvalue(), variablelist::type, variablelist::val, and variablelist::vallen. Referenced by netsnmptableiteratorhelperhandler(). NNEETTSSNNMMPPIINNLLIINNEE nneettssnnmmppttaabblleerreeqquueessttiinnffoo** nneettssnnmmppeexxttrraaccttttaabblleeiinnffoo ((nneettssnnmmpprreeqquueessttiinnffoo ** rreeqquueesstt)) Extracts the processed table information from a given request. Call this from subhandlers on a request to extract the processed netsnmprequestinfo information. The resulting information includes the index values and the column number. PPaarraammeetteerrss:: request populated netsnmp request structure RReettuurrnnss:: populated netsnmptablerequestinfo structure Definition at line 128 of file table.c. References netsnmprequestgetlistdata(). Referenced by netsnmpinsertiteratorcontext(), netsnmpinserttablerow(), netsnmptabledatahelperhandler(), netsnmptabledatasethelperhandler(), netsnmptableiteratorhelperhandler(), and tablehelperhandler(). nneettssnnmmppttaabblleerreeggiissttrraattiioonniinnffoo** nneettssnnmmppffiinnddttaabblleerreeggiissttrraattiioonniinnffoo ((nneettssnnmmpphhaannddlleerrrreeggiissttrraattiioonn ** rreeggiinnffoo)) extracts the registered netsnmptableregistrationinfo object from a netsnmphandlerregistration object Definition at line 137 of file table.c. References netsnmpfindhandlerdatabyname(), and netsnmphandlerregistration. Referenced by netsnmptabledatahelperhandler(), and netsnmptableiteratorhelperhandler(). nneettssnnmmppmmiibbhhaannddlleerr** nneettssnnmmppggeettttaabblleehhaannddlleerr ((nneettssnnmmppttaabblleerreeggiissttrraattiioonniinnffoo ** ttaabbrreeqq)) Given a netsnmptableregistrationinfo object, creates a table handler. You can use this table handler by injecting it into a calling chain. When the handler gets called, it'll do processing and store it's

information into the request->parentdata structure.

The table helper handler pulls out the column number and indexes from the request oid so that you don't have to do the complex work of parsing within your own code. PPaarraammeetteerrss:: tabreq is a pointer to a netsnmptableregistrationinfo struct. The table handler needs to know up front how your table is structured. A netsnmptableregisterationinfo structure that is passed to the table handler should contain the asn index types for the table as well as the minimum and maximum column that should be used. RReettuurrnnss:: Returns a pointer to a netsnmpmibhandler struct which contains the handler's name and the access method Definition at line 88 of file table.c. References netsnmptableregistrationinfos::indexes, netsnmpmibhandlers::myvoid, netsnmpcreatehandler(), netsnmpmibhandler, netsnmptableregistrationinfos::numberindexes, and snmplog(). Referenced by netsnmpregistertable(), and netsnmpsparsetableregister(). iinntt nneettssnnmmpprreeggiisstteerrttaabbllee ((nneettssnnmmpphhaannddlleerrrreeggiissttrraattiioonn ** rreeggiinnffoo,, nneettssnnmmppttaabblleerreeggiissttrraattiioonniinnffoo ** ttaabbrreeqq)) creates a table handler given the netsnmptableregistrationinfo object, inserts it into the request chain and then calls nneettssnnmmpprreeggiisstteerrhhaannddlleerr(()) to register the table into the agent. Definition at line 111 of file table.c. References netsnmpgettablehandler(), netsnmphandlerregistration, netsnmpinjecthandler(), and netsnmpregisterhandler(). Referenced by netsnmpregistertabledata(), netsnmpregistertableiterator(), and netsnmptablecontainerregister(). nneettssnnmmppmmiibbhhaannddlleerr** nneettssnnmmppssppaarrsseettaabblleehhaannddlleerrggeett ((vvooiidd)) create sparse table handler Definition at line 710 of file table.c. References netsnmpcreatehandler(). iinntt nneettssnnmmppssppaarrsseettaabblleerreeggiisstteerr ((nneettssnnmmpphhaannddlleerrrreeggiissttrraattiioonn ** rreeggiinnffoo,, nneettssnnmmppttaabblleerreeggiissttrraattiioonniinnffoo ** ttaabbrreeqq)) creates a table handler given the netsnmptableregistrationinfo object, inserts it into the request chain and then calls nneettssnnmmpprreeggiisstteerrhhaannddlleerr(()) to register the table into the agent. Definition at line 721 of file table.c. References netsnmpcreatehandler(), netsnmpgettablehandler(), netsnmphandlerregistration, netsnmpinjecthandler(), and netsnmpregisterhandler(). iinntt nneettssnnmmppttaabblleebbuuiillddooiidd ((nneettssnnmmpphhaannddlleerrrreeggiissttrraattiioonn ** rreeggiinnffoo,, nneettssnnmmpprreeqquueessttiinnffoo ** rreeqqiinnffoo,, nneettssnnmmppttaabblleerreeqquueessttiinnffoo ** ttaabblleeiinnffoo)) given a registration info object, a request object and the table info

object it builds the request->requestvb->name oid from the index values

and column information found in the tableinfo object. Index values are extracted from the tableinfo varbinds. .Entry References buildoid(), netsnmptablerequestinfos::colnum, netsnmptablerequestinfos::indexes, variablelist::name, variablelist::namelength, netsnmphandlerregistration, netsnmprequestinfos::requestvb, netsnmphandlerregistrations::rootoid, and netsnmphandlerregistrations::rootoidlen. Referenced by netsnmptablebuildresult(). iinntt nneettssnnmmppttaabblleebbuuiillddooiiddffrroommiinnddeexx ((nneettssnnmmpphhaannddlleerrrreeggiissttrraattiioonn ** rreeggiinnffoo,, nneettssnnmmpprreeqquueessttiinnffoo ** rreeqqiinnffoo,, nneettssnnmmppttaabblleerreeqquueessttiinnffoo ** ttaabblleeiinnffoo)) given a registration info object, a request object and the table info

object it builds the request->requestvb->name oid from the index values

and column information found in the tableinfo object. Index values are extracted from the tableinfo index oid. Definition at line 809 of file table.c. References netsnmptablerequestinfos::colnum, netsnmptablerequestinfos::indexoid, netsnmptablerequestinfos::indexoidlen, variablelist::name, variablelist::namelength, variablelist::nameloc, netsnmphandlerregistration, netsnmprequestinfos::requestvb, netsnmphandlerregistrations::rootoid, netsnmphandlerregistrations::rootoidlen, and SNMPFREE. iinntt nneettssnnmmppttaabblleebbuuiillddrreessuulltt ((nneettssnnmmpphhaannddlleerrrreeggiissttrraattiioonn ** rreeggiinnffoo,, nneettssnnmmpprreeqquueessttiinnffoo ** rreeqqiinnffoo,, nneettssnnmmppttaabblleerreeqquueessttiinnffoo ** ttaabblleeiinnffoo,, uucchhaarr ttyyppee,, uucchhaarr ** rreessuulltt,, ssiizzeett rreessuullttlleenn)) Builds the result to be returned to the agent given the table information. Use this function to return results from lowel level handlers to the agent. It takes care of building the proper resulting oid (containing proper indexing) and inserts the result value into the returning varbind. Definition at line 739 of file table.c. References variablelist::name, variablelist::nameloc, netsnmphandlerregistration, netsnmptablebuildoid(), netsnmprequestinfos::requestvb, and snmpsetvartypedvalue(). iinntt nneettssnnmmppuuppddaatteeiinnddeexxeessffrroommvvaarriiaabblleelliisstt ((nneettssnnmmppttaabblleerreeqquueessttiinnffoo ** ttrrii)) builds an oid given a set of indexes. Definition at line 854 of file table.c. References netsnmptablerequestinfos::indexoid, netsnmptablerequestinfos::indexoidlen, and netsnmptablerequestinfos::indexes. iinntt nneettssnnmmppuuppddaatteevvaarriiaabblleelliissttffrroommiinnddeexx ((nneettssnnmmppttaabblleerreeqquueessttiinnffoo ** ttrrii)) parses an OID into table indexses Definition at line 838 of file table.c. References netsnmptablerequestinfos::indexoid, netsnmptablerequestinfos::indexoidlen, and netsnmptablerequestinfos::indexes. iinntt ttaabblleehheellppeerrhhaannddlleerr ((nneettssnnmmppmmiibbhhaannddlleerr ** hhaannddlleerr,, nneettssnnmmpphhaannddlleerrrreeggiissttrraattiioonn ** rreeggiinnffoo,, nneettssnnmmppaaggeennttrreeqquueessttiinnffoo ** rreeqqiinnffoo,, nneettssnnmmpprreeqquueessttiinnffoo ** rreeqquueessttss))

implements the table helper handler XXX-rks: memory leak. add cleanup

handler? none available got one ok for loop Definition at line 145 of file table.c. References netsnmptablerequestinfos::colnum, netsnmpmibhandlers::handlername, netsnmptablerequestinfos::indexoid, netsnmptablerequestinfos::indexoidlen, netsnmptablerequestinfos::indexes, netsnmptableregistrationinfos::indexes, netsnmptableregistrationinfos::maxcolumn, netsnmptableregistrationinfos::mincolumn, netsnmpagentrequestinfos::mode, netsnmpmibhandlers::myvoid, variablelist::name, variablelist::namelength, variablelist::nameloc, netsnmpcallnexthandler(), netsnmpcreatedatalist(), netsnmpextracttableinfo(), netsnmphandlerregistration, netsnmpmibhandler, netsnmprequestaddlistdata(), netsnmpsetrequesterror(), netsnmprequestinfos::next, netsnmpmibhandlers::next, netsnmptableregistrationinfos::numberindexes, netsnmptablerequestinfos::numberindexes, netsnmprequestinfos::processed, netsnmptablerequestinfos::reginfo, netsnmprequestinfos::requestvb, netsnmphandlerregistrations::rootoid, netsnmphandlerregistrations::rootoidlen, snmplog(), SNMPMALLOCTYPEDEF, snmpoidcompare(), sprintreallocbytype(), netsnmprequestinfos::status, variablelist::type, and netsnmptableregistrationinfos::validcolumns.

net-snmp 24 Jant2a0b0l5e: Helps you implement a table.(3)




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