📄 c-agent8.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><link rel="STYLESHEET" type="text/css" href="wrs.css"><title> The WindNet SNMPv1/v2c Agent </title></head><body bgcolor="FFFFFF"><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a></a><a href="c-agent.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-agent7.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-agent9.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p><font face="Helvetica, sans-serif" class="sans"><h3 class="H2"><i><a name="83905">4.8 Hooks</a></i></h3></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83906"> </a>Hooks can be used to modify the processing sequence of <b class="keyword">SET</b> requests. Hooks must be implemented by the agent designer, then compiled and linked into the agent.</p><dd><p class="Body"><a name="83907"> </a>Five hooks may be defined. They must be passed as the last five arguments to the initialization routine <b class="routine"><i class="routine">snmpdInitFinish</i></b><b>( )</b>:</p><dl class="margin"><p class="listspace"><ul class="Bullet2" type="disc"><li><a name="83908"> </a>to validate a <b class="keyword">SET</b> request PDU (the PDU-validation hook)</li></ul></p><p class="listspace"><ul class="Bullet2" type="disc"><li><a name="83909"> </a>before the <b class="command">SET</b> request is processed (the pre-<b class="keyword">set</b>-request hook)</li></ul></p><p class="listspace"><ul class="Bullet2" type="disc"><li><a name="83910"> </a>after the <b class="command">SET</b> request (and, hence, the relevant method routine) has been processed (the post-<b class="keyword">set</b>-request hook)</li></ul></p><p class="listspace"><ul class="Bullet2" type="disc"><li><a name="83911"> </a>upon failure of a <b class="keyword">SET</b> request (the <b class="keyword">set</b>-failure hook)</li></ul></p><p class="listspace"><ul class="Bullet2" type="disc"><li><a name="83912"> </a>to release memory that was privately allocated in <b class="routine"><i class="routine">snmpIoCommunityValidate</i></b><b>( )</b> for packet processing (the private-memory-deallocation hook)</li></ul></p></dl><dd><p class="Body"><a name="83913"> </a>For more information on implementing these hooks, see the manual page for <b class="routine"><i class="routine">snmpdInitFinish</i></b><b>( )</b> in <a href="snmp.refEntries.TOC.html#83416"><i class="title">F. SNMP Reference</i></a>.</p></dl></dl><a name="foot"><hr></a><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a></a><a href="c-agent.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-agent7.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-agent9.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p></body></html><!---by WRS Documentation (), Wind River Systems, Inc. conversion tool: Quadralay WebWorks Publisher 4.0.11 template: CSS Template, Jan 1998 - Jefro --->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -