Commit 47b23f5d authored by Olav Kvittem's avatar Olav Kvittem

initiell

parents
This a fix to libipfix for automatic log file rotation with date/time.
please find a diff towards the original and the modified source tree.
This diff is collapsed.
ChangeLog for libipfix
Version 1.0
+ update of IE definitions
- fixes
Version 0.8.1 (2007-02-28)
+ update to draft-ietf-ipfix-info-15.txt
+ update psamp ies to draft-ietf-psamp-info-05.txt
+ basic TLS support (experimental)
- nf9 export fixed
- sending tcp/sctp templates updated.
- fixes
Version 0.8 (2006-12-18)
+ update to draft-ietf-ipfix-info-14.txt
+ ipfix probe added
+ libmisc updated
- make install fixed (reported by Thomas Hirsch)
- resend templates via udp
- resend templates after tcp reconnect fixed
- use sctp stream zero to send templates
- uint8 coding fixed
- ipfix header sequence no. counts data records
- fixes
Version 0.7 (2006-09-06)
+ update to draft-ietf-ipfix-info-12.txt
+ add psamp IEs draft-ietf-psamp-info-04.txt
+ collector uses exporter ipaddr plus observ. domain id to differ input streams
+ db export: change column names to ieENO_ID
+ db export: prefix template table names with 'ipfix_data_'
+ db export: write octet arrays as binary data
+ describe database layout in howto document
- fixes
Version 0.6 (2006-04-22)
+ support float32/float64 IEs
- send ipfix messages via tcp fixed (reported by Luca Deri)
- fixes to compile on OpenBSD
- send option data fixed
+ howto document added
Version 0.5 (2005-12-19)
+ update to draft-ietf-ipfix-info-11.txt
+ FOKUS IEs updated
+ ipfix message logging revised
+ collector now can start and stop export
to file, database (mysql) or screen (=message logging)
+ new func to generate template identifier
+ example exporter supports protocol parameter
to export via tcp, udp or sctp
- fixes
Version 0.4 (2005-08-03)
+ update to draft-ietf-ipfix-info-09.txt
+ example collector sctp support
+ collector marks scope fields
- some fixes
Version 0.3 (2005-07-08)
+ update to draft-ietf-ipfix-info-07.txt
+ collector processes unknown IEs
- export of unknown IEs disabled
- lots of fixes
Version 0.2 (2005-04-22)
= first release
+ rudimentary sctp protocol support
- fixes
Version 0.1 (2004-12-22)
= libipfix imported from openimp package
+ support tcp and udp protocol
+ support ipv4 and ipv6
+ collector exports to file or database
libipfix - a library which provides an implementation of the IPFIX protocol
for flexible flow data support. IPFIX is the successor of NetFlow v9
(see http://www.ietf.org/dyn/wg/charter/ipfix-charter.html and
RFC5101 and RFC5102 for details)
Copyright (c) 2005-2010, Fraunhofer FOKUS
All rights reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License along with
this program; if not, see <http://www.gnu.org/licenses/>.
prerequisites:
- libmysqlclient (only needed to build a collector which
stores results data into a mysql database)
- libpcap (only needed to build the IPFIX probe)
To build libipfix, run "./configure" (a shell script). The configure
script will determine your system attributes and generate
appropriate makefiles from Makefile.in. Next run "make". If everything
goes well you can run "make install".
example:
./configure --enable-ipv6 --prefix=/usr/local
make
make install
To compile the example programs:
cd examples
make
#
#
# $Id: Makefile.in,v 1.2 2005/01/04 09:25:12 luz Exp $
#
# Makefile
SHELL = /bin/bash
top_srcdir = .
prefix = /usr/local
SUBDIRS = lib libmisc examples collector probe
all: compile
rmtarget clean distclean:
@ for DIR in $(SUBDIRS) ; \
do \
( \
cd ./$$DIR; $(MAKE) $@; \
); \
done
compile:
@ for DIR in $(SUBDIRS) ; \
do \
( \
cd ./$$DIR; $(MAKE); \
); \
done
install:
@ for DIR in $(SUBDIRS) ; \
do \
( \
cd ./$$DIR; $(MAKE) $@; \
); \
done
#
#
# $Id: Makefile.in,v 1.2 2005/01/04 09:25:12 luz Exp $
#
# Makefile
SHELL = @SHELL@
top_srcdir = @top_srcdir@
prefix = @prefix@
SUBDIRS = lib libmisc examples collector probe
all: compile
rmtarget clean distclean:
@ for DIR in $(SUBDIRS) ; \
do \
( \
cd ./$$DIR; $(MAKE) $@; \
); \
done
compile:
@ for DIR in $(SUBDIRS) ; \
do \
( \
cd ./$$DIR; $(MAKE); \
); \
done
install:
@ for DIR in $(SUBDIRS) ; \
do \
( \
cd ./$$DIR; $(MAKE) $@; \
); \
done
libipfix 1.0
This package contains source code for a library to export and
collect IPFIX measurement and accounting data.
The library is complemented with an IPFIX collector and
a basic IPFIX probe.
The library supports IPFIX (draft-ietf-ipfix-protocol-24.txt,
draft-ietf-ipfix-info-15.txt, draft-ietf-psamp-info-05.txt)
and Netflow9 (RFC 3954) using TCP, UDP and SCTP as transport protocol.
There are some small example programs containing code that
demonstrates how to use the library.
Find a howto under: http://ants.fokus.fraunhofer.de/libipfix/docs.php
You can download the current version under:
http://ants.fokus.fraunhofer.de/libipfix/downloads.php
Please send inquiries/comments/reports to mark@fokus.fraunhofer.de
#
#
# $Id: Makefile.in,v 1.4 2006/12/20 10:12:44 luz Exp $
#
# Makefile
SHELL = /bin/bash
srcdir = .
top_srcdir = ..
prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
libexecdir = ${exec_prefix}/libexec
datadir = ${datarootdir}
datarootdir = ${prefix}/share
libdir = ${exec_prefix}/lib
mandir = ${datarootdir}/man
includedir = ${prefix}/include
oldincludedir = /usr/include
top_builddir = .
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL}
INSTALL_HEADER = $(INSTALL_DATA)
CC = gcc
EXEEXT =
OBJEXT = o
PACKAGE = libipfix
VERSION = 1.0
install_sh = @install_sh@
DEFS = -DHAVE_CONFIG_H
CPPFLAGS = -DDBSUPPORT
LDFLAGS =
LIBS = -lmysqlclient -L../lib -L../libmisc -lipfix -lmisc
CCOPT = -Wall -g
INCLS = -I. -I.. -I../lib -I../libmisc
CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
TARGETS = ipfix_collector
OBJS = collector.o
CLEANFILES = $(OBJS) $(TARGETS)
all: $(TARGETS)
clean:
rm -f $(CLEANFILES)
distclean:
rm -f $(CLEANFILES) Makefile
install: $(TARGETS)
[ -d $(bindir) ] || \
(mkdir -p $(bindir); chmod 755 $(bindir))
$(INSTALL_PROGRAM) $(TARGETS) $(bindir)
ipfix_collector: collector.o Makefile ../lib/libipfix.a
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ collector.o $(LDFLAGS) $(LIBS)
collector.o: collector.c Makefile
$(CC) $(CFLAGS) $(CPPFLAGS) -c collector.c
#
#
# $Id: Makefile.in,v 1.4 2006/12/20 10:12:44 luz Exp $
#
# Makefile
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
datarootdir = @datarootdir@
libdir = @libdir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
top_builddir = .
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
CC = @CC@
EXEEXT = @EXEEXT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE_NAME@
VERSION = @PACKAGE_VERSION@
install_sh = @install_sh@
DEFS = @DEFS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@ @MYSQLLIBS@ @SCTPLIBS@ @SSLLIBS@ -L../lib -L../libmisc -lipfix -lmisc
CCOPT = -Wall -g
INCLS = -I. -I.. -I../lib -I../libmisc
CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
TARGETS = ipfix_collector
OBJS = collector.o
CLEANFILES = $(OBJS) $(TARGETS)
all: $(TARGETS)
clean:
rm -f $(CLEANFILES)
distclean:
rm -f $(CLEANFILES) Makefile
install: $(TARGETS)
[ -d $(bindir) ] || \
(mkdir -p $(bindir); chmod 755 $(bindir))
$(INSTALL_PROGRAM) $(TARGETS) $(bindir)
ipfix_collector: collector.o Makefile
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ collector.o $(LDFLAGS) $(LIBS)
collector.o: collector.c Makefile
$(CC) $(CFLAGS) $(CPPFLAGS) -c collector.c
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File Edit Options Buffers Tools C Help
{
if ( s->fp ) {
fprintf( s->fp, "#hdr: v%d, ", hdr->version );
if ( hdr->version == IPFIX_VERSION_NF9 ) {
fprintf( s->fp, "%.3f, %lu, ",
(double)(hdr->u.nf9.sysuptime)/1000.0,
(u_long)hdr->u.nf9.unixtime );
}
else {
fprintf( s->fp, "%lu, ",
(u_long)hdr->u.ipfix.exporttime );
}
fprintf( s->fp, "%lu\n", (u_long)hdr->seqno );
}
return 0;
}
static int export_trecord_file( ipfixs_node_t *s, ipfixt_node_t *t, void *arg )
{
char tmpbuf[2000];
int i, nbytes;
printf("time: %lu\n",
if ( s->fp ) {
sprintf( tmpbuf, "#%stemplate: %d",
(t->ipfixt->nscopefields)?"option ":"",
t->ipfixt->tid );
for ( i=0; i<t->ipfixt->nfields; i++ ) {
nbytes = strlen(tmpbuf);
snprintf( tmpbuf+nbytes, sizeof(tmpbuf)-nbytes, ", %d%s(%s:%d)",
t->ipfixt->fields[i].elem->ft->ftype,
(i<t->ipfixt->nscopefields)?"s":"",
t->ipfixt->fields[i].elem->ft->name,
t->ipfixt->fields[i].flength );
}
fprintf( s->fp, "%s\n", tmpbuf );
fflush( s->fp );
}
return 0;
}
static int export_drecord_file( ipfixs_node_t *s,
ipfixt_node_t *t,
ipfix_datarecord_t *data,
void *arg )
{
char tmpbuf[2000];
int i, nbytes;
if ( s->fp ) {
----:**-F1 ipfix_col_files.c (C Abbrev)--L125--47%--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Auto-saving...done
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1
/* Define to 1 if you have the `basename' function. */
#define HAVE_BASENAME 1
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
/* #undef HAVE_DOPRNT */
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `gethostbyname' function. */
#define HAVE_GETHOSTBYNAME 1
/* Define to 1 if you have the <getopt.h> header file. */
#define HAVE_GETOPT_H 1
/* Define to 1 if you have the `getopt_long' function. */
#define HAVE_GETOPT_LONG 1
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* Define to 1 if you have the `hstrerror' function. */
#define HAVE_HSTRERROR 1
/* Define to 1 if you have the `inet_ntoa' function. */
#define HAVE_INET_NTOA 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <libgen.h> header file. */
#define HAVE_LIBGEN_H 1
/* Define to 1 if you have the `nsl' library (-lnsl). */
/* #undef HAVE_LIBNSL */
/* Define to 1 if you have the `resolv' library (-lresolv). */
/* #undef HAVE_LIBRESOLV */
/* Define to 1 if you have the `socket' library (-lsocket). */
/* #undef HAVE_LIBSOCKET */
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
/* Define to 1 if you have the `mkdir' function. */
#define HAVE_MKDIR 1
/* Define to 1 if you have the <netdb.h> header file. */
#define HAVE_NETDB_H 1
/* Define to 1 if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1
/* Define to 1 if you have the `pcap_breakloop' function. */
#define HAVE_PCAP_BREAKLOOP 1
/* Define to 1 if you have the `pcap_freecode' function. */
#define HAVE_PCAP_FREECODE 1
/* Define to 1 if you have the `select' function. */
#define HAVE_SELECT 1
/* Define to 1 if you have the `setsockopt' function. */
#define HAVE_SETSOCKOPT 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the `strftime' function. */
#define HAVE_STRFTIME 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `vprintf' function. */
#define HAVE_VPRINTF 1
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME "libipfix"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libipfix 1.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libipfix"
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.0"
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
/* Define to the type of arg 1 for `select'. */
#define SELECT_TYPE_ARG1 int
/* Define to the type of args 2, 3 and 4 for `select'. */
#define SELECT_TYPE_ARG234 (fd_set *)
/* Define to the type of arg 5 for `select'. */
#define SELECT_TYPE_ARG5 (struct timeval *)
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */
/* #undef volatile */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Define to 1 if you have the `basename' function. */
#undef HAVE_BASENAME
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `gethostbyname' function. */
#undef HAVE_GETHOSTBYNAME
/* Define to 1 if you have the <getopt.h> header file. */
#undef HAVE_GETOPT_H
/* Define to 1 if you have the `getopt_long' function. */
#undef HAVE_GETOPT_LONG
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define to 1 if you have the `hstrerror' function. */
#undef HAVE_HSTRERROR
/* Define to 1 if you have the `inet_ntoa' function. */
#undef HAVE_INET_NTOA
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <libgen.h> header file. */
#undef HAVE_LIBGEN_H
/* Define to 1 if you have the `nsl' library (-lnsl). */
#undef HAVE_LIBNSL
/* Define to 1 if you have the `resolv' library (-lresolv). */
#undef HAVE_LIBRESOLV
/* Define to 1 if you have the `socket' library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have the `mkdir' function. */
#undef HAVE_MKDIR
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Define to 1 if you have the `pcap_breakloop' function. */
#undef HAVE_PCAP_BREAKLOOP
/* Define to 1 if you have the `pcap_freecode' function. */
#undef HAVE_PCAP_FREECODE
/* Define to 1 if you have the `select' function. */
#undef HAVE_SELECT
/* Define to 1 if you have the `setsockopt' function. */
#undef HAVE_SETSOCKOPT
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the `strftime' function. */
#undef HAVE_STRFTIME
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H