Re: Parsing Get/Set Requests in Table_Handler
Dave Shield <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
2009/1/30 M. Zeeshan - IMS <[email protected]>: > Required Scenairo/Psedocode: > > I want to parse the Get/Set requests inside the Table_Handler() registered > via netsnmp_register_table_data_set(); > > > Table_Handler() > { > Queries: > 2. Will this for loop on "requests", satisfy the purpose. > for (; requests; requests = requests->next) { You would be better off using a separate variable, rather than meddling with the parameter value itself. Try: netsnmp_request req; for ( req=requests; req; req=req->next ) { (The effect is the same, but it's a somewhat cleaner approach) > 1. How can i find the Row/Index in above handler. netsnmp_table_request_info *tinfo = netsnmp_extract_table_info( request );:q The field 'tinfo->indexes' is then the head of a varbind list, containing the list of index values. > 3. which mode or combination of modes i must use for SET See section 6 of the file 'AGENT.txt' (in the source distribution, or on the project web page). This describes the old UCD v4-style module code, but the multi-pass processing of SET requests is exactly the same. > 1. I used mib2c.create-dataset.conf for code generation, did i chose right > one or i may have used mib2c.iterate.conf. There is no single "right one" - it all depends on the characteristics of your table, and exactly what you want to do. The main characteristic of the table_data_set framework is that it deals with handling the GET and SET value processing automatically. You don't actually need a table-specific handler routine at all (unless you want to interact with another underlying subsystem). This is ideal for self-contained MIB tables - one that are purely used within the agent itself. See the project FAQ for a brief comparison of the various table helpers. Dave ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users