Robert,
As per your advice I used the netsnmp_column_info structure to indicate
valid columns to the agent. Following is my observation.
When I make a query from the manager on these invalid columns I am
getting 'SNMP_NOSUCHINSTANCE' error, but I am expecting a
'SNMP_NOSUCHOBJECT' error, as these columns are not at all implemented
at the agent side.
Please let me your comments.
Thanks
SrIdhar
Following is my code. Rest of the code is same.
static netsnmp_column_info valid_columns;
static unsigned int column_list [] =
{
COLUMN_IFINDEX,
COLUMN_IFDESCR,
COLUMN_IFTYPE,
COLUMN_IFMTU,
COLUMN_IFSPEED,
COLUMN_IFPHYSADDRESS,
COLUMN_IFADMINSTATUS,
COLUMN_IFOPERSTATUS,
COLUMN_IFLASTCHANGE,
COLUMN_IFINOCTETS,
COLUMN_IFINUCASTPKTS,
/* COLUMN_IFINNUCASTPKTS, -- deprecated */
COLUMN_IFINDISCARDS,
COLUMN_IFINERRORS,
COLUMN_IFINUNKNOWNPROTOS,
COLUMN_IFOUTOCTETS,
COLUMN_IFOUTUCASTPKTS,
/* COLUMN_IFOUTNUCASTPKTS, -- deprecated */
COLUMN_IFOUTDISCARDS,
COLUMN_IFOUTERRORS,
/* COLUMN_IFOUTQLEN, -- deprecated */
/* COLUMN_IFSPECIFIC -- deprecated */
};
int my_initialize_table_ifTable (void)
{
:
:
/*
* Inserted code to filter out invalid columns
*/
valid_columns.isRange = (char) 0;
valid_columns.list_count = (char) 18; /* Total valid columns */
valid_columns.details.list = column_list;
valid_columns.next = NULL;
table_info->valid_columns = &valid_columns;
:
:
}
On Tue, 8 Mar 2005 15:44:12 -0500, "Robert Story" <[EMAIL PROTECTED]>
said:
> On Fri, 25 Feb 2005 19:10:38 +0530 Sridhar wrote:
> SS> It means that the agent I implement should not support these objects.
> In
> SS> the UCD-Style of coding I removed these objects from the
> initialization
> SS> structure, there by preventing them by getting registerd at the
> agent.
> SS> So 'SNMP_NOSUCHOBJECT' error will be returned to the manager.
> SS>
> SS> My question is how can I achieve this by using Net-SNMP style of
> coding.
>
> What handler are you using? As long as you have the table handler in the
> chain,
> you can use the valid_columns structure to indicate which columns the
> agent
> handlers, and it will filter out requests for other columns.
>
> --
> Robert Story; NET-SNMP Junkie
> Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
> Archive:
> <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users>
>
> You are lost in a twisty maze of little standards, all different.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
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