I'm trying to implement an indexed table in a perl subagent that will
use agentx to connect to the master agent. Is there a structure that I
can implement that would support GET/GETNEXT operations on the table?

I'm trying to figure out what the struct needs to have to allow it to be
"walked" by GETNEXT

here is some psuedocode:

sub get_data {
    # do some work and build a struct
    return \%my_snmp_data; # as a hashref
}

sub myhandler {
my ( $handler, $registration_info, $request_info, $requests ) = @_;

    my $request;

    # go get my special data
    my $my_snmp_data = get_data();

    for ( $request = $requests ; $request ; $request = $request->next()
) {

        my $oid = $request->getOID();

        if ( $request_info->getMode() == MODE_GET ) {
            # search struct w/ $oid
        }

        elsif ( $request_info->getMode() == MODE_GETNEXT ) {
            # find your row in the struct with $oid
        }

        else {

        }
    }
}




------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
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

Reply via email to