cache__handler_8h-source.html from net-snmp at Krugle
Show cache__handler_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 Page</a> | <a class="qindex" href="modules.html">Modules</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="pages.html">Related Pages</a> | <a class=
"qindex" href="examples.html">Examples</a>
</div>
<div class="nav">
<a class="el" href="dir_000000.html">include</a> / <a class="el" href=
"dir_000001.html">net-snmp</a> / <a class="el" href="dir_000002.html">agent</a>
</div>
<h1>cache_handler.h</h1>
<div class="fragment">
<pre class="fragment">
00001 <span class="preprocessor">#ifndef NETSNMP_CACHE_HANDLER_H</span>
00002 <span class="preprocessor">#define NETSNMP_CACHE_HANDLER_H</span>
00003
00004 <span class="comment">/*</span>
00005 <span class="comment"> * This caching helper provides a generalised (SNMP-manageable) caching</span>
00006 <span class="comment"> * mechanism. Individual SNMP table and scalar/scalar group MIB</span>
00007 <span class="comment"> * implementations can use data caching in a consistent manner, without</span>
00008 <span class="comment"> * needing to handle the generic caching details themselves.</span>
00009 <span class="comment"> */</span>
00010
00011 <span class="preprocessor">#include <net-snmp/library/tools.h></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="preprocessor">#define CACHE_NAME "cache_info"</span>
00018
00019 <span class="keyword">typedef</span> <span class="keyword">struct </span>netsnmp_cache_s netsnmp_cache;
00020
00021 <span class="keyword">typedef</span> int (NetsnmpCacheLoad)(netsnmp_cache *, <span class="keywordtype">void</span>*);
00022 <span class="keyword">typedef</span> void (NetsnmpCacheFree)(netsnmp_cache *, <span class="keywordtype">void</span>*);
00023
00024 <span class="keyword">struct </span>netsnmp_cache_s {
00025 <span class="comment">/*</span>
00026 <span class="comment"> * For operation of the data caches</span>
00027 <span class="comment"> */</span>
00028 <span class="keywordtype">int</span> flags;
00029 <span class="keywordtype">int</span> enabled;
00030 <span class="keywordtype">int</span> valid;
00031 <span class="keywordtype">char</span> expired;
00032 <span class="keywordtype">int</span> timeout; <span class=
"comment">/* Length of time the cache is valid (in s) */</span>
00033 marker_t timestamp; <span class="comment">/* When the cache was last loaded */</span>
00034 u_long timer_id; <span class="comment">/* periodic timer id */</span>
00035
00036 NetsnmpCacheLoad *load_cache;
00037 NetsnmpCacheFree *free_cache;
00038
00039 <span class="comment">/*</span>
00040 <span class="comment"> * void pointer for the user that created the cache.</span>
00041 <span class="comment"> * You never know when it might not come in useful ....</span>
00042 <span class="comment"> */</span>
00043 <span class="keywordtype">void</span> *magic;
00044
00045 <span class="comment">/*</span>
00046 <span class="comment"> * hint from the cache helper. contains the standard</span>
00047 <span class="comment"> * handler arguments.</span>
00048 <span class="comment"> */</span>
00049 netsnmp_handler_args *cache_hint;
00050
00051 <span class="comment">/*</span>
00052 <span class="comment"> * For SNMP-management of the data caches</span>
00053 <span class="comment"> */</span>
00054 netsnmp_cache *next, *prev;
00055 oid *rootoid;
00056 <span class="keywordtype">int</span> rootoid_len;
00057
00058 };
00059
00060
00061 <span class="keywordtype">void</span> <a class="code" href=
"group__cache__handler.html#ga11">netsnmp_cache_reqinfo_insert</a>(netsnmp_cache* cache,
00062 <a class="code" href=
"structnetsnmp__agent__request__info__s.html">netsnmp_agent_request_info</a> * reqinfo,
00063 <span class="keyword">const</span> <span class="keywordtype">char</span> *name);
00064 netsnmp_cache *
00065 <a class="code" href="group__cache__handler.html#ga12">netsnmp_cache_reqinfo_extract</a>(<a class="code" href=
"structnetsnmp__agent__request__info__s.html">netsnmp_agent_request_info</a> * reqinfo,
00066 <span class="keyword">const</span> <span class="keywordtype">char</span> *name);
00067 netsnmp_cache* <a class="code" href="group__cache__handler.html#ga13">netsnmp_extract_cache_info</a>(<a class="code"
href="structnetsnmp__agent__request__info__s.html">netsnmp_agent_request_info</a> *);
00068
00069 <span class="keywordtype">int</span> <a class="code" href=
"group__cache__handler.html#ga15">netsnmp_cache_check_and_reload</a>(netsnmp_cache * cache);
00070 <span class="keywordtype">int</span> <a class="code" href=
"group__cache__handler.html#ga14">netsnmp_cache_check_expired</a>(netsnmp_cache *cache);
00071 <span class="keywordtype">int</span> <a class="code" href=
"group__cache__handler.html#ga16">netsnmp_cache_is_valid</a>( <a class="code" href=
"structnetsnmp__agent__request__info__s.html">netsnmp_agent_request_info</a> *,
00072 <span class="keyword">const</span> <span class=
"keywordtype">char</span> *name);
00074 <span class="keywordtype">int</span> <a class="code" href=
"group__cache__handler.html#ga17">netsnmp_is_cache_valid</a>( <a class="code" href=
"structnetsnmp__agent__request__info__s.html">netsnmp_agent_request_info</a> *);
00075 <a class="code" href="structnetsnmp__mib__handler__s.html">netsnmp_mib_handler</a> *<a class="code" href=
"group__cache__handler.html#ga7">netsnmp_get_cache_handler</a>(<span class="keywordtype">int</span>, NetsnmpCacheLoad *,
00076 NetsnmpCacheFree *,
00077 oid*, <span class="keywordtype">int</span>);
00078 <span class="keywordtype">int</span> <a class="code" href=
"group__cache__handler.html#ga9">netsnmp_register_cache_handler</a>(<a class="code" href=
"structnetsnmp__handler__registration__s.html">netsnmp_handler_registration</a> *reginfo,
00079 <span class="keywordtype">int</span>, NetsnmpCacheLoad *,
00080 NetsnmpCacheFree *);
00081
00082 Netsnmp_Node_Handler netsnmp_cache_helper_handler;
00083
00084 netsnmp_cache *
00085 <a class="code" href="group__cache__handler.html#ga2">netsnmp_cache_create</a>(<span class=
"keywordtype">int</span> timeout, NetsnmpCacheLoad * load_hook,
00086 NetsnmpCacheFree * free_hook,
00087 oid * rootoid, <span class="keywordtype">int</span> rootoid_len);
00088 <a class="code" href="structnetsnmp__mib__handler__s.html">netsnmp_mib_handler</a> *
00089 <a class="code" href="group__cache__handler.html#ga6">netsnmp_cache_handler_get</a>(netsnmp_cache* cache);
00090
00091 netsnmp_cache * <a class="code" href="group__cache__handler.html#ga1">netsnmp_cache_find_by_oid</a>(oid * rootoid,
00092 <span class="keywordtype">int</span> rootoid_len);
00093
00094 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href=
"group__cache__handler.html#ga4">netsnmp_cache_timer_start</a>(netsnmp_cache *cache);
00095 <span class="keywordtype">void</span> <a class="code" href=
"group__cache__handler.html#ga5">netsnmp_cache_timer_stop</a>(netsnmp_cache *cache);
00096
00097 <span class="comment">/*</span>
00098 <span class="comment"> * Flags affecting cache handler operation</span>
00099 <span class="comment"> */</span>
00100 <span class="preprocessor">#define NETSNMP_CACHE_DONT_INVALIDATE_ON_SET 0x0001</span>
00101 <span class="preprocessor">#define NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD 0x0002</span>
00102 <span class="preprocessor">#define NETSNMP_CACHE_DONT_FREE_EXPIRED 0x0004</span>
00103 <span class="preprocessor">#define NETSNMP_CACHE_DONT_AUTO_RELEASE 0x0008</span>
00104 <span class="preprocessor">#define NETSNMP_CACHE_PRELOAD 0x0010</span>
00105 <span class="preprocessor">#define NETSNMP_CACHE_AUTO_RELOAD 0x0020</span>
00106
00107 <span class="preprocessor">#define NETSNMP_CACHE_HINT_HANDLER_ARGS 0x1000</span>
00108
00109
00110 <span class="preprocessor">#ifdef __cplusplus</span>
00111 }
00112 <span class="preprocessor">#endif</span>
00113 <span class="preprocessor">#endif </span><span class="comment">/* NETSNMP_CACHE_HANDLER_H */</span>
</pre>
</div>
<hr size="1" />
<address style="align: right;">
<small>Generated on Fri Dec 30 13:47:44 2005 for net-snmp by <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