Code Search for Developers
 
 
  

agent__registry_8h-source.html from net-snmp at Krugle


Show agent__registry_8h-source.html syntax highlighted

<!--#set var="section" value="development" -->
<!--#include virtual="/page-top.html" -->
<!-- CONTENT START -->
  <!-- Generated by Doxygen 1.3.9.1 -->

  <div class="qindex">
    <a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class=
    "qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class=
    "qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a> | <a class=
    "qindex" href="examples.html">Examples</a>
  </div>

  <div class="nav">
    <a class="el" href="dir_000000.html">include</a>&nbsp;/&nbsp;<a class="el" href=
    "dir_000001.html">net-snmp</a>&nbsp;/&nbsp;<a class="el" href="dir_000002.html">agent</a>
  </div>

  <h1>agent_registry.h</h1>

  <div class="fragment">
    <pre class="fragment">
00001 <span class="preprocessor">#ifndef AGENT_REGISTRY_H</span>
00002 <span class="preprocessor">#define AGENT_REGISTRY_H</span>
00003 
00004 <span class="comment">/***********************************************************************/</span>
00005 <span class="comment">/*</span>
00006 <span class="comment"> * new version2 agent handler API structures </span>
00007 <span class="comment"> */</span>
00008 <span class="comment">/***********************************************************************/</span>
00009 
00010 <span class="preprocessor">#include &lt;net-snmp/agent/snmp_agent.h&gt;</span>
00011 <span class="preprocessor">#include &lt;net-snmp/library/fd_event_manager.h&gt;</span>
00012 
00013 <span class="preprocessor">#ifdef __cplusplus</span>
00014 <span class="keyword">extern</span>          <span class="stringliteral">"C"</span> {
00015 <span class="preprocessor">#endif</span>
00016 
00017 <span class="comment">/***********************************************************************/</span>
00018     <span class="comment">/*</span>
00019 <span class="comment">     * requests api definitions </span>
00020 <span class="comment">     */</span>
00021 <span class="comment">/***********************************************************************/</span>
00022 
00023     <span class="comment">/*</span>
00024 <span class="comment">     * the structure of parameters passed to registered ACM modules </span>
00025 <span class="comment">     */</span>
00026 <span class="keyword">struct </span>view_parameters {
00027     <a class="code" href="structsnmp__pdu.html">netsnmp_pdu</a>    *pdu;
00028     oid            *name;
00029     size_t          namelen;
00030     <span class="keywordtype">int</span>             test;
00031     <span class="keywordtype">int</span>             errorcode;          <span class=
"comment">/*  Do not change unless you're</span>
00032 <span class="comment">                                            specifying an error, as it starts</span>
00033 <span class="comment">                                            in a success state.  */</span>
00034     <span class="keywordtype">int</span>             check_subtree;
00035 };
00036 
00037 <span class="keyword">struct </span>register_parameters {
00038     oid            *name;
00039     size_t          namelen;
00040     <span class="keywordtype">int</span>             priority;
00041     <span class="keywordtype">int</span>             range_subid;
00042     oid             range_ubound;
00043     <span class="keywordtype">int</span>             timeout;
00044     u_char          flags;
00045     <span class="keyword">const</span> <span class="keywordtype">char</span>     *contextName;
00046 };
00047 
00048 <span class="keyword">typedef</span> <span class="keyword">struct </span>subtree_context_cache_s {
00049     <span class="keywordtype">char</span>                                *context_name;
00050     <span class="keyword">struct </span>netsnmp_subtree_s            *first_subtree;
00051     <span class="keyword">struct </span>subtree_context_cache_s      *next;
00052 } subtree_context_cache;
00053 
00054 
00055 
00056 <span class="keywordtype">void</span>             setup_tree               (<span class="keywordtype">void</span>);
00057 <span class="keywordtype">void</span>             shutdown_tree    (<span class="keywordtype">void</span>);
00058 
00059 
00060 netsnmp_subtree *netsnmp_subtree_find     (oid *, size_t, netsnmp_subtree *,
00061                                            <span class="keyword">const</span> <span class=
"keywordtype">char</span> *context_name);
00062 
00063 netsnmp_subtree *netsnmp_subtree_find_next(oid *, size_t, netsnmp_subtree *,
00064                                            <span class="keyword">const</span> <span class=
"keywordtype">char</span> *context_name);
00065 
00066 netsnmp_subtree *netsnmp_subtree_find_prev(oid *, size_t,netsnmp_subtree *,
00067                                            <span class="keyword">const</span> <span class=
"keywordtype">char</span> *context_name);
00068 
00069 netsnmp_subtree *netsnmp_subtree_find_first(<span class="keyword">const</span> <span class=
"keywordtype">char</span> *context_name);
00070 
00071 <a class="code" href="structsnmp__session.html">netsnmp_session</a> *get_session_for_oid       (oid *, size_t, 
00072                                             <span class="keyword">const</span> <span class=
"keywordtype">char</span> *context_name);
00073 
00074 subtree_context_cache *get_top_context_cache(<span class="keywordtype">void</span>);
00075 
00076 <span class="keywordtype">void</span> <a class="code" href=
"group__agent__registry.html#ga9">netsnmp_set_lookup_cache_size</a>(<span class="keywordtype">int</span> newsize);
00077 <span class="keywordtype">int</span> <a class="code" href=
"group__agent__registry.html#ga10">netsnmp_get_lookup_cache_size</a>(<span class="keywordtype">void</span>);
00078 
00079 <span class="preprocessor">#define MIB_REGISTERED_OK                0</span>
00080 <span class="preprocessor">#define MIB_DUPLICATE_REGISTRATION      -1</span>
00081 <span class="preprocessor">#define MIB_REGISTRATION_FAILED         -2</span>
00082 <span class="preprocessor">#define MIB_UNREGISTERED_OK              0</span>
00083 <span class="preprocessor">#define MIB_NO_SUCH_REGISTRATION        -1</span>
00084 <span class="preprocessor">#define MIB_UNREGISTRATION_FAILED       -2</span>
00085 <span class="preprocessor">#define DEFAULT_MIB_PRIORITY            127</span>
00086 
00087 <span class="keywordtype">int</span>             register_mib               (<span class=
"keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">struct</span> variable *,
00088                                             size_t, size_t, oid *, size_t);
00089 
00090 <span class="keywordtype">int</span>             register_mib_priority      (<span class=
"keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">struct</span> variable *,
00091                                             size_t, size_t, oid *, size_t,
00092                                             <span class="keywordtype">int</span>);
00093 
00094 <span class="keywordtype">int</span>             register_mib_range         (<span class=
"keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">struct</span> variable *,
00095                                             size_t, size_t, oid *, size_t, 
00096                                             <span class="keywordtype">int</span>, <span class=
"keywordtype">int</span>, oid, <a class="code" href="structsnmp__session.html">netsnmp_session</a> *);
00097 
00098 <span class="keywordtype">int</span>             register_mib_context       (<span class=
"keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">struct</span> variable *,
00099                                             size_t, size_t, oid *, size_t,
00100                                             <span class="keywordtype">int</span>, <span class=
"keywordtype">int</span>, oid, <a class="code" href="structsnmp__session.html">netsnmp_session</a> *,
00101                                             <span class="keyword">const</span> <span class=
"keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);
00102 
00103 <span class="keywordtype">int</span>     <a class="code" href=
"group__old__api.html#ga2">netsnmp_register_mib_table_row</a>     (<span class="keyword">const</span> <span class=
"keywordtype">char</span> *, <span class="keyword">struct</span> variable *,
00104                                             size_t, size_t, oid *, size_t, 
00105                                             <span class="keywordtype">int</span>, <span class=
"keywordtype">int</span>, <a class="code" href="structsnmp__session.html">netsnmp_session</a> *,
00106                                             <span class="keyword">const</span> <span class=
"keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>);
00107 
00108 <span class="keywordtype">int</span>             unregister_mib             (oid *, size_t);
00109 
00110 <span class="keywordtype">int</span>             unregister_mib_priority    (oid *, size_t, <span class=
"keywordtype">int</span>);
00111 <span class="keywordtype">int</span>             unregister_mib_range       (oid *, size_t, <span class=
"keywordtype">int</span>, <span class="keywordtype">int</span>, oid);
00112 <span class="keywordtype">int</span>             <a class="code" href=
"group__agent__registry.html#ga32">unregister_mib_context</a>     (oid *, size_t, <span class=
"keywordtype">int</span>, <span class="keywordtype">int</span>, oid,
00113                                             <span class="keyword">const</span> <span class="keywordtype">char</span> *);
00114 <span class="keywordtype">void</span>            clear_context              (<span class="keywordtype">void</span>);
00115 <span class="keywordtype">void</span>            unregister_mibs_by_session (<a class="code" href=
"structsnmp__session.html">netsnmp_session</a> *);
00116 <span class="keywordtype">int</span>     netsnmp_unregister_mib_table_row   (oid *mibloc, size_t mibloclen,
00117                                             <span class="keywordtype">int</span> priority, <span class=
"keywordtype">int</span> var_subid,
00118                                             oid range_ubound,
00119                                             <span class="keyword">const</span> <span class=
"keywordtype">char</span> *context);
00120 
00121 <span class="keywordtype">int</span>             compare_tree               (<span class=
"keyword">const</span> oid *, size_t, 
00122                                             <span class="keyword">const</span> oid *, size_t);
00123 <span class="keywordtype">int</span>             in_a_view                  (oid *, size_t *, 
00124                                             <a class="code" href="structsnmp__pdu.html">netsnmp_pdu</a> *, <span class=
"keywordtype">int</span>);
00125 <span class="keywordtype">int</span>             check_access               (<a class="code" href=
"structsnmp__pdu.html">netsnmp_pdu</a> *pdu);
00126 <span class="keywordtype">int</span>             <a class="code" href=
"group__agent__registry.html#ga40">netsnmp_acm_check_subtree</a>  (<a class="code" href=
"structsnmp__pdu.html">netsnmp_pdu</a> *, oid *, size_t);
00127 <span class="keywordtype">void</span>            register_mib_reattach      (<span class="keywordtype">void</span>);
00128 <span class="keywordtype">void</span>            register_mib_detach        (<span class="keywordtype">void</span>);
00129 
00130 <span class="comment">/*</span>
00131 <span class="comment"> * REGISTER_MIB(): This macro simply loads register_mib with less pain:</span>
00132 <span class="comment"> * </span>
00133 <span class="comment"> * descr:   A short description of the mib group being loaded.</span>
00134 <span class="comment"> * var:     The variable structure to load.</span>
00135 <span class="comment"> * vartype: The variable structure used to define it (variable[2, 4, ...])</span>
00136 <span class="comment"> * theoid:  An *initialized* *exact length* oid pointer.</span>
00137 <span class="comment"> *          (sizeof(theoid) *must* return the number of elements!) </span>
00138 <span class="comment"> */</span>
00139 
00140 <span class="preprocessor">#define REGISTER_MIB(descr, var, vartype, theoid)                      \</span>
00141 <span class="preprocessor">  if (register_mib(descr, (struct variable *) var, sizeof(struct vartype), \</span>
00142 <span class="preprocessor">               sizeof(var)/sizeof(struct vartype),                     \</span>
00143 <span class="preprocessor">               theoid, sizeof(theoid)/sizeof(oid)) != MIB_REGISTERED_OK ) \</span>
00144 <span class="preprocessor">        DEBUGMSGTL(("register_mib", "%s registration failed\n", descr));</span>
00145 
00146 
00147 <span class="preprocessor">#define NUM_EXTERNAL_SIGS 32</span>
00148 <span class="preprocessor">#define SIG_REGISTERED_OK                0</span>
00149 <span class="preprocessor">#define SIG_REGISTRATION_FAILED         -2</span>
00150 <span class="preprocessor">#define SIG_UNREGISTERED_OK              0</span>
00151 
00152 <span class="keyword">extern</span> <span class="keywordtype">int</span>      external_signal_scheduled[NUM_EXTERNAL_SIGS];
00153 <span class="keyword">extern</span> void     (*external_signal_handler[NUM_EXTERNAL_SIGS])(int);
00154 
00155 <span class="keywordtype">int</span>             register_signal(<span class="keywordtype">int</span>, <span class=
"keywordtype">void</span> (*func)(<span class="keywordtype">int</span>));
00156 <span class="keywordtype">int</span>             unregister_signal(<span class="keywordtype">int</span>);
00157 
00158 
00159 
00160 <span class="comment">/*</span>
00161 <span class="comment"> * internal API.  Don't use this.  Use netsnmp_register_handler instead </span>
00162 <span class="comment"> */</span>
00163 
00164 <span class="keyword">struct </span><a class="code" href=
"structnetsnmp__handler__registration__s.html">netsnmp_handler_registration_s</a>;
00165 
00166 <span class="keywordtype">int</span>             netsnmp_register_mib(<span class="keyword">const</span> <span class=
"keywordtype">char</span> *, <span class="keyword">struct</span> variable *,
00167                                      size_t, size_t, oid *, size_t,
00168                                      <span class="keywordtype">int</span>, <span class=
"keywordtype">int</span>, oid, <a class="code" href="structsnmp__session.html">netsnmp_session</a> *,
00169                                      <span class="keyword">const</span> <span class=
"keywordtype">char</span> *, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>,
00170                                      <span class="keyword">struct</span> <a class="code" href=
"structnetsnmp__handler__registration__s.html">netsnmp_handler_registration_s</a> *,
00171                                      <span class="keywordtype">int</span>);
00172 
00173 <span class="preprocessor">#ifdef __cplusplus</span>
00174 }
00175 <span class="preprocessor">#endif</span>
00176 
00177 <span class="preprocessor">#endif                          </span><span class="comment">/* AGENT_REGISTRY_H */</span>
</pre>
  </div>
  <hr size="1" />

  <address style="align: right;">
    <small>Generated on Fri Dec 30 13:47:43 2005 for net-snmp by&nbsp; <a href="http://www.doxygen.org/index.html"><img src=
    "doxygen.png" alt="doxygen" align="middle" border="0" /></a> 1.3.9.1</small>
  </address>
<!-- CONTENT END -->
<!--#include virtual="/page-bottom.html" -->





See more files for this project here

net-snmp

net-snmp provides tools and libraries relating to the Simple Network\r\nManagement Protocol including: An extensible agent, An SNMP library,\r\ntools to request or set information from SNMP agents, tools to\r\ngenerate and handle SNMP traps, etc.\r\n

Project homepage: http://sourceforge.net/projects/net-snmp
Programming language(s): C,Perl,Shell Script
License: other

  mfd/
  acconfig_8h-source.html
  acconfig_8h.html
  agent_2snmp__perl_8c-source.html
  agent__callbacks_8h-source.html
  agent__callbacks_8h.html
  agent__handler_8c-source.html
  agent__handler_8c.html
  agent__handler_8h-source.html
  agent__handler_8h.html
  agent__index_8c-source.html
  agent__index_8c.html
  agent__index_8h-source.html
  agent__index_8h.html
  agent__module__config_8h-source.html
  agent__read__config_8c-source.html
  agent__read__config_8c.html
  agent__read__config_8h-source.html
  agent__read__config_8h.html
  agent__registry_8c-source.html
  agent__registry_8c.html
  agent__registry_8h-source.html
  agent__registry_8h.html
  agent__trap_8c-source.html
  agent__trap_8c.html
  agent__trap_8h-source.html
  agent__trap_8h.html
  all__helpers_8c-source.html
  all__helpers_8h-source.html
  annotated.html
  asn1_8c-source.html
  asn1_8h-source.html
  auto__nlist_8c-source.html
  auto__nlist_8c.html
  auto__nlist_8h-source.html
  auto__nlist_8h.html
  autonlist_8h-source.html
  autonlist_8h.html
  baby__steps_8c-source.html
  baby__steps_8h-source.html
  blah.html
  bulk__to__next_8c-source.html
  bulk__to__next_8h-source.html
  cache__handler_8c-source.html
  cache__handler_8h-source.html
  callback_8c-source.html
  callback_8h-source.html
  check__varbind_8c-source.html
  check__varbind_8h-source.html
  cmu__compat_8c-source.html
  cmu__compat_8h-source.html
  config_8h-source.html
  config_8h.html
  config__api_8h-source.html
  container_8c-source.html
  container_8h-source.html
  container__binary__array_8c-source.html
  container__binary__array_8h-source.html
  container__iterator_8c-source.html
  container__iterator_8h-source.html
  container__list__ssll_8c-source.html
  container__list__ssll_8h-source.html
  container__null_8c-source.html
  container__null_8h-source.html
  data__list_8c-source.html
  data__list_8h-source.html
  data__set_8c-example.html
  data__set_8c-source.html
  data__set_8h-source.html
  debug__handler_8c-source.html
  debug__handler_8h-source.html
  default__store_8c-source.html
  default__store_8h-source.html
  default_store.html
  definitions_8h-source.html
  delayed__instance_8c-example.html
  delayed__instance_8c-source.html
  delayed__instance_8h-source.html
  deprecated.html
  dir_000000.html
  dir_000001.html
  dir_000002.html
  dir_000003.html
  dir_000004.html
  dir_000005.html
  dir_000006.html
  dir_000007.html
  dir_000008.html
  doxygen.css
  doxygen.gif
  doxygen.png
  ds__agent_8h-source.html
  ds__agent_8h.html
  example_8c-source.html
  example_8h-source.html
  examples.html
  factory_8h-source.html
  fd__event__manager_8c-source.html
  fd__event__manager_8h-source.html
  file__utils_8c-source.html
  file__utils_8h-source.html
  files.html