This is a discussion on processing multiple varbinds as a blob within the SNMP Coders forums, part of the Networking and Network Related category; This is a multi-part message in MIME format. --===============2082618905== Content-class: urn:content-classes:message Content-Type: multipart/alternative; ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
This is a multi-part message in MIME format.
--===============2082618905== Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C8A92A.5AFEFFD3" This is a multi-part message in MIME format. ------_=_NextPart_001_01C8A92A.5AFEFFD3 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all, =20 =20 I have a MIB that defines 3 tabular fields that must be processed as a cohesive unit of data. For example IP, netmask, default gateway. I am using net-snmp v5.2.4 and my tables use the iterate-access style of coding. =20 =20 I want to access the three vbs from a single request and set them to "already processed" so they are not checked for validity again. I am going to leave the set logic alone and each var can be set individually, they are just checked as a group. Clearly I could do nothing special and check the group 3 times, but I am trying to be somewhat efficient. =20 =20 I have been analyzing the data structures for=20 =20 netsnmp_request_info *request; netsnmp_table_request_info *table_info; netsnmp_variable_list *var; The request data structure is all the incoming data given to the processing handler. It seems to be a list of requests, each with different lists of varbinds (although mostly common to each other). I see that each varbind in the request in a multivarbind check or set is listed under request->requestvb and that each subsequent request in the submitted list removes a vb from the head of the requestvb list as the check or set is processed. I first thought the request->processed flag would do the trick but subsequent requests in the list could contain the vbs I need to look at. I also see the var->data and var->dataFreeHook() in the varbind structure, I could use this to save some state info (like a boolean = =3D=3D TRUE) to prevent rechecking, and free it when the check routines are complete. My question is. Is there a better way to do this that fits in with the architecture? Is there a way to set a vb as checked that is built in? Thanks in advance, Adam =20 The information contained in this electronic mail transmission = may be privileged and confidential, and therefore, protected = from disclosure. If you have received this communication in = error, please notify us immediately by replying to this = message and deleting it from your computer without copying = or disclosing it. =0D ------_=_NextPart_001_01C8A92A.5AFEFFD3 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Dus-ascii"> <META content=3D"MSHTML 6.00.2900.3314" name=3DGENERATOR></HEAD> <BODY> <DIV><FONT face=3DArial size=3D2><SPAN class=3D012250412-28042008>Hi=20 all,</SPAN></FONT></DIV> <DIV><FONT face=3DArial size=3D2><SPAN=20 class=3D012250412-28042008></SPAN></FONT> </DIV> <DIV><FONT face=3DArial size=3D2><SPAN=20 class=3D012250412-28042008></SPAN></FONT> </DIV> <DIV><FONT face=3DArial size=3D2><SPAN class=3D012250412-28042008>I have = a MIB that=20 defines 3 tabular fields that must be processed as a cohesive unit of=20 data. For example IP, netmask, default = gateway.</SPAN></FONT></DIV> <DIV><FONT face=3DArial size=3D2><SPAN class=3D012250412-28042008>I am = using net-snmp=20 v5.2.4 and my tables use the iterate-access style of = coding.</SPAN></FONT></DIV> <DIV><FONT face=3DArial size=3D2><SPAN=20 class=3D012250412-28042008></SPAN></FONT> </DIV> <DIV><FONT face=3DArial size=3D2><SPAN=20 class=3D012250412-28042008></SPAN></FONT> </DIV> <DIV><FONT face=3DArial size=3D2><SPAN class=3D012250412-28042008>I want = to access the=20 three vbs from a single request and set them to "already processed" so = they are=20 not checked for validity again.</SPAN></FONT></DIV> <DIV><FONT face=3DArial size=3D2><SPAN class=3D012250412-28042008>I am = going to leave=20 the set logic alone and each var can be set individually, they are just = checked=20 as a group.</SPAN></FONT></DIV> <DIV><FONT face=3DArial size=3D2><SPAN = class=3D012250412-28042008>Clearly I could do=20 nothing special and check the group 3 times, but I am trying to be = somewhat=20 efficient.</SPAN></FONT></DIV> <DIV><FONT face=3DArial size=3D2><SPAN=20 class=3D012250412-28042008></SPAN></FONT> </DIV> <DIV><FONT face=3DArial size=3D2><SPAN=20 class=3D012250412-28042008></SPAN></FONT> </DIV> <DIV><FONT face=3DArial size=3D2><SPAN class=3D012250412-28042008>I have = been=20 analyzing the data structures for </SPAN></FONT></DIV> <DIV><FONT><SPAN class=3D012250412-28042008><FONT face=3DArial><FONT = size=3D2><SPAN=20 class=3D012250412-28042008></SPAN></FONT></FONT></SPAN></FONT> </DIV= > <DIV><FONT><SPAN class=3D012250412-28042008><FONT face=3DArial><FONT = size=3D2><SPAN=20 class=3D012250412-28042008>n</SPAN>etsnmp_request_info=20 *request;<BR></FONT></FONT><FONT face=3DArial = size=3D2>netsnmp_table_request_info=20 *table_info;<BR></FONT><FONT face=3DArial size=3D2>netsnmp_variable_list = *var;</FONT></DIV> <DIV> <P><SPAN class=3D012250412-28042008><FONT face=3DArial size=3D2>The = request data=20 structure is all the incoming data given to the processing handler. It = seems to=20 be a list of requests, each with different lists of varbinds (although = mostly=20 common to each other). I see that each varbind in the=20 <STRONG>request</STRONG> in a multivarbind check or set is listed under=20 <STRONG>request->requestvb</STRONG> and that each subsequent=20 <STRONG>request</STRONG> in the submitted list removes a vb from the = head of the=20 <STRONG>requestvb</STRONG> list as the check or set is processed. = I first=20 thought the <STRONG>request->processed</STRONG> flag would do the = trick but=20 subsequent <STRONG>requests</STRONG> in the list could contain the vbs I = need to=20 look at.</FONT></SPAN></P> <P><SPAN class=3D012250412-28042008><FONT face=3DArial size=3D2>I also = see the=20 <STRONG>var->data</STRONG> and = <STRONG>var->dataFreeHook()</STRONG> in the=20 varbind structure, I could use this to save some state info (like a = boolean=20 =3D=3D TRUE) to prevent rechecking, and free it when the check = routines=20 are complete.</FONT></SPAN></P> <P><SPAN class=3D012250412-28042008><FONT face=3DArial size=3D2>My = question is. =20 Is there a better way to do this that fits in with the = architecture? Is=20 there a way to set a vb as checked that is built in?</FONT></SPAN></P> <P><SPAN class=3D012250412-28042008><FONT face=3DArial size=3D2>Thanks = in=20 advance,<BR></FONT></SPAN><SPAN class=3D012250412-28042008><FONT = face=3DArial=20 size=3D2>Adam</FONT></SPAN></P> <P><SPAN class=3D012250412-28042008><FONT face=3DArial=20 size=3D2></FONT></SPAN> </P></SPAN></FONT></DIV></BODY></HTML> <pre>The information contained in this electronic mail transmission = may be privileged and confidential, and therefore, protected = from disclosure. If you have received this communication in = error, please notify us immediately by replying to this = message and deleting it from your computer without copying = or disclosing it. =0D ------_=_NextPart_001_01C8A92A.5AFEFFD3-- --===============2082618905== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757...un.com/javaone --===============2082618905== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/...et-snmp-coders --===============2082618905==-- |