Hi,
Sorry more questions while thinking about it.
1. Let's say I have SET pdu in UCD 4.x style as following:
set a1=1 b1=2 c1=3 a2=4 b2=5 c2=6
a, b, c are columns in my_table, so here I want to set 2 rows with
index=1 and index=2.
My test shows that the calling sequence is changed by agent.
For example, instead of following the order of varbinds in my SET pdu as
following:
write_method_a for a1 RESERVE1
write_method_b for b1 RESERVE1
write_method_c for c1 RESERVE1
write_method_a for a2 RESERVE1
write_method_b for b2 RESERVE1
write_method_c for c2 RESERVE1
The calling sequence is actually:
write_method_a for a1 RESERVE1
write_method_a for a2 RESERVE1
write_method_b for b1 RESERVE1
write_method_b for b2 RESERVE1
write_method_c for c1 RESERVE1
write_method_c for c2 RESERVE1
Then it continues in this order to RESERVE2/ACTION/... phases.
Does net-snmp agent change the order of varbinds? And why? Is there
anyway we can keep the order (of original pdu varbinds)?
2. Since I'm using 4.x style, so I can't walk through the varbinds and
re-arrange the varbinds' order to meet my requirement. But I do have
varbind dependency. For example, I need to set 'b' before I can set 'a'.
Basically this means in ACTION phase of write_method_a for a1, I can't
do anything because b1 is not set yet. Certainly in ACTION phase of
write_method_b for b1, I can set 'b1', but how about 'a1'? Its ACTION
pass is gone already.
3. One way is, ask client to send varbinds in the order that they can be
set sequentially. But agent seems to change that order as mentioned in
#1.
3. Another way is, I can set 'a1' within 'b1' ACTION phase in
write_method_b (right after 'b1' is set), this seems to be not quite
reasonable. Also if 'a1' set fails, the error report will report 'b1'
oid, not oid of 'a1', because it's in write_method_b().
So how does UCD 4.x solve varbinds dependency issue?
Thanks a lot,
Yong Chen
-----Original Message-----
From: Dave Shield [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 07, 2005 1:26 AM
To: Yong Chen (yongche)
Cc: [email protected]
Subject: RE: Multiple sets in one pdu
On Tue, 2005-12-06 at 17:30 -0800, Yong Chen (yongche) wrote:
> how do I walk through the list in 5.x?
> is that the forth input parameter: 'requests', has all incoming
varbinds?
> I just go through it via "request->next"?
Yup.
> Actually I'm doing SET for a table in UCD 4.x style, then how do I
> walk through the incoming varbinds for a SET?
With the v4 style, you'll be passed the varbinds one at a time.
The 'write_xxx' routine will be called for each varbind in turn.
(And then this whole list will be repeated for each pass of the SET
processing - see AGENT.txt for more details).
> The usual basic technique is to walk through the full list of
> assignments, checking them individually and making any preparations
for
> acting on them. RESERVE1 ?
Yup.
> Then walk through the list again, updating the individual
assignments.
> RESERVE2 ?
Yup.
> Then walk through the list *again*, checking that the final state is
> consistent. ACTION ?
Yup.
> Then walk through the list again, tidying up. COMMIT ?
By George, I think he's got it!
(That's not the only way of organising things, but it's probably the
easiest to understand. I can confuse you more by explaining some of
the alternatives, but only if you actually want to know!)
Dave
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&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