I ran into some problems with the valid_columns field in the
netsnmp_table_registration_info struct.

The only thing I could get to work was a single column list.  When
performing a mibwalk over the table I would get no response from the table
implemented with the valid_columns, and the agent would then become
un-responsive, start using more CPU and have to killed using -9.  Let me
know if I'm not using the netsnmp_column_info correctly.  Note that I'm
using 5.0.6.  Will 5.1.2 work with FreeBSD 3.2?

This was the syntax :


/* globals */
netsnmp_column_info valid_column1, valid_column2;
unsigned int single_list = 2;
unsigned int column_list[3] = {3,5,6};

/* this worked */
initialize_table_foo(void)
{
    ...

    valid_column1.isRange = (char)0;
    valid_column1.list_count = (char)1;
    valid_column1.details.list = &single_list;
    valid_column1.next = NULL;

    /* create the table structure itself */
    table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
    iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
    table_info->valid_columns = &valid_column1;

    ...
}


/* these did not */
initialize_table_foo(void)
{
    ...

    valid_column1.isRange = (char)0;
    valid_column1.list_count = (char)3;
    valid_column1.details.list = &column_list;
    valid_column1.next = NULL;

    /* create the table structure itself */
    table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
    iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
    table_info->valid_columns = &valid_column1;

    ...
}

initialize_table_foo(void)
{
    ...

    valid_column1.isRange = (char)1;
    valid_column1.details.range[0] = 3;
    valid_column1.details.range[1] = 5;
    valid_column1.next = NULL;

    /* create the table structure itself */
    table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
    iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
    table_info->valid_columns = &valid_column1;

    ...
}

initialize_table_foo(void)
{
    ...

    valid_column1.isRange = (char)0;
    valid_column1.list_count = (char)1;
    valid_column1.details.list = &single_list;
    valid_column1.next = &valid_column2;

    valid_column2.isRange = (char)1;
    valid_column2.details.range[0] = 3;
    valid_column2.details.range[1] = 5;
    valid_column2.next = NULL;

    /* create the table structure itself */
    table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
    iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
    table_info->valid_columns = &valid_column1;

    ...
} 

initialize_table_foo(void)
{
    ...

    valid_column1.isRange = (char)0;
    valid_column1.list_count = (char)1;
    valid_column1.details.list = &single_list;
    valid_column1.next = &valid_column2;

    valid_column2.isRange = (char)0;
    valid_column2.list_count = (char)3;
    valid_column2.details.list = &column_list;
    valid_column2.next = NULL;

    /* create the table structure itself */
    table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
    iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
    table_info->valid_columns = &valid_column1;

    ...
}  
    



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Robert
Waltz
Sent: Wednesday, June 16, 2004 1:07 PM
To: '[EMAIL PROTECTED]'
Subject: RE: agentx communication, cores


Thanks for your quick response.  We're going live with our implementation,
so please excuse me if it takes a couple of days to get you those traces.


On Tue, 15 Jun 2004 18:27:46 -0400 Robert wrote:
RW> I'm using net-snmp on FreeBSD 3.2. 

Which version of net-snmp? 5.1.1?

I'm using 5.0.6.  5.1.1 didn't compile under the old FreeBSD.



RW> 1. I have a subagent that supports a rather large table (up to 2000
RW> entries).  I've implemented it using the iterator list.  The problem is
RW> that there are several fields in the table entry that are no longer
RW> supported. Since the iterator walks the entire list for each field
RW> (supported or not) the request can actually timeout before the agent
RW> responds.

You should be able to avoid this by using the valid_columns field of the
netsnmp_table_registration_info. See include/agent/table.h for the structure
definitions. You can mix and match ranges (2-4, 9-12,...) and lists
(15,19,22,...), so long as there is no overlap (e.g (1,3,7)+(5-9)). It's not
an
oft-used feature, so give it a whirl and let us know (ASAP) if it doesn't
seem
to be working for you, and we can try to fix it before 5.1.2 (coming REAL
soon).

This structure is used in the table helper, which is above the iterator
helper,
so they *should* be compatible.

COOOL - I'll give this a whirl.



-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
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