YAF Core Library
libyaf/libyafrag 0.8.0 API documentation

yafhooks.h

Go to the documentation of this file.
00001 /*
00002  ** yafhooks.h
00003  ** YAF Active Flow Table Plugin Interface
00004  **
00005  ** ------------------------------------------------------------------------
00006  ** Copyright (C) 2007 Carnegie Mellon University. All Rights Reserved.
00007  ** ------------------------------------------------------------------------
00008  ** Authors: Brian Trammell <bht@cert.org>
00009  ** ------------------------------------------------------------------------
00010  ** GNU General Public License (GPL) Rights pursuant to Version 2, June 1991
00011  ** Government Purpose License Rights (GPLR) pursuant to DFARS 252.225-7013
00012  ** ------------------------------------------------------------------------
00013  */
00014 
00022 #ifndef _YAF_HOOKS_H_
00023 #define _YAF_HOOKS_H_
00024 
00025 #include <yaf/autoinc.h>
00026 #include <yaf/decode.h>
00027 #include <yaf/yafcore.h>
00028 
00030 #define YAF_HOOK_INTERFACE_VERSION 1
00031 
00034 struct yfHookMetaData {
00036     uint8_t version;
00039     uint32_t exportDataSize;
00040 };
00041 
00056 gboolean            yfHookPacket (
00057     yfFlowKey_t * key,
00058     const uint8_t * pkt,
00059     size_t caplen,
00060     uint16_t iplen,
00061     yfTCPInfo_t * tcpinfo,
00062     yfL2Info_t * l2info);
00063 
00078 void                yfHookFlowPacket (
00079     yfFlow_t * flow,
00080     yfFlowVal_t * val,
00081     const uint8_t * pkt,
00082     size_t caplen,
00083     uint16_t iplen,
00084     yfTCPInfo_t * tcpinfo,
00085     yfL2Info_t * l2info);
00086 
00097 gboolean            yfHookFlowClose (
00098     yfFlow_t * flow);
00099 
00109 void                yfHookFlowAlloc (
00110     yfFlow_t * flow);
00111 
00121 void                yfHookFlowFree (
00122     yfFlow_t * flow);
00123 
00132 fbInfoElement_t    *yfHookGetInfoModel (
00133     void);
00143 fbInfoElementSpec_t *yfHookGetTemplate (
00144     void);
00158 gboolean            yfWriteFlowHook (
00159     void *rec,
00160     size_t rec_sz,
00161     yfFlow_t * flow,
00162     GError ** err);
00163 
00176 gboolean            yfHookAddNewHook (
00177     const char *hookName,
00178     const char *hookOpts,
00179     GError ** err);
00180 
00181 
00182 
00183 
00184 
00185 #endif