agent__handler_8h.html from net-snmp at Krugle
Show agent__handler_8h.html syntax highlighted
<!--#set var="section" value="development" -->
<!--#include virtual="/page-top.html" -->
<!-- CONTENT START -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>agent_handler.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.2.11 -->
<center>
<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> <a class="qindex" href="globals.html">Globals</a> </center>
<hr><h1>agent_handler.h File Reference</h1>
<p>
<a href="agent__handler_8h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=2><br><h2>Data Structures</h2></td></tr>
<tr><td nowrap align=right valign=top>struct </td><td valign=bottom><a class="el" href="structdelegated__cache__s.html">delegated_cache_s</a></td></tr>
<tr><td nowrap align=right valign=top>struct </td><td valign=bottom><a class="el" href="structhandler__registration__s.html">handler_registration_s</a></td></tr>
<tr><td nowrap align=right valign=top>struct </td><td valign=bottom><a class="el" href="structmib__handler__s.html">mib_handler_s</a></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a0">HANDLER_CAN_GETANDGETNEXT</a> 0x1</td></tr>
<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a1">HANDLER_CAN_SET</a> 0x2</td></tr>
<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a2">HANDLER_CAN_GETBULK</a> 0x4</td></tr>
<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a3">HANDLER_CAN_RONLY</a> (HANDLER_CAN_GETANDGETNEXT)</td></tr>
<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a4">HANDLER_CAN_RWRITE</a> (HANDLER_CAN_GETANDGETNEXT | HANDLER_CAN_SET)</td></tr>
<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a5">HANDLER_CAN_DEFAULT</a> HANDLER_CAN_RONLY</td></tr>
<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a6">REQUEST_IS_DELEGATED</a> 1</td></tr>
<tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a7">REQUEST_IS_NOT_DELEGATED</a> 0</td></tr>
<tr><td colspan=2><br><h2>Typedefs</h2></td></tr>
<tr><td nowrap align=right valign=top>typedef <a class="el" href="structmib__handler__s.html">mib_handler_s</a> </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a8">mib_handler</a></td></tr>
<tr><td nowrap align=right valign=top>typedef <a class="el" href="structhandler__registration__s.html">handler_registration_s</a> </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a9">handler_registration</a></td></tr>
<tr><td nowrap align=right valign=top>typedef <a class="el" href="structdelegated__cache__s.html">delegated_cache_s</a> </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a10">delegated_cache</a></td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td nowrap align=right valign=top>typedef </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a11">int</a> (NodeHandler)(<a class="el" href="helpers_2agent__handler_8h.html#a8">mib_handler</a> *handler, <a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> *reginfo, <a class="el" href="snmp__agent_8h.html#a21">agent_request_info</a> *reqinfo, <a class="el" href="snmp__agent_8h.html#a18">request_info</a> *requests)</td></tr>
<tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a12">register_handler</a> (<a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> *reginfo)</td></tr>
<tr><td> </td><td><font size=-1><em>register a handler, as defined by the handler_registration pointer.</em> <a href="#a12">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a13">inject_handler</a> (<a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> *reginfo, <a class="el" href="helpers_2agent__handler_8h.html#a8">mib_handler</a> *handler)</td></tr>
<tr><td> </td><td><font size=-1><em>inject a new handler into the calling chain of the handlers definedy by the handler_registration pointer.</em> <a href="#a13">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="helpers_2agent__handler_8h.html#a8">mib_handler</a> * </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a14">find_handler_by_name</a> (<a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> *reginfo, char *name)</td></tr>
<tr><td> </td><td><font size=-1><em>Returns a handler from a chain based on the name.</em> <a href="#a14">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void * </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a15">find_handler_data_by_name</a> (<a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> *reginfo, char *name)</td></tr>
<tr><td> </td><td><font size=-1><em>Returns a handler's void * pointer from a chain based on the name.</em> <a href="#a15">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a16">call_handlers</a> (<a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> *reginfo, <a class="el" href="snmp__agent_8h.html#a21">agent_request_info</a> *reqinfo, <a class="el" href="snmp__agent_8h.html#a18">request_info</a> *requests)</td></tr>
<tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a17">call_handler</a> (<a class="el" href="helpers_2agent__handler_8h.html#a8">mib_handler</a> *next_handler, <a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> *reginfo, <a class="el" href="snmp__agent_8h.html#a21">agent_request_info</a> *reqinfo, <a class="el" href="snmp__agent_8h.html#a18">request_info</a> *requests)</td></tr>
<tr><td> </td><td><font size=-1><em>calls a handler with with appropriate NULL checking, etc.</em> <a href="#a17">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a18">call_next_handler</a> (<a class="el" href="helpers_2agent__handler_8h.html#a8">mib_handler</a> *current, <a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> *reginfo, <a class="el" href="snmp__agent_8h.html#a21">agent_request_info</a> *reqinfo, <a class="el" href="snmp__agent_8h.html#a18">request_info</a> *requests)</td></tr>
<tr><td> </td><td><font size=-1><em>calls the next handler in the chain after the current one with with appropriate NULL checking, etc.</em> <a href="#a18">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="helpers_2agent__handler_8h.html#a8">mib_handler</a> * </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a19">create_handler</a> (const char *name, NodeHandler *handler_access_method)</td></tr>
<tr><td> </td><td><font size=-1><em>creates a mib_handler structure given a name and a access method.</em> <a href="#a19">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> * </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a20">create_handler_registration</a> (const char *name, NodeHandler *handler_access_method, oid *reg_oid, size_t reg_oid_len, int modes)</td></tr>
<tr><td> </td><td><font size=-1><em>creates a handler registration structure given a name, a access_method function, a registration location oid and the modes the handler supports.</em> <a href="#a20">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="helpers_2agent__handler_8h.html#a10">delegated_cache</a> * </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a21">create_delegated_cache</a> (<a class="el" href="helpers_2agent__handler_8h.html#a8">mib_handler</a> *, <a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> *, <a class="el" href="snmp__agent_8h.html#a21">agent_request_info</a> *, <a class="el" href="snmp__agent_8h.html#a18">request_info</a> *, void *)</td></tr>
<tr><td> </td><td><font size=-1><em>creates a cache of information which can be saved for future reference.</em> <a href="#a21">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="helpers_2agent__handler_8h.html#a10">delegated_cache</a> * </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a22">handler_check_cache</a> (<a class="el" href="helpers_2agent__handler_8h.html#a10">delegated_cache</a> *dcache)</td></tr>
<tr><td> </td><td><font size=-1><em>check's a given cache and returns it if it is still valid (ie, the agent still considers it to be an outstanding request.</em> <a href="#a22">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a23">request_add_list_data</a> (<a class="el" href="snmp__agent_8h.html#a18">request_info</a> *request, data_list *node)</td></tr>
<tr><td nowrap align=right valign=top>void * </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a24">request_get_list_data</a> (<a class="el" href="snmp__agent_8h.html#a18">request_info</a> *request, const char *name)</td></tr>
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a25">free_request_data_set</a> (<a class="el" href="snmp__agent_8h.html#a18">request_info</a> *request)</td></tr>
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a26">free_request_data_sets</a> (<a class="el" href="snmp__agent_8h.html#a18">request_info</a> *request)</td></tr>
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a27">handler_mark_requests_as_delegated</a> (<a class="el" href="snmp__agent_8h.html#a18">request_info</a> *, int)</td></tr>
<tr><td> </td><td><font size=-1><em>marks a list of requests as delegated (or not if isdelegaded = 0).</em> <a href="#a27">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void * </td><td valign=bottom><a class="el" href="agent__handler_8h.html#a28">handler_get_parent_data</a> (<a class="el" href="snmp__agent_8h.html#a18">request_info</a> *, const char *)</td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a name="a5" doxytag="agent_handler.h::HANDLER_CAN_DEFAULT"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define HANDLER_CAN_DEFAULT HANDLER_CAN_RONLY
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="agent__handler_8h-source.html#l00029">29</a> of file <a class="el" href="agent__handler_8h-source.html">agent_handler.h</a>. </td>
</tr>
</table>
<a name="a0" doxytag="agent_handler.h::HANDLER_CAN_GETANDGETNEXT"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define HANDLER_CAN_GETANDGETNEXT 0x1
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="agent__handler_8h-source.html#l00023">23</a> of file <a class="el" href="agent__handler_8h-source.html">agent_handler.h</a>. </td>
</tr>
</table>
<a name="a2" doxytag="agent_handler.h::HANDLER_CAN_GETBULK"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define HANDLER_CAN_GETBULK 0x4
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="agent__handler_8h-source.html#l00025">25</a> of file <a class="el" href="agent__handler_8h-source.html">agent_handler.h</a>. </td>
</tr>
</table>
<a name="a3" doxytag="agent_handler.h::HANDLER_CAN_RONLY"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define HANDLER_CAN_RONLY (HANDLER_CAN_GETANDGETNEXT)
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="agent__handler_8h-source.html#l00027">27</a> of file <a class="el" href="agent__handler_8h-source.html">agent_handler.h</a>. </td>
</tr>
</table>
<a name="a4" doxytag="agent_handler.h::HANDLER_CAN_RWRITE"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define HANDLER_CAN_RWRITE (HANDLER_CAN_GETANDGETNEXT | HANDLER_CAN_SET)
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="agent__handler_8h-source.html#l00028">28</a> of file <a class="el" href="agent__handler_8h-source.html">agent_handler.h</a>. </td>
</tr>
</table>
<a name="a1" doxytag="agent_handler.h::HANDLER_CAN_SET"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define HANDLER_CAN_SET 0x2
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="agent__handler_8h-source.html#l00024">24</a> of file <a class="el" href="agent__handler_8h-source.html">agent_handler.h</a>. </td>
</tr>
</table>
<a name="a6" doxytag="agent_handler.h::REQUEST_IS_DELEGATED"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define REQUEST_IS_DELEGATED 1
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="agent__handler_8h-source.html#l00112">112</a> of file <a class="el" href="agent__handler_8h-source.html">agent_handler.h</a>. </td>
</tr>
</table>
<a name="a7" doxytag="agent_handler.h::REQUEST_IS_NOT_DELEGATED"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define REQUEST_IS_NOT_DELEGATED 0
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="agent__handler_8h-source.html#l00113">113</a> of file <a class="el" href="agent__handler_8h-source.html">agent_handler.h</a>. </td>
</tr>
</table>
<hr><h2>Typedef Documentation</h2>
<a name="a10" doxytag="agent_handler.h::delegated_cache"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef struct <a class="el" href="structdelegated__cache__s.html">delegated_cache_s</a> delegated_cache
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<a name="a9" doxytag="agent_handler.h::handler_registration"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef struct <a class="el" href="structhandler__registration__s.html">handler_registration_s</a> handler_registration
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<a name="a8" doxytag="agent_handler.h::mib_handler"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef struct <a class="el" href="structmib__handler__s.html">mib_handler_s</a> mib_handler
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a name="a17" doxytag="agent_handler.h::call_handler"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int call_handler </td>
<td class="md">( </td>
<td class="md" nowrap><a class="el" href="helpers_2agent__handler_8h.html#a8">mib_handler</a> * </td>
<td class="mdname"> <em>next_handler</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> * </td>
<td class="mdname"> <em>reginfo</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="snmp__agent_8h.html#a21">agent_request_info</a> * </td>
<td class="mdname"> <em>reqinfo</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="snmp__agent_8h.html#a18">request_info</a> * </td>
<td class="mdname"> <em>requests</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
calls a handler with with appropriate NULL checking, etc.
<p>
<p>
Definition at line <a class="el" href="helpers_2agent__handler_8c-source.html#l00136">136</a> of file <a class="el" href="helpers_2agent__handler_8c-source.html">helpers/agent_handler.c</a>.<div class="fragment"><pre>00139 {
00140 NodeHandler *nh;
00141 <font class="keywordtype">int</font> ret;
00142
00143 <font class="keywordflow">if</font> (next_handler == NULL || reginfo == NULL || reqinfo == NULL ||
00144 requests == NULL) {
00145 snmp_log(LOG_ERR, <font class="stringliteral">"call_next_handler() called illegally"</font>);
00146 <font class="keywordflow">return</font> SNMP_ERR_GENERR;
00147 }
00148
00149 nh = next_handler-><a class="code" href="structmib__handler__s.html#m2">access_method</a>;
00150 <font class="keywordflow">if</font> (!nh) {
00151 snmp_log(LOG_ERR, <font class="stringliteral">"no access method specified in handler %s."</font>,
00152 next_handler-><a class="code" href="structmib__handler__s.html#m0">handler_name</a>);
00153 <font class="keywordflow">return</font> SNMP_ERR_GENERR;
00154 }
00155
00156 DEBUGMSGTL((<font class="stringliteral">"handler:calling"</font>, <font class="stringliteral">"calling handler %s\n"</font>,
00157 next_handler-><a class="code" href="structmib__handler__s.html#m0">handler_name</a>));
00158
00159 ret = (*nh)(next_handler, reginfo, reqinfo, requests);
00160
00161 DEBUGMSGTL((<font class="stringliteral">"handler:returned"</font>, <font class="stringliteral">"handler %s returned %d\n"</font>,
00162 next_handler-><a class="code" href="structmib__handler__s.html#m0">handler_name</a>, ret));
00163
00164 <font class="keywordflow">return</font> ret;
00165 }
</pre></div> </td>
</tr>
</table>
<a name="a16" doxytag="agent_handler.h::call_handlers"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int call_handlers </td>
<td class="md">( </td>
<td class="md" nowrap><a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> * </td>
<td class="mdname"> <em>reginfo</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="snmp__agent_8h.html#a21">agent_request_info</a> * </td>
<td class="mdname"> <em>reqinfo</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="snmp__agent_8h.html#a18">request_info</a> * </td>
<td class="mdname"> <em>requests</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="helpers_2agent__handler_8c-source.html#l00070">70</a> of file <a class="el" href="helpers_2agent__handler_8c-source.html">helpers/agent_handler.c</a>.<div class="fragment"><pre>00072 {
00073 NodeHandler *nh;
00074 <font class="keywordtype">int</font> status;
00075
00076 <font class="keywordflow">if</font> (reginfo == NULL || reqinfo == NULL || requests == NULL) {
00077 snmp_log(LOG_ERR, <font class="stringliteral">"call_handlers() called illegally"</font>);
00078 <font class="keywordflow">return</font> SNMP_ERR_GENERR;
00079 }
00080
00081 <font class="keywordflow">if</font> (reginfo-><a class="code" href="structhandler__registration__s.html#m4">handler</a> == NULL) {
00082 snmp_log(LOG_ERR, <font class="stringliteral">"no handler specified."</font>);
00083 <font class="keywordflow">return</font> SNMP_ERR_GENERR;
00084 }
00085
00086 <font class="keywordflow">switch</font>(reqinfo-><a class="code" href="structagent__request__info__s.html#m0">mode</a>) {
00087 <font class="keywordflow">case</font> <a class="code" href="snmp__agent_8h.html#a4">MODE_GET</a>:
00088 <font class="keywordflow">case</font> <a class="code" href="snmp__agent_8h.html#a5">MODE_GETNEXT</a>:
00089 <font class="keywordflow">if</font> (!(reginfo-><a class="code" href="structhandler__registration__s.html#m5">modes</a> & HANDLER_CAN_GETANDGETNEXT))
00090 <font class="keywordflow">return</font> SNMP_ERR_NOERROR; <font class="comment">/* legal */</font>
00091 <font class="keywordflow">break</font>;
00092
00093 <font class="keywordflow">case</font> <a class="code" href="snmp__agent_8h.html#a9">MODE_SET_RESERVE1</a>:
00094 <font class="keywordflow">case</font> <a class="code" href="snmp__agent_8h.html#a10">MODE_SET_RESERVE2</a>:
00095 <font class="keywordflow">case</font> <a class="code" href="snmp__agent_8h.html#a11">MODE_SET_ACTION</a>:
00096 <font class="keywordflow">case</font> <a class="code" href="snmp__agent_8h.html#a12">MODE_SET_COMMIT</a>:
00097 <font class="keywordflow">case</font> <a class="code" href="snmp__agent_8h.html#a13">MODE_SET_FREE</a>:
00098 <font class="keywordflow">case</font> <a class="code" href="snmp__agent_8h.html#a14">MODE_SET_UNDO</a>:
00099 <font class="keywordflow">if</font> (!(reginfo-><a class="code" href="structhandler__registration__s.html#m5">modes</a> & HANDLER_CAN_SET)) {
00100 <font class="keywordflow">for</font>(; requests; requests = requests-><a class="code" href="structrequest__info__s.html#m8">next</a>) {
00101 <a class="code" href="snmp__agent_8h.html#a39">set_request_error</a>(reqinfo, requests, SNMP_ERR_NOTWRITABLE);
00102 }
00103 <font class="keywordflow">return</font> SNMP_ERR_NOERROR;
00104 }
00105 <font class="keywordflow">break</font>;
00106
00107 <font class="keywordflow">case</font> <a class="code" href="snmp__agent_8h.html#a6">MODE_GETBULK</a>:
00108 <font class="keywordflow">if</font> (!(reginfo-><a class="code" href="structhandler__registration__s.html#m5">modes</a> & HANDLER_CAN_GETBULK))
00109 <font class="keywordflow">return</font> SNMP_ERR_NOERROR; <font class="comment">/* XXXWWW: should never get</font>
00110 here after we force a
00111 getbulk->getnext helper on
00112 them during registration
00113 process. */
00114 <font class="keywordflow">break</font>;
00115
00116 <font class="keywordflow">default</font>:
00117 snmp_log(LOG_ERR, <font class="stringliteral">"unknown mode in call_handlers! bug!\n"</font>);
00118 <font class="keywordflow">return</font> SNMP_ERR_GENERR;
00119 }
00120 DEBUGMSGTL((<font class="stringliteral">"handler:calling"</font>, <font class="stringliteral">"calling main handler %s\n"</font>,
00121 reginfo-><a class="code" href="structhandler__registration__s.html#m4">handler</a>->handler_name));
00122
00123 nh = reginfo-><a class="code" href="structhandler__registration__s.html#m4">handler</a>->access_method;
00124 <font class="keywordflow">if</font> (!nh) {
00125 snmp_log(LOG_ERR, <font class="stringliteral">"no handler access method specified."</font>);
00126 <font class="keywordflow">return</font> SNMP_ERR_GENERR;
00127 }
00128
00129 <font class="comment">/* XXX: define acceptable return statuses */</font>
00130 status = (*nh)(reginfo-><a class="code" href="structhandler__registration__s.html#m4">handler</a>, reginfo, reqinfo, requests);
00131
00132 <font class="keywordflow">return</font> status;
00133 }
</pre></div> </td>
</tr>
</table>
<a name="a18" doxytag="agent_handler.h::call_next_handler"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int call_next_handler </td>
<td class="md">( </td>
<td class="md" nowrap><a class="el" href="helpers_2agent__handler_8h.html#a8">mib_handler</a> * </td>
<td class="mdname"> <em>current</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> * </td>
<td class="mdname"> <em>reginfo</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="snmp__agent_8h.html#a21">agent_request_info</a> * </td>
<td class="mdname"> <em>reqinfo</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="snmp__agent_8h.html#a18">request_info</a> * </td>
<td class="mdname"> <em>requests</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
calls the next handler in the chain after the current one with with appropriate NULL checking, etc.
<p>
<p>
Definition at line <a class="el" href="helpers_2agent__handler_8c-source.html#l00169">169</a> of file <a class="el" href="helpers_2agent__handler_8c-source.html">helpers/agent_handler.c</a>.<div class="fragment"><pre>00172 {
00173
00174 <font class="keywordflow">if</font> (current == NULL || reginfo == NULL || reqinfo == NULL ||
00175 requests == NULL) {
00176 snmp_log(LOG_ERR, <font class="stringliteral">"call_next_handler() called illegally"</font>);
00177 <font class="keywordflow">return</font> SNMP_ERR_GENERR;
00178 }
00179
00180 <font class="keywordflow">return</font> <a class="code" href="helpers_2agent__handler_8h.html#a17">call_handler</a>(current-><a class="code" href="structmib__handler__s.html#m3">next</a>, reginfo, reqinfo, requests);
00181 }
</pre></div> </td>
</tr>
</table>
<a name="a21" doxytag="agent_handler.h::create_delegated_cache"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="helpers_2agent__handler_8h.html#a10">delegated_cache</a>* create_delegated_cache </td>
<td class="md">( </td>
<td class="md" nowrap><a class="el" href="helpers_2agent__handler_8h.html#a8">mib_handler</a> * </td>
<td class="mdname"> <em>handler</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> * </td>
<td class="mdname"> <em>reginfo</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="snmp__agent_8h.html#a21">agent_request_info</a> * </td>
<td class="mdname"> <em>reqinfo</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="snmp__agent_8h.html#a18">request_info</a> * </td>
<td class="mdname"> <em>requests</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>void * </td>
<td class="mdname"> <em>localinfo</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
creates a cache of information which can be saved for future reference.
<p>
Use <a class="el" href="agent__handler_8c.html#a8">handler_check_cache</a>() later to make sure it's still valid before referencing it in the future.
<p>
Definition at line <a class="el" href="helpers_2agent__handler_8c-source.html#l00221">221</a> of file <a class="el" href="helpers_2agent__handler_8c-source.html">helpers/agent_handler.c</a>.<div class="fragment"><pre>00225 {
00226 <a class="code" href="structdelegated__cache__s.html">delegated_cache</a> *ret;
00227
00228 ret = SNMP_MALLOC_TYPEDEF(<a class="code" href="structdelegated__cache__s.html">delegated_cache</a>);
00229 <font class="keywordflow">if</font> (ret) {
00230 ret-><a class="code" href="structdelegated__cache__s.html#m0">transaction_id</a> = reqinfo-><a class="code" href="structagent__request__info__s.html#m2">asp</a>->pdu->transid;
00231 ret-><a class="code" href="structdelegated__cache__s.html#m1">handler</a> = handler;
00232 ret-><a class="code" href="structdelegated__cache__s.html#m2">reginfo</a> = reginfo;
00233 ret-><a class="code" href="structdelegated__cache__s.html#m3">reqinfo</a> = reqinfo;
00234 ret-><a class="code" href="structdelegated__cache__s.html#m4">requests</a> = requests;
00235 ret-><a class="code" href="structdelegated__cache__s.html#m5">localinfo</a> = localinfo;
00236 }
00237 <font class="keywordflow">return</font> ret;
00238 }
</pre></div> </td>
</tr>
</table>
<a name="a19" doxytag="agent_handler.h::create_handler"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="helpers_2agent__handler_8h.html#a8">mib_handler</a>* create_handler </td>
<td class="md">( </td>
<td class="md" nowrap>const char * </td>
<td class="mdname"> <em>name</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>NodeHandler * </td>
<td class="mdname"> <em>handler_access_method</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
creates a mib_handler structure given a name and a access method.
<p>
<p>
Definition at line <a class="el" href="helpers_2agent__handler_8c-source.html#l00185">185</a> of file <a class="el" href="helpers_2agent__handler_8c-source.html">helpers/agent_handler.c</a>.<div class="fragment"><pre>00185 {
00186 <a class="code" href="structmib__handler__s.html">mib_handler</a> *ret = SNMP_MALLOC_TYPEDEF(<a class="code" href="structmib__handler__s.html">mib_handler</a>);
00187 ret-><a class="code" href="structmib__handler__s.html#m0">handler_name</a> = strdup(name);
00188 ret-><a class="code" href="structmib__handler__s.html#m2">access_method</a> = handler_access_method;
00189 <font class="keywordflow">return</font> ret;
00190 }
</pre></div> </td>
</tr>
</table>
<a name="a20" doxytag="agent_handler.h::create_handler_registration"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a>* create_handler_registration </td>
<td class="md">( </td>
<td class="md" nowrap>const char * </td>
<td class="mdname"> <em>name</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>NodeHandler * </td>
<td class="mdname"> <em>handler_access_method</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>oid * </td>
<td class="mdname"> <em>reg_oid</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>size_t </td>
<td class="mdname"> <em>reg_oid_len</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int </td>
<td class="mdname"> <em>modes</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
creates a handler registration structure given a name, a access_method function, a registration location oid and the modes the handler supports.
<p>
If modes == 0, then modes will automatically be set to the default value of only HANDLER_CAN_DEFAULT, which is by default.
<p>
Definition at line <a class="el" href="helpers_2agent__handler_8c-source.html#l00197">197</a> of file <a class="el" href="helpers_2agent__handler_8c-source.html">helpers/agent_handler.c</a>.<div class="fragment"><pre>00200 {
00201 <a class="code" href="structhandler__registration__s.html">handler_registration</a> *the_reg;
00202 the_reg = SNMP_MALLOC_TYPEDEF(<a class="code" href="structhandler__registration__s.html">handler_registration</a>);
00203 <font class="keywordflow">if</font> (!the_reg)
00204 <font class="keywordflow">return</font> NULL;
00205
00206 <font class="keywordflow">if</font> (modes)
00207 the_reg-><a class="code" href="structhandler__registration__s.html#m5">modes</a> = modes;
00208 <font class="keywordflow">else</font>
00209 the_reg-><a class="code" href="structhandler__registration__s.html#m5">modes</a> = HANDLER_CAN_DEFAULT;
00210
00211 the_reg-><a class="code" href="structhandler__registration__s.html#m4">handler</a> = <a class="code" href="helpers_2agent__handler_8h.html#a19">create_handler</a>(name, handler_access_method);
00212 memdup(&the_reg-><a class="code" href="structhandler__registration__s.html#m2">rootoid</a>, reg_oid, reg_oid_len * <font class="keyword">sizeof</font>(oid));
00213 the_reg-><a class="code" href="structhandler__registration__s.html#m3">rootoid_len</a> = reg_oid_len;
00214 <font class="keywordflow">return</font> the_reg;
00215 }
</pre></div> </td>
</tr>
</table>
<a name="a14" doxytag="agent_handler.h::find_handler_by_name"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="helpers_2agent__handler_8h.html#a8">mib_handler</a>* find_handler_by_name </td>
<td class="md">( </td>
<td class="md" nowrap><a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> * </td>
<td class="mdname"> <em>reginfo</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>char * </td>
<td class="mdname"> <em>name</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns a handler from a chain based on the name.
<p>
<p>
Definition at line <a class="el" href="helpers_2agent__handler_8c-source.html#l00300">300</a> of file <a class="el" href="helpers_2agent__handler_8c-source.html">helpers/agent_handler.c</a>.<div class="fragment"><pre>00301 {
00302 <a class="code" href="structmib__handler__s.html">mib_handler</a> *it;
00303 <font class="keywordflow">for</font>(it = reginfo-><a class="code" href="structhandler__registration__s.html#m4">handler</a>; it; it = it-><a class="code" href="structmib__handler__s.html#m3">next</a>) {
00304 <font class="keywordflow">if</font> (strcmp(it-><a class="code" href="structmib__handler__s.html#m0">handler_name</a>, name) == 0)<font class="keyword"> </font>{
00305 <font class="keywordflow">return</font> it;
00306 }
00307 }
00308 <font class="keywordflow">return</font> NULL;
00309 }
</pre></div> </td>
</tr>
</table>
<a name="a15" doxytag="agent_handler.h::find_handler_data_by_name"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void* find_handler_data_by_name </td>
<td class="md">( </td>
<td class="md" nowrap><a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> * </td>
<td class="mdname"> <em>reginfo</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>char * </td>
<td class="mdname"> <em>name</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns a handler's void * pointer from a chain based on the name.
<p>
This probably shouldn't be used by the general public as the void * data may change as a handler evolves. Handlers should really advertise some function for you to use instead.
<p>
Definition at line <a class="el" href="helpers_2agent__handler_8c-source.html#l00316">316</a> of file <a class="el" href="helpers_2agent__handler_8c-source.html">helpers/agent_handler.c</a>.<div class="fragment"><pre>00318 {
00319 <a class="code" href="structmib__handler__s.html">mib_handler</a> *it = <a class="code" href="helpers_2agent__handler_8h.html#a14">find_handler_by_name</a>(reginfo, name);
00320 <font class="keywordflow">if</font> (it)
00321 <font class="keywordflow">return</font> it-><a class="code" href="structmib__handler__s.html#m1">myvoid</a>;
00322 <font class="keywordflow">return</font> NULL;
00323 }
</pre></div> </td>
</tr>
</table>
<a name="a25" doxytag="agent_handler.h::free_request_data_set"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void free_request_data_set </td>
<td class="md">( </td>
<td class="md" nowrap><a class="el" href="snmp__agent_8h.html#a18">request_info</a> * </td>
<td class="mdname1"> <em>request</em> </td>
<td class="md">) </td>
<td class="md"><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="helpers_2agent__handler_8c-source.html#l00285">285</a> of file <a class="el" href="helpers_2agent__handler_8c-source.html">helpers/agent_handler.c</a>.<div class="fragment"><pre>00286 {
00287 <font class="keywordflow">if</font> (request)
00288 free_list_data(request-><a class="code" href="structrequest__info__s.html#m1">parent_data</a>);
00289 }
</pre></div> </td>
</tr>
</table>
<a name="a26" doxytag="agent_handler.h::free_request_data_sets"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void free_request_data_sets </td>
<td class="md">( </td>
<td class="md" nowrap><a class="el" href="snmp__agent_8h.html#a18">request_info</a> * </td>
<td class="mdname1"> <em>request</em> </td>
<td class="md">) </td>
<td class="md"><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="helpers_2agent__handler_8c-source.html#l00292">292</a> of file <a class="el" href="helpers_2agent__handler_8c-source.html">helpers/agent_handler.c</a>.<div class="fragment"><pre>00293 {
00294 <font class="keywordflow">if</font> (request)
00295 free_all_list_data(request-><a class="code" href="structrequest__info__s.html#m1">parent_data</a>);
00296 }
</pre></div> </td>
</tr>
</table>
<a name="a22" doxytag="agent_handler.h::handler_check_cache"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="helpers_2agent__handler_8h.html#a10">delegated_cache</a>* handler_check_cache </td>
<td class="md">( </td>
<td class="md" nowrap><a class="el" href="helpers_2agent__handler_8h.html#a10">delegated_cache</a> * </td>
<td class="mdname1"> <em>dcache</em> </td>
<td class="md">) </td>
<td class="md"><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
check's a given cache and returns it if it is still valid (ie, the agent still considers it to be an outstanding request.
<p>
Returns NULL if it's no longer valid.
<p>
Definition at line <a class="el" href="helpers_2agent__handler_8c-source.html#l00244">244</a> of file <a class="el" href="helpers_2agent__handler_8c-source.html">helpers/agent_handler.c</a>.<div class="fragment"><pre>00245 {
00246 <font class="keywordflow">if</font> (!dcache)
00247 <font class="keywordflow">return</font> dcache;
00248
00249 <font class="keywordflow">if</font> (<a class="code" href="snmp__agent_8h.html#a44">check_transaction_id</a>(dcache-><a class="code" href="structdelegated__cache__s.html#m0">transaction_id</a>) == SNMPERR_SUCCESS)
00250 <font class="keywordflow">return</font> dcache;
00251
00252 <font class="keywordflow">return</font> NULL;
00253 }
</pre></div> </td>
</tr>
</table>
<a name="a28" doxytag="agent_handler.h::handler_get_parent_data"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void* handler_get_parent_data </td>
<td class="md">( </td>
<td class="md" nowrap><a class="el" href="snmp__agent_8h.html#a18">request_info</a> * </td>
<td class="mdname"> , </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>const char * </td>
<td class="mdname"> </td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<a name="a27" doxytag="agent_handler.h::handler_mark_requests_as_delegated"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void handler_mark_requests_as_delegated </td>
<td class="md">( </td>
<td class="md" nowrap><a class="el" href="snmp__agent_8h.html#a18">request_info</a> * </td>
<td class="mdname"> <em>requests</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>int </td>
<td class="mdname"> <em>isdelegated</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
marks a list of requests as delegated (or not if isdelegaded = 0).
<p>
<p>
Definition at line <a class="el" href="helpers_2agent__handler_8c-source.html#l00257">257</a> of file <a class="el" href="helpers_2agent__handler_8c-source.html">helpers/agent_handler.c</a>.<div class="fragment"><pre>00258 {
00259 <font class="keywordflow">while</font>(requests) {
00260 requests-><a class="code" href="structrequest__info__s.html#m4">delegated</a> = isdelegated;
00261 requests = requests-><a class="code" href="structrequest__info__s.html#m8">next</a>;
00262 }
00263 }
</pre></div> </td>
</tr>
</table>
<a name="a13" doxytag="agent_handler.h::inject_handler"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int inject_handler </td>
<td class="md">( </td>
<td class="md" nowrap><a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> * </td>
<td class="mdname"> <em>reginfo</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="helpers_2agent__handler_8h.html#a8">mib_handler</a> * </td>
<td class="mdname"> <em>handler</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
inject a new handler into the calling chain of the handlers definedy by the handler_registration pointer.
<p>
The new handler is injected at the top of the list and hence will be the new handler to be called first.
<p>
Definition at line <a class="el" href="helpers_2agent__handler_8c-source.html#l00060">60</a> of file <a class="el" href="helpers_2agent__handler_8c-source.html">helpers/agent_handler.c</a>.<div class="fragment"><pre>00060 {
00061 DEBUGMSGTL((<font class="stringliteral">"handler:inject"</font>, <font class="stringliteral">"injecting %s before %s\n"</font>, \
00062 handler-><a class="code" href="structmib__handler__s.html#m0">handler_name</a>, reginfo-><a class="code" href="structhandler__registration__s.html#m4">handler</a>-><a class="code" href="structmib__handler__s.html#m0">handler_name</a>));
00063 handler-><a class="code" href="structmib__handler__s.html#m3">next</a> = reginfo-><a class="code" href="structhandler__registration__s.html#m4">handler</a>;
00064 <font class="keywordflow">if</font> (reginfo-><a class="code" href="structhandler__registration__s.html#m4">handler</a>)
00065 reginfo-><a class="code" href="structhandler__registration__s.html#m4">handler</a>-><a class="code" href="structmib__handler__s.html#m4">prev</a> = handler;
00066 reginfo-><a class="code" href="structhandler__registration__s.html#m4">handler</a> = handler;
00067 <font class="keywordflow">return</font> SNMPERR_SUCCESS;
00068 }
</pre></div> </td>
</tr>
</table>
<a name="a11" doxytag="agent_handler.h::int"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> typedef int </td>
<td class="md">( </td>
<td class="md" nowrap>NodeHandler </td>
<td class="mdname1"> </td>
<td class="md">) </td>
<td class="md"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<a name="a12" doxytag="agent_handler.h::register_handler"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int register_handler </td>
<td class="md">( </td>
<td class="md" nowrap><a class="el" href="helpers_2agent__handler_8h.html#a9">handler_registration</a> * </td>
<td class="mdname1"> <em>reginfo</em> </td>
<td class="md">) </td>
<td class="md"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
register a handler, as defined by the handler_registration pointer.
<p>
<p>
Definition at line <a class="el" href="helpers_2agent__handler_8c-source.html#l00020">20</a> of file <a class="el" href="helpers_2agent__handler_8c-source.html">helpers/agent_handler.c</a>.<div class="fragment"><pre>00020 {
00021 <a class="code" href="structmib__handler__s.html">mib_handler</a> *handler;
00022 DEBUGIF(<font class="stringliteral">"handler::register"</font>)<font class="keyword"> </font>{
00023 DEBUGMSGTL((<font class="stringliteral">"handler::register"</font>, <font class="stringliteral">"Registering"</font>));
00024 <font class="keywordflow">for</font>(handler = reginfo-><a class="code" href="structhandler__registration__s.html#m4">handler</a>; handler;
00025 handler = handler-><a class="code" href="structmib__handler__s.html#m3">next</a>) {
00026 DEBUGMSG((<font class="stringliteral">"handler::register"</font>,<font class="stringliteral">" %s"</font>, handler-><a class="code" href="structmib__handler__s.html#m0">handler_name</a>));
00027 }
00028
00029 DEBUGMSG((<font class="stringliteral">"handler::register"</font>, <font class="stringliteral">" at "</font>));
00030 <font class="keywordflow">if</font> (reginfo-><a class="code" href="structhandler__registration__s.html#m2">rootoid</a>) {
00031 DEBUGMSGOID((<font class="stringliteral">"handler::register"</font>, reginfo-><a class="code" href="structhandler__registration__s.html#m2">rootoid</a>,
00032 reginfo-><a class="code" href="structhandler__registration__s.html#m3">rootoid_len</a>));
00033 } <font class="keywordflow">else</font> {
00034 DEBUGMSG((<font class="stringliteral">"handler::register"</font>, <font class="stringliteral">"[null]"</font>));
00035 }
00036 DEBUGMSG((<font class="stringliteral">"handler::register"</font>, <font class="stringliteral">"\n"</font>));
00037 }
00038
00039 <font class="comment">/* don't let them register for absolutely nothing. Probably a mistake */</font>
00040 <font class="keywordflow">if</font> (0 == reginfo-><a class="code" href="structhandler__registration__s.html#m5">modes</a>) {
00041 reginfo-><a class="code" href="structhandler__registration__s.html#m5">modes</a> = HANDLER_CAN_DEFAULT;
00042 }
00043
00044 <font class="keywordflow">return</font> <a class="code" href="agent__registry_8c.html#a24">register_mib_context2</a>(reginfo-><a class="code" href="structhandler__registration__s.html#m4">handler</a>-><a class="code" href="structmib__handler__s.html#m0">handler_name</a>,
00045 NULL, 0, 0,
00046 reginfo-><a class="code" href="structhandler__registration__s.html#m2">rootoid</a>, reginfo-><a class="code" href="structhandler__registration__s.html#m3">rootoid_len</a>,
00047 reginfo-><a class="code" href="structhandler__registration__s.html#m6">priority</a>,
00048 reginfo-><a class="code" href="structhandler__registration__s.html#m7">range_subid</a>, reginfo-><a class="code" href="structhandler__registration__s.html#m8">range_ubound</a>,
00049 NULL,
00050 reginfo-><a class="code" href="structhandler__registration__s.html#m1">contextName</a>,
00051 reginfo-><a class="code" href="structhandler__registration__s.html#m9">timeout</a>,
00052 0, reginfo);
00053 }
</pre></div> </td>
</tr>
</table>
<a name="a23" doxytag="agent_handler.h::request_add_list_data"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void request_add_list_data </td>
<td class="md">( </td>
<td class="md" nowrap><a class="el" href="snmp__agent_8h.html#a18">request_info</a> * </td>
<td class="mdname"> <em>request</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>data_list * </td>
<td class="mdname"> <em>node</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="helpers_2agent__handler_8c-source.html#l00266">266</a> of file <a class="el" href="helpers_2agent__handler_8c-source.html">helpers/agent_handler.c</a>.<div class="fragment"><pre>00267 {
00268 <font class="keywordflow">if</font> (request) {
00269 <font class="keywordflow">if</font> (request-><a class="code" href="structrequest__info__s.html#m1">parent_data</a>)
00270 add_list_data(&request-><a class="code" href="structrequest__info__s.html#m1">parent_data</a>, node);
00271 <font class="keywordflow">else</font>
00272 request-><a class="code" href="structrequest__info__s.html#m1">parent_data</a> = node;
00273 }
00274 }
</pre></div> </td>
</tr>
</table>
<a name="a24" doxytag="agent_handler.h::request_get_list_data"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void* request_get_list_data </td>
<td class="md">( </td>
<td class="md" nowrap><a class="el" href="snmp__agent_8h.html#a18">request_info</a> * </td>
<td class="mdname"> <em>request</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>const char * </td>
<td class="mdname"> <em>name</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [inline]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
<p>
Definition at line <a class="el" href="helpers_2agent__handler_8c-source.html#l00277">277</a> of file <a class="el" href="helpers_2agent__handler_8c-source.html">helpers/agent_handler.c</a>.<div class="fragment"><pre>00278 {
00279 <font class="keywordflow">if</font> (request)
00280 <font class="keywordflow">return</font> get_list_data(request-><a class="code" href="structrequest__info__s.html#m1">parent_data</a>,name);
00281 <font class="keywordflow">return</font> NULL;
00282 }
</pre></div> </td>
</tr>
</table>
<hr><address><small>Generated on Sat Nov 10 14:09:53 2001 for net-snmp by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.gif" alt="doxygen" align="middle" border=0
width=110 height=53></a>1.2.11 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
© 1997-2001</small></address>
</body>
</html>
<!--#include virtual="/sfbutton.html" -->
<!--#include virtual="/sfbutton.html" -->
<!-- CONTENT END -->
<!--#include virtual="/page-bottom.html" -->
See more files for this project here