This is a discussion on Re: MIB callback handler within the SNMP Coders forums, part of the Networking and Network Related category; This is a multi-part message in MIME format. ------=_NextPart_000_02C2_01C52F11.FBA17860 Content-Type: text/plain; charset="big5" Content-...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
This is a multi-part message in MIME format.
------=_NextPart_000_02C2_01C52F11.FBA17860 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable hi, i have figured out how to add in the handler code. Now i want to process request according to different OID. how should i = do this? Thanks Victor ----- Original Message -----=20 From: Yeo Siow Vic=20 To: net-snmp-coders@lists.sourceforge.net=20 Sent: Tuesday, March 22, 2005 2:40 PM Subject: MIB callback handler hi, I have built a customised MIB into SNMP agent. Now I want to customise the the processing of SNMP GET/SET. I register = a callback function in netsnmp_register_table_data_set(). The callback function is:=20 int dot11xxxxxxx_handler(netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo, netsnmp_agent_request_info *reqinfo, netsnmp_request_info *requests) { /* * perform anything here that you need to do. The requests have * already been processed by the master table_dataset handler, but * this gives you chance to act on the request in some other way * if need be.=20 */ } How to change this function, so that processing is according to OID? = Where can i find example? Rgds, Siow Vic ------=_NextPart_000_02C2_01C52F11.FBA17860 Content-Type: text/html; charset="big5" 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=3Dbig5"> <META content=3D"MSHTML 6.00.2800.1458" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>hi,</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>i have figured out how to add in the = handler=20 code.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Now i want to process request according = to=20 different OID. how should i do this?</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Victor</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV>----- Original Message ----- </DIV> <BLOCKQUOTE dir=3Dltr=20 style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; = BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV=20 style=3D"BACKGROUND: #e4e4e4; FONT: 10pt =B7s=B2=D3=A9=FA=C5=E9; = font-color: black"><B>From:</B>=20 <A title=3Dyeosv@ndc.com.tw href=3D"mailto:yeosv@ndc.com.tw">Yeo Siow = Vic</A>=20 </DIV> <DIV style=3D"FONT: 10pt =B7s=B2=D3=A9=FA=C5=E9"><B>To:</B> <A=20 title=3Dnet-snmp-coders@lists.sourceforge.net=20 = href=3D"mailto:net-snmp-coders@lists.sourceforge.net">net-snmp-coders@lis= ts.sourceforge.net</A>=20 </DIV> <DIV style=3D"FONT: 10pt =B7s=B2=D3=A9=FA=C5=E9"><B>Sent:</B> Tuesday, = March 22, 2005 2:40=20 PM</DIV> <DIV style=3D"FONT: 10pt =B7s=B2=D3=A9=FA=C5=E9"><B>Subject:</B> MIB = callback handler</DIV> <DIV><BR></DIV> <DIV><FONT face=3DArial size=3D2>hi,</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>I have built a customised MIB into = SNMP=20 agent.</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Now I want to customise the the = processing of=20 SNMP GET/SET. I register a callback function in=20 netsnmp_register_table_data_set().</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>The callback function is: = </FONT></DIV><FONT=20 face=3DArial size=3D2> <DIV><BR>int<BR>dot11xxxxxxx_handler(netsnmp_mib_h andler=20 = *handler,<BR> & nbsp; = &n bsp; &= nbsp; &nb sp;=20 netsnmp_handler_registration=20 = *reginfo,<BR> & nbsp; = &n bsp; &= nbsp; &nb sp;=20 netsnmp_agent_request_info=20 = *reqinfo,<BR> & nbsp; = &n bsp; &= nbsp; &nb sp;=20 netsnmp_request_info *requests)<BR>{<BR> =20 /*<BR> * perform anything here that you need = to=20 do. The requests have<BR> * already been = processed by the master table_dataset handler, = but<BR> =20 * this gives you chance to act on the request in some other=20 way<BR> * if need be. = <BR> =20 */</DIV> <DIV> </DIV> <DIV>}</DIV> <DIV></FONT><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>How to change this function, so that = processing=20 is according to OID? Where can i find example?</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT> </DIV> <DIV><FONT face=3DArial size=3D2>Rgds,<BR>Siow=20 Vic</FONT></DIV></BLOCKQUOTE></BODY></HTML> ------=_NextPart_000_02C2_01C52F11.FBA17860-- ------------------------------------------------------- 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-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/...et-snmp-coders |
![]() |
| Thread Tools | |
| Display Modes | |
|
|