Re: Processing of multiple varbinds in a SNMP PDU

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 26/07/07, Mayank Maheshwari <[email protected]> wrote:
> At my MID level agent if I get multiple varbinds in a single PDU I have pass
> all these varbinds to device in a single PDU.
> If I get varbinds say var1, var2,var3 in a single SNMP SET PDU, net-snmp
> will make following function calls in sequence -
> RESERVE1 for var1
> RESERVE1 for var2
> RESERVE1 for var3
    <etc>

How are you registering the MIB objects?
If you are using the old v4 API, then yes, each varbind is handled separately.
If you are using the newer v5 handler-based API, then each handler should
be called once with *all* the varbinds relevant to that handler.


> I want to create a SNMP SET PDU for device when the COMMIT is called for the
> last varbind of the SNMP PDU received at mid level agent.

How will you handle a failure in this forwarded SET?


> Is there any way to find out if the COMMIT is being called for the last
> varbind in the PDU?

If you're using the v5 API (and a suitable registration), then you should just
have a single call for each pass.
  Otherwise, you can make a note of which is the last OID in one of the earlier
passes, and then use that information in the COMMIT pass.

    case ACTION:
         lastOID = thisOID;
         break;

   case COMMIT:
        if ( thisOID == lastOID )
             send_pdu()
        break;

Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.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.