RE: Shared table with dynamic row creation

This is a discussion on RE: Shared table with dynamic row creation within the SNMP Users forums, part of the Networking and Network Related category; Hi Dave, Thanks for your answering. I've tried the following: oid agent1_rs_oid[] = { 1,3,6,1,2,1,17,...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-26-2005
Keller, Beat
 
Posts: n/a
Default RE: Shared table with dynamic row creation

Hi Dave,

Thanks for your answering.

I've tried the following:

oid agent1_rs_oid[] = { 1,3,6,1,2,1,17,7,1,4,3,1,5,10000 };

netsnmp_handler_registration *reg =
netsnmp_create_handler_registration("example-demon",
staticHandleSNMPCall,
agent1_rs_oid,
OID_LENGTH( agent1_rs_oid ),
HANDLER_CAN_RWRITE);
reg->range_subid = OID_LENGTH( agent1_rs_oid );
reg->range_ubound = 14094;

netsnmp_register_handler(reg);

But it doesn't work. Only the first index (10000) is registered on the
Masteragent. If I make a call with snmpget to the index 10001 nothing
happens on my subagent. If I change the range_subid to
reg->range_subid = OID_LENGTH( agent1_rs_oid ) - 1;
everything works fine. For me it seems, the last index variable can not be a
range.

Best Regards,
Beat

-----Original Message-----
From: Dave Shield [mailto:D.T.Shield@csc.liv.ac.uk]
Sent: Friday, May 20, 2005 10:27 AM
To: Keller, Beat
Cc: 'net-snmp-users@lists.sourceforge.net'
Subject: Re: Shared table with dynamic row creation

On Thu, 2005-05-19 at 15:20, Keller, Beat wrote:
> I want to implement two subagents that share the dot1qVlanStaticTable.
> Subagent_1 shall be responsible for the rows with index 10001..14094 and
> subagent_2 for the rows 20001..24094.


> How do I have to register this table within the subagents to ensure the
> correct forwarding?


Hmmm....
I'm not sure that AgentX registration is particularly designed for
this situation. It can certainly handle registering a single row
of the table - something like:

oid first_col_oid[] = { .... T, E, C1, Idx };
oid last_col_oid[] = { .... T, E, Cn, Idx };

netsnmp_handler_registration *reg =
netsnmp_create_handler_registration( ..., first_col_oid, ....);
! reg->range_subid = m;
! reg->range_ubound = Cn;

netsnmp_register_table( reg, ...);

(where C1 and Cn are the 'm'th entries in the relevant OID arrays).
That would register the whole of the row with index 'Idx'

But doing this for 8000+ rows would be somewhat unwieldy!


All I can think of is the following - something of a hack,
but it might work:

Use the same range approach to register *just* the relevant
RowStatus objects. Something like:

oid agent1_rs_oid[] = { ...., T, E, Crs, 10001 };
oid agent2_rs_oid[] = { ...., T, E, Crs, 20001 };

netsnmp_handler_registration *reg =
netsnmp_create_handler_registration( ..., agent1_rs_oid, ....);
! reg->range_subid = OID_LENGTH( agent1_rs_oid );
! reg->range_ubound = 14094;

netsnmp_register_table( reg, ...);

(and the same for agent2)


Then in the code to handle the RowStatus assignment, you could
issue the first (one-full-row) registration.



I'm sure there'd be some details to thrash out. But that gives
the basic idea. Unless anyone has any better ideas?

Dave



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users




-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:36 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0