mirror of
https://github.com/BlackLight/Snort_AIPreproc.git
synced 2024-12-29 12:05:11 +01:00
319 lines
15 KiB
HTML
319 lines
15 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: spp_ai.c File Reference</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 Page</span></a></li>
|
||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||
|
<li><a href="annotated.html"><span>Data Structures</span></a></li>
|
||
|
<li class="current"><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 class="tabs2">
|
||
|
<ul class="tablist">
|
||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||
|
<li><a href="globals.html"><span>Globals</span></a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="header">
|
||
|
<div class="summary">
|
||
|
<a href="#define-members">Defines</a> |
|
||
|
<a href="#func-members">Functions</a> |
|
||
|
<a href="#var-members">Variables</a> </div>
|
||
|
<div class="headertitle">
|
||
|
<h1>spp_ai.c File Reference</h1> </div>
|
||
|
</div>
|
||
|
<div class="contents">
|
||
|
<code>#include "<a class="el" href="spp__ai_8h_source.html">spp_ai.h</a>"</code><br/>
|
||
|
<code>#include "preprocids.h"</code><br/>
|
||
|
<code>#include "sf_dynamic_preproc_lib.h"</code><br/>
|
||
|
<code>#include "sf_dynamic_preprocessor.h"</code><br/>
|
||
|
<code>#include "debug.h"</code><br/>
|
||
|
<code>#include "sfPolicy.h"</code><br/>
|
||
|
<code>#include "sfPolicyUserData.h"</code><br/>
|
||
|
<code>#include <sys/types.h></code><br/>
|
||
|
<code>#include <stdlib.h></code><br/>
|
||
|
<code>#include <ctype.h></code><br/>
|
||
|
<code>#include <string.h></code><br/>
|
||
|
<code>#include <pthread.h></code><br/>
|
||
|
<table class="memberdecls">
|
||
|
<tr><td colspan="2"><h2><a name="define-members"></a>
|
||
|
Defines</h2></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="spp__ai_8c.html#a9e7d446fc8b40be2cfbb5c69c3e132ca">GENERATOR_EXAMPLE</a> 256</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="spp__ai_8c.html#af4c767ae0346026264c851108f42be63">SRC_PORT_MATCH</a> 1</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="spp__ai_8c.html#a3ec4dd8f1ebed73c13175d9b9c820e2e">SRC_PORT_MATCH_STR</a> "example_preprocessor: src port match"</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="spp__ai_8c.html#a8ab13e8ad1dfd19b9237a99ae6130146">DST_PORT_MATCH</a> 2</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="spp__ai_8c.html#a1f3521b9bcf5daf99190be58473a4110">DST_PORT_MATCH_STR</a> "example_preprocessor: dest port match"</td></tr>
|
||
|
<tr><td colspan="2"><h2><a name="func-members"></a>
|
||
|
Functions</h2></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="spp__ai_8c.html#a3524cbdf8fddbcf38c4ed55241002242">AI_init</a> (char *args)</td></tr>
|
||
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Initialize the preprocessor module. <a href="#a3524cbdf8fddbcf38c4ed55241002242"></a><br/></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="spp__ai_8c.html#a57c05cda012c443cb4c358dc327cd3d1">AI_process</a> (void *pkt, void *context)</td></tr>
|
||
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Function executed every time the module receives a packet to be processed. <a href="#a57c05cda012c443cb4c358dc327cd3d1"></a><br/></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct__AI__config.html">AI_config</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="spp__ai_8c.html#ae1c5c4b38ee2819d427848eb3046373e">AI_parse</a> (char *args)</td></tr>
|
||
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Parse the arguments passed to the module saving them to a valid configuration struct. <a href="#ae1c5c4b38ee2819d427848eb3046373e"></a><br/></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="spp__ai_8c.html#a1b9ebb5c719c7d9426ddfc1f3da36570">AI_setup</a> (void)</td></tr>
|
||
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set up the preprocessor module. <a href="#a1b9ebb5c719c7d9426ddfc1f3da36570"></a><br/></td></tr>
|
||
|
<tr><td colspan="2"><h2><a name="var-members"></a>
|
||
|
Variables</h2></td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">tSfPolicyUserContextId </td><td class="memItemRight" valign="bottom"><a class="el" href="spp__ai_8c.html#a3dd75596c540d148643fe6d1fdc02628">ex_config</a> = NULL</td></tr>
|
||
|
<tr><td class="memItemLeft" align="right" valign="top">DynamicPreprocessorData </td><td class="memItemRight" valign="bottom"><a class="el" href="spp__ai_8c.html#ab46420126c43c1aac5eabc5db266a71c">_dpd</a></td></tr>
|
||
|
</table>
|
||
|
<hr/><h2>Define Documentation</h2>
|
||
|
<a class="anchor" id="a8ab13e8ad1dfd19b9237a99ae6130146"></a><!-- doxytag: member="spp_ai.c::DST_PORT_MATCH" ref="a8ab13e8ad1dfd19b9237a99ae6130146" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">#define DST_PORT_MATCH 2</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a1f3521b9bcf5daf99190be58473a4110"></a><!-- doxytag: member="spp_ai.c::DST_PORT_MATCH_STR" ref="a1f3521b9bcf5daf99190be58473a4110" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">#define DST_PORT_MATCH_STR "example_preprocessor: dest port match"</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a9e7d446fc8b40be2cfbb5c69c3e132ca"></a><!-- doxytag: member="spp_ai.c::GENERATOR_EXAMPLE" ref="a9e7d446fc8b40be2cfbb5c69c3e132ca" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">#define GENERATOR_EXAMPLE 256</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="af4c767ae0346026264c851108f42be63"></a><!-- doxytag: member="spp_ai.c::SRC_PORT_MATCH" ref="af4c767ae0346026264c851108f42be63" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">#define SRC_PORT_MATCH 1</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a3ec4dd8f1ebed73c13175d9b9c820e2e"></a><!-- doxytag: member="spp_ai.c::SRC_PORT_MATCH_STR" ref="a3ec4dd8f1ebed73c13175d9b9c820e2e" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">#define SRC_PORT_MATCH_STR "example_preprocessor: src port match"</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr/><h2>Function Documentation</h2>
|
||
|
<a class="anchor" id="a3524cbdf8fddbcf38c4ed55241002242"></a><!-- doxytag: member="spp_ai.c::AI_init" ref="a3524cbdf8fddbcf38c4ed55241002242" args="(char *args)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">static void AI_init </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">char * </td>
|
||
|
<td class="paramname"> <em>args</em></td>
|
||
|
<td> ) </td>
|
||
|
<td><code> [static]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
<p>Initialize the preprocessor module. </p>
|
||
|
<p>FUNCTION: AI_init </p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table border="0" cellspacing="2" cellpadding="0">
|
||
|
<tr><td valign="top"></td><td valign="top"><em>args</em> </td><td>Configuration arguments passed to the module </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ae1c5c4b38ee2819d427848eb3046373e"></a><!-- doxytag: member="spp_ai.c::AI_parse" ref="ae1c5c4b38ee2819d427848eb3046373e" args="(char *args)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">static <a class="el" href="struct__AI__config.html">AI_config</a> * AI_parse </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">char * </td>
|
||
|
<td class="paramname"> <em>args</em></td>
|
||
|
<td> ) </td>
|
||
|
<td><code> [static]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
<p>Parse the arguments passed to the module saving them to a valid configuration struct. </p>
|
||
|
<p>FUNCTION: AI_config </p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table border="0" cellspacing="2" cellpadding="0">
|
||
|
<tr><td valign="top"></td><td valign="top"><em>args</em> </td><td>Arguments passed to the module </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
<dl class="return"><dt><b>Returns:</b></dt><dd>Pointer to AI_config keeping the configuration for the module </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a57c05cda012c443cb4c358dc327cd3d1"></a><!-- doxytag: member="spp_ai.c::AI_process" ref="a57c05cda012c443cb4c358dc327cd3d1" args="(void *pkt, void *context)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void AI_process </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">void * </td>
|
||
|
<td class="paramname"> <em>pkt</em>, </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td class="paramkey"></td>
|
||
|
<td></td>
|
||
|
<td class="paramtype">void * </td>
|
||
|
<td class="paramname"> <em>context</em></td><td> </td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td></td>
|
||
|
<td>)</td>
|
||
|
<td></td><td></td><td><code> [static]</code></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
<p>Function executed every time the module receives a packet to be processed. </p>
|
||
|
<p>FUNCTION: AI_process </p>
|
||
|
<dl><dt><b>Parameters:</b></dt><dd>
|
||
|
<table border="0" cellspacing="2" cellpadding="0">
|
||
|
<tr><td valign="top"></td><td valign="top"><em>pkt</em> </td><td>void* pointer to the packet data </td></tr>
|
||
|
<tr><td valign="top"></td><td valign="top"><em>context</em> </td><td>void* pointer to the context </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a1b9ebb5c719c7d9426ddfc1f3da36570"></a><!-- doxytag: member="spp_ai.c::AI_setup" ref="a1b9ebb5c719c7d9426ddfc1f3da36570" args="(void)" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void AI_setup </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">void </td>
|
||
|
<td class="paramname"></td>
|
||
|
<td> ) </td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
<p>Set up the preprocessor module. </p>
|
||
|
<p>FUNCTION: AI_setup </p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr/><h2>Variable Documentation</h2>
|
||
|
<a class="anchor" id="ab46420126c43c1aac5eabc5db266a71c"></a><!-- doxytag: member="spp_ai.c::_dpd" ref="ab46420126c43c1aac5eabc5db266a71c" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">DynamicPreprocessorData <a class="el" href="spp__ai_8c.html#ab46420126c43c1aac5eabc5db266a71c">_dpd</a></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a3dd75596c540d148643fe6d1fdc02628"></a><!-- doxytag: member="spp_ai.c::ex_config" ref="a3dd75596c540d148643fe6d1fdc02628" args="" -->
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">tSfPolicyUserContextId <a class="el" href="spp__ai_8c.html#a3dd75596c540d148643fe6d1fdc02628">ex_config</a> = NULL</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="memdoc">
|
||
|
|
||
|
</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"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </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 Wed Aug 4 2010 11:30:57 for Snort AI preprocessor module by
|
||
|
<a href="http://www.doxygen.org/index.html">
|
||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
|
||
|
</body>
|
||
|
</html>
|