Snort_AIPreproc/doc/html/group__sfPolicyConfig.html
2010-08-16 22:09:34 +02:00

223 lines
12 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Snort AI preprocessor module: Sourcefire policy configuration module</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li id="searchli">
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<h1>Sourcefire policy configuration module</h1> </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">tSfPolicyUserContextId&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sfPolicyConfig.html#gac62cd5838bee4a9d3f40561eae920cdd">sfPolicyConfigCreate</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sfPolicyConfig.html#ga189d09ed6d1203ebace6ea2c2aafc1b8">sfPolicyConfigDelete</a> (tSfPolicyUserContextId pContext)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sfPolicyConfig.html#ga8e14fd83397b9bbb14568070183db80b">sfPolicyUserDataSet</a> (tSfPolicyUserContextId pContext, tSfPolicyId policyId, void *config)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sfPolicyConfig.html#gae8f2ae426b1f1a50eabfade6d22c2c85">sfPolicyUserDataClear</a> (tSfPolicyUserContextId pContext, tSfPolicyId policyId)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sfPolicyConfig.html#ga3f3ab9314d29d2ee2a8285289b388f17">sfPolicyUserDataIterate</a> (tSfPolicyUserContextId pContext, int(*callback)(tSfPolicyUserContextId pContext, tSfPolicyId policyId, void *config))</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Create a user policy configuration context. A context provides facility for creating policy specific data instances. User can create as many policy instances as memory resources will allow. User can create/delete context, set/clear/get user date for a specific policy, default policy or current policy. User can also iterate over all instances user data.</p>
<p>In current design, preprocessor use this module directly to manage policy specific data instances. A future enhancement can be to extract policy management code from each processor and put it in a new policy management module. Policy management module will set a single pointer to user data before calling appropriate callback function in a preprocessor. As an example, policy module will iterate over all policies and call CleanExit functions in every preprocessor for each policy. This will make policy management module will hide policies from preprocessors and make them policy agnostic. </p>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gac62cd5838bee4a9d3f40561eae920cdd"></a><!-- doxytag: member="sfPolicyUserData.c::sfPolicyConfigCreate" ref="gac62cd5838bee4a9d3f40561eae920cdd" args="(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">tSfPolicyUserContextId sfPolicyConfigCreate </td>
<td>(</td>
<td class="paramtype">void&nbsp;</td>
<td class="paramname"></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Create a user context. Allocates a new context and return it to user. All transactions within a context are independent from any other transactions in a different context.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>tSfPolicyUserContextId </dd></dl>
</div>
</div>
<a class="anchor" id="ga189d09ed6d1203ebace6ea2c2aafc1b8"></a><!-- doxytag: member="sfPolicyUserData.c::sfPolicyConfigDelete" ref="ga189d09ed6d1203ebace6ea2c2aafc1b8" args="(tSfPolicyUserContextId pContext)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void sfPolicyConfigDelete </td>
<td>(</td>
<td class="paramtype">tSfPolicyUserContextId&nbsp;</td>
<td class="paramname"> <em>pContext</em></td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Delete a user policy data context. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>pContext</em>&nbsp;</td><td></td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="gae8f2ae426b1f1a50eabfade6d22c2c85"></a><!-- doxytag: member="sfPolicyUserData.c::sfPolicyUserDataClear" ref="gae8f2ae426b1f1a50eabfade6d22c2c85" args="(tSfPolicyUserContextId pContext, tSfPolicyId policyId)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void* sfPolicyUserDataClear </td>
<td>(</td>
<td class="paramtype">tSfPolicyUserContextId&nbsp;</td>
<td class="paramname"> <em>pContext</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">tSfPolicyId&nbsp;</td>
<td class="paramname"> <em>policyId</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>user is responsible for freeing any memory. </p>
</div>
</div>
<a class="anchor" id="ga3f3ab9314d29d2ee2a8285289b388f17"></a><!-- doxytag: member="sfPolicyUserData.c::sfPolicyUserDataIterate" ref="ga3f3ab9314d29d2ee2a8285289b388f17" args="(tSfPolicyUserContextId pContext, int(*callback)(tSfPolicyUserContextId pContext, tSfPolicyId policyId, void *config))" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sfPolicyUserDataIterate </td>
<td>(</td>
<td class="paramtype">tSfPolicyUserContextId&nbsp;</td>
<td class="paramname"> <em>pContext</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int(*)(tSfPolicyUserContextId pContext, tSfPolicyId policyId, void *config)&nbsp;</td>
<td class="paramname"> <em>callback</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="ga8e14fd83397b9bbb14568070183db80b"></a><!-- doxytag: member="sfPolicyUserData.c::sfPolicyUserDataSet" ref="ga8e14fd83397b9bbb14568070183db80b" args="(tSfPolicyUserContextId pContext, tSfPolicyId policyId, void *config)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int sfPolicyUserDataSet </td>
<td>(</td>
<td class="paramtype">tSfPolicyUserContextId&nbsp;</td>
<td class="paramname"> <em>pContext</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">tSfPolicyId&nbsp;</td>
<td class="paramname"> <em>policyId</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&nbsp;</td>
<td class="paramname"> <em>config</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Store a pointer to user data. </p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>pContext</em>&nbsp;</td><td></td></tr>
<tr><td valign="top"></td><td valign="top"><em>policyId</em>&nbsp;</td><td>is 0 based. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>config</em>&nbsp;</td><td>- pointer to user configuration. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&nbsp;</span>Defines</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Mon Aug 16 2010 22:05:38 for Snort AI preprocessor module by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>