Cleanup headers. Satify includes for header file

This commit is contained in:
Peter Haag 2017-12-28 18:19:27 +01:00
parent 9c2e7d6f4a
commit cedc8479a8
28 changed files with 216 additions and 108 deletions

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
* Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
@ -28,17 +29,27 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author: haag $
*
* $Id: expire.h 39 2009-11-25 08:11:15Z haag $
*
* $LastChangedRevision: 39 $
*
*/
#ifndef _EXPIRE_H
#define _EXPIRE_H 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_FTS_H
# include <fts.h>
#else
# include "fts_compat.h"
#endif
#include "nfstatfile.h"
#include "bookkeeper.h"
typedef struct channel_s {
struct channel_s *next;
char *datadir;

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2012, Peter Haag
*
@ -26,17 +27,20 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author: peter $
*
* $Id: exporter.h 224 2014-02-16 12:59:29Z peter $
*
* $LastChangedRevision: 224 $
*
*/
#ifndef _EXPORTER_H
#define _EXPORTER_H 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include "nffile.h"
int InitExporterList(void);
int AddExporterInfo(exporter_info_record_t *exporter_record);

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
* Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
@ -28,17 +29,15 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author: haag $
*
* $Id: flist.h 39 2009-11-25 08:11:15Z haag $
*
* $LastChangedRevision: 39 $
*
*/
#ifndef _FLIST_H
#define _FLIST_H 1
#include <time.h>
#include "nffile.h"
#define EMPTY_LIST ((nffile_t *)-1)
int InitHierPath(int num);

View File

@ -37,15 +37,17 @@
#include "config.h"
#endif
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <sys/time.h>
#include <time.h>
#include <signal.h>
#include "collector.h"
#include "rbtree.h"
#include "nffile.h"
#define v4 ip_union._v4
#define v6 ip_union._v6

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
* Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
@ -28,18 +29,18 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author:$
*
* $Id:$
*
* $LastChangedRevision:$
*
*
*/
#ifndef _IPCONV_H
#define _IPCONV_H 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
int parse_ip(int *af, const char *src, uint64_t *dst, int *bytes, int lookup, uint32_t *num_ip );
int set_nameserver(char *ns);

View File

@ -33,6 +33,15 @@
#ifndef _IPFIX_H
#define _IPFIX_H 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include "collector.h"
/* reference: http://tools.ietf.org/html/draft-ietf-ipfix-protocol-rfc5101bis-00 */
typedef struct ipfix_header {

View File

@ -29,6 +29,18 @@
*
*/
#ifndef _IPFRAG_H
#define _IPFRAG_H 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include "rbtree.h"
typedef struct hole_s {
struct hole_s *next;
uint32_t first;
@ -69,3 +81,4 @@ void *IPFrag_tree_Update(uint32_t src, uint32_t dst, uint32_t ident, uint32_t *l
uint32_t IPFragEntries(void);
#endif

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
* Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
@ -28,18 +29,15 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author: haag $
*
* $Id: launch.h 39 2009-11-25 08:11:15Z haag $
*
* $LastChangedRevision: 39 $
*
*
*/
#ifndef _LAUNCH_H
#define _LAUNCH_H 1
#include "config.h"
#include <time.h>
#define FNAME_SIZE 256
#define IDENT_SIZE 32

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2016, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2013, Peter Haag

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2016, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
@ -34,6 +35,15 @@
#ifndef _NETFLOW_V1_H
#define _NETFLOW_V1_H 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include "collector.h"
#define NETFLOW_V1_HEADER_LENGTH 16
#define NETFLOW_V1_RECORD_LENGTH 48
#define NETFLOW_V1_MAX_RECORDS 24

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
* Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
@ -28,17 +29,22 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author: haag $
*
* $Id: netflow_v5_v7.h 39 2009-11-25 08:11:15Z haag $
*
* $LastChangedRevision: 39 $
*
*/
#ifndef _NETFLOW_V5_V7_H
#define _NETFLOW_V5_V7_H 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include "collector.h"
#include "nffile.h"
#include "nfnet.h"
#define NETFLOW_V5_HEADER_LENGTH 24
#define NETFLOW_V5_RECORD_LENGTH 48
#define NETFLOW_V5_MAX_RECORDS 30

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
* Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
@ -28,12 +29,6 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author: haag $
*
* $Id: netflow_v9.h 51 2010-01-29 09:01:54Z haag $
*
* $LastChangedRevision: 51 $
*
*/
/* v9 structures */
@ -72,6 +67,17 @@
#ifndef _NETFLOW_V9_H
#define _NETFLOW_V9_H 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include "collector.h"
#include "nfnet.h"
#include "nffile.h"
typedef struct netflow_v9_header {
uint16_t version;
uint16_t count;

View File

@ -35,6 +35,7 @@
#include "config.h"
#include <stdio.h>
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
* Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
@ -28,18 +29,18 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author: haag $
*
* $Id: nf_common.h 39 2009-11-25 08:11:15Z haag $
*
* $LastChangedRevision: 39 $
*
*
*/
#ifndef _NF_COMMON_H
#define _NF_COMMON_H 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <time.h>
typedef void (*printer_t)(void *, char **, int);

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2015, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
* Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
@ -28,17 +29,14 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author: haag $
*
* $Id: nfexport.h 54 2010-01-29 11:30:22Z haag $
*
* $LastChangedRevision: 54 $
*
*/
#ifndef _NFEXPORT_H
#define _NFEXPORT_H 1
#include "nffile.h"
#include "nfx.h"
int ExportFlowTable(nffile_t *nffile, int aggregate, int bidir, int date_sorted, extension_map_list_t *extension_map_list);
#endif //_NFEXPORT_H

View File

@ -34,8 +34,12 @@
#ifndef _NFFILE_H
#define _NFFILE_H 1
#ifdef HAVE_STDDEF_H
#include "config.h"
#include <stddef.h>
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#define IDENTLEN 128

View File

@ -34,6 +34,7 @@
#include "config.h"
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
* Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
@ -28,17 +29,21 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author: haag $
*
* $Id: nflowcache.h 39 2009-11-25 08:11:15Z haag $
*
* $LastChangedRevision: 39 $
*
*/
#ifndef _NFLOWCACHE_H
#define _NFLOWCACHE_H 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include "nfx.h"
#include "nffile.h"
/* Definitions */
/*

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2016, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
* Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
@ -28,17 +29,16 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author: haag $
*
* $Id: nfnet.h 39 2009-11-25 08:11:15Z haag $
*
* $LastChangedRevision: 39 $
*
*/
#ifndef _NFNET_H
#define _NFNET_H 1
#include "config.h"
#include <sys/socket.h>
/* Definitions */
#define UDP_PACKET_SIZE 1472

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
* Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
@ -28,17 +29,22 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author: haag $
*
* $Id: nfprof.h 39 2009-11-25 08:11:15Z haag $
*
* $LastChangedRevision: 39 $
*
*/
#ifndef _NFPROF_H
#define _NFPROF_H 1
#include "config.h"
#include <stdio.h>
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <sys/time.h>
#include <sys/resource.h>
typedef struct nfprof_s {
struct timeval tstart; /* start time */
struct timeval tend; /* end time */

View File

@ -34,6 +34,17 @@
#ifndef _NFSTAT_H
#define _NFSTAT_H 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include "nf_common.h"
#include "nfx.h"
#include "nffile.h"
/* Definitions */

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
* Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
@ -28,17 +29,18 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author: haag $
*
* $Id: nfstatfile.h 39 2009-11-25 08:11:15Z haag $
*
* $LastChangedRevision: 39 $
*
*/
#ifndef _NFSTATFILE_H
#define _NFSTATFILE_H 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
typedef struct dirstat_s {
uint64_t first; // for more easy parsing and assigning, take a uint64_t also for the time_t type
uint64_t last;

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
* Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
@ -28,17 +29,20 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author: haag $
*
* $Id: nftree.h 39 2009-11-25 08:11:15Z haag $
*
* $LastChangedRevision: 39 $
*
*/
#ifndef _NFTREE_H
#define _NFTREE_H 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include "rbtree.h"
/*
* type definitions for nf tree
*/

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
* Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
@ -28,17 +29,20 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author: haag $
*
* $Id: nfx.h 48 2010-01-02 08:06:27Z haag $
*
* $LastChangedRevision: 48 $
*
*/
#ifndef _NFX_H
#define _NFX_H 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include "nffile.h"
// MAX_EXTENSION_MAPS must be a power of 2
#define MAX_EXTENSION_MAPS 65536
#define EXTENSION_MAP_MASK (MAX_EXTENSION_MAPS-1)

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
* Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
@ -28,12 +29,6 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author: haag $
*
* $Id: panonymizer.h 39 2009-11-25 08:11:15Z haag $
*
* $LastChangedRevision: 39 $
*
*/
/* Original disclaimer
@ -80,6 +75,13 @@
#ifndef _PANONYMIZER_H_
#define _PANONYMIZER_H_ 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include "rijndael.h"
// PAnonymizer_Init need a 256-bit key

View File

@ -1,4 +1,5 @@
/*
* Copyright (c) 2017, Peter Haag
* Copyright (c) 2014, Peter Haag
* Copyright (c) 2009, Peter Haag
* Copyright (c) 2004-2008, SWITCH - Teleinformatikdienste fuer Lehre und Forschung
@ -28,18 +29,20 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $Author: haag $
*
* $Id: pcap_reader.h 39 2009-11-25 08:11:15Z haag $
*
* $LastChangedRevision: 39 $
*
*
*/
#ifndef _PCAP_READER_H
#define _PCAP_READER_H 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <sys/socket.h>
void setup_packethandler(char *fname, char *filter );
// ssize_t NextPacket(void *buffer, size_t buffer_size);

View File

@ -34,6 +34,10 @@
#ifndef _PROFILE_H
#define _PROFILE_H 1
#include "nftree.h"
#include "nffile.h"
#include "nfstatfile.h"
typedef struct profile_param_info_s {
struct profile_param_info_s *next;
int profiletype;

View File

@ -34,6 +34,8 @@
#ifndef _SFLOW_PROCESS_H
#define _SFLOW_PROCESS_H 1
#include "config.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>