Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

perf.h

Go to the documentation of this file.
00001 /*
00002 ** $Id$
00003 **
00004 ** perf.h
00005 **
00006 ** Copyright (C) 2002 Sourcefire,Inc
00007 ** Dan Roelker <droelker@sourcefire.com>
00008 **
00009 ** This program is free software; you can redistribute it and/or modify
00010 ** it under the terms of the GNU General Public License as published by
00011 ** the Free Software Foundation; either version 2 of the License, or
00012 ** (at your option) any later version.
00013 **
00014 ** This program is distributed in the hope that it will be useful,
00015 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 ** GNU General Public License for more details.
00018 **
00019 ** You should have received a copy of the GNU General Public License
00020 ** along with this program; if not, write to the Free Software
00021 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00022 **
00023 **
00024 **  DESCRIPTION
00025 **    These are the basic functions and structures that are needed to call 
00026 **    performance functions.
00027 **
00028 ** Copyright (C) 2002 Sourcefire,Inc
00029 ** Dan Roelker
00030 **
00031 **
00032 **
00033 ** This program is free software; you can redistribute it and/or modify
00034 ** it under the terms of the GNU General Public License as published by
00035 ** the Free Software Foundation; either version 2 of the License, or
00036 ** (at your option) any later version.
00037 **
00038 ** This program is distributed in the hope that it will be useful,
00039 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00040 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00041 ** GNU General Public License for more details.
00042 **
00043 ** You should have received a copy of the GNU General Public License
00044 ** along with this program; if not, write to the Free Software
00045 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00046 **
00047 */
00048 
00049 #ifndef _PERF_H
00050 #define _PERF_H
00051 
00052 #define SFPERF_BASE     1
00053 #define SFPERF_FLOW     2
00054 #define SFPERF_EVENT    4
00055 #define SFPERF_BASE_MAX 8
00056 #define SFPERF_CONSOLE  16
00057 #define SFPERF_FILE     32
00058 #define SFPERF_PKTCNT   64
00059 #define SFPERF_SUMMARY 128
00060 
00061 #ifndef UINT64
00062 #define UINT64 unsigned long long
00063 #endif
00064 
00065 #include "perf-base.h"
00066 #include "perf-flow.h"
00067 #include "perf-event.h"
00068 
00069 typedef struct _SFPERF {
00070 
00071     int    iPerfFlags;
00072     unsigned int    iPktCnt;
00073 
00074     int    sample_interval;
00075     int    sample_time;
00076 
00077     SFBASE  sfBase;
00078     SFFLOW  sfFlow;
00079     SFEVENT sfEvent;
00080 
00081     char    file[1024];
00082     FILE  * fh;
00083     
00084 } SFPERF;
00085 
00086 int sfInitPerformanceStatistics(SFPERF *sfPerf);
00087 int sfSetPerformanceSampleTime(SFPERF *sfPerf, int iSeconds);
00088 int sfSetPerformanceAccounting(SFPERF *sfPerf, int iReset);
00089 int sfSetPerformanceStatistics(SFPERF *sfPerf, int iFlag);
00090 int sfSetPerformanceStatisticsEx(SFPERF *sfPerf, int iFlag, void * param);
00091 int sfRotatePerformanceStatisticsFile(SFPERF *sfPerf);
00092 int sfPerformanceStats(SFPERF *sfPerf, unsigned char *pucPacket, int len,
00093                        int iRebuiltPkt);
00094 int sfProcessPerfStats(SFPERF *sfPerf);
00095 int CheckSampleInterval(time_t curr_time, SFPERF *sfPerf);
00096 
00097 #endif

Generated on Sun May 14 14:51:15 2006 by  doxygen 1.4.2