Re: Parsing Get/Set Requests in Table_Handler

"M. Zeeshan - IMS" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Dear Dave,

Thanx for such precious time for guiding.

i have really came across each direction you pointed and was able to understand things much neatly than before i do.

just could not cleanly get one point of about "Handling SET requests"....

as scenario follows:

-----------------------------------------------------------------------
 switch (reqinfo->mode) {

      case MODE_GET:
                  { "This Works Fine" };

      case MODE_SET_RESERVE1:
                  { "Still problem persists" }; 
-----------------------------------------------------------------------



Query:

By reading section 6 of the file 'AGENT.txt' i am still unable to make neat sense and difference between RESERVE, RESERVE2 and ACTION....

can you please specify a simple example to make this sense of or do i have to code for each of them and what will be the differences.

Thanking advance in anticipation.

Regards;

-zeeshan

--- On Mon, 2/2/09, Dave Shield <[email protected]> wrote:
From: Dave Shield <[email protected]>
Subject: Re: Parsing Get/Set Requests in Table_Handler
To: [email protected]
Cc: "net-snmp-users" <[email protected]>
Date: Monday, 2 February, 2009, 1:56 PM

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



      New Email names for you! 
Get the Email name you&#39;ve always wanted on the new @ymail and @rocketmail. 
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com

_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.