On Wed, 12 Sep 2007 19:09:31 +0530 deepak wrote: DB> When a set request is received, my sub-agent completes this operation using DB> transactional semantics. If a set request had come for more than 1 attribute DB> for the same table, then this set would be done as part on one transaction. DB> [...] DB> Now consider when a set is done on attributes belonging to different table DB> [...] DB> Like before, my sub-agent is expected to process the request as a single DB> transaction. The problem is there is a handler generated per table(say h1 DB> and h2 for tables t1 and t2) and my sub-agent has no way of knowing whether DB> the set requests that come through h1 and h2 is part of the same bulk set DB> request. DB> What i want is some way to recognize that all these set requests for DB> different attributes are part of one single request, so that i can DB> accumulate the jobs and then start a single transaction to complete this DB> request.
First of all, you shouldn't say 'bulk set', since there really isn't such a thing, just to keep from confusing the newbies. Now, on to your question about sets with multiple tables. There is no API in net-snmp for associating multiple tables/object with different base OIDs. There are 2 ways for accomplishing what you want: 1) register a handler at the highest common base OID node. That handler would then have to do lots of the work that the agent is currently doing for you. Probably not what you want. 2) Use reference counting. You can add a pointer to the request data list, and count the number of times you see the SET_RESERVE1 state in the handlers with shared state. Then, when you hit the ACTION state, check that counter. If it's non-zero, do your commit and set it to zero. The rest of the ACTION calls will see the zero counter, and do nothing. Make sure to also check the counter and do the right thing in the UNDO state as well. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
