[netflow-tools] C flowd log example

Guyon Morée guyon.moree at gmail.com
Wed Jul 19 19:41:13 EST 2006


On 7/19/06, Guyon Morée <guyon.moree at gmail.com> wrote:
> Thanx Damien,
>
> When I try to make flowd i get this error:
>
> [guyon at geek]~/flowread/flowd
> $ make
> gcc -g -O2 -fPIC -c flowd.c
> flowd.c: In function `usage':
> flowd.c:1381: error: `PROGVER' undeclared (first use in this function)
> flowd.c:1381: error: (Each undeclared identifier is reported only once
> flowd.c:1381: error: for each function it appears in.)
> flowd.c:1386: error: `SYSCONFDIR' undeclared (first use in this function)
> flowd.c:1386: error: syntax error before string constant
> flowd.c: In function `main':
> flowd.c:1396: error: `SYSCONFDIR' undeclared (first use in this function)
> flowd.c:1396: error: syntax error before string constant
> *** Error code 1
>
> Stop in /home/guyon/flowread/flowd.
>
> I ran ./configure before this.
>
> Any idea whats going on?
>
> thanx again,
>
>
>
>
> On 7/19/06, Damien Miller <djm at mindrot.org> wrote:
> > On Tue, 18 Jul 2006, Guyon Morée wrote:
> >
> > > Hi all,
> > >
> > > I'm looking for a a simple example on how to read the flowd logfile,
> > > using the C header included. Als I notice 2 header files, store.h and
> > > store-v2.h.
> > >
> > > Which one should i use and how?
> >
> > store.h is the one you should use for new applications. store-v2.h is
> > the legacy log format. It defines a couple of APIs that you can use
> > to read flows:
> >
> > - A FILE* oriented API: store_read_flow() and store_write_flow().
> >   This is probably the easiest to use, as stdio will take care of
> >   buffering, etc. Note that these do not try to back out cleanly
> >   when a write error occurs, so they are better suited to reading
> >   than writing.
> >
> > - A file-descriptor oriented API: store_get_flow() and store_put_flow().
> >   These don't do any buffering, but they will back out a failed write.
> >
> > - Direct serialisation and deserialisation of flow records to/from
> >   memory buffers: store_flow_deserialise(), store_flow_serialise(),
> >   store_flow_serialise_masked(), store_calc_flow_len(). You might want
> >   to use these if you need to store binary flow records though something
> >   other than a file descriptor or FILE*, such as sending or receiving
> >   flow records over a Unix domain socket, passing them via shared memory
> >   or storing them in a database.
> >
> > Most of these functions take a error buffer (and length) in which they
> > store an error message on failure.
> >
> > flowd-reader.c is a pretty good example of how to use the file-descriptor
> > API.
> >
> > -d
> >
> >
> >
> >
> >
> >
>
>
> --
> Guyon Morée
> guyon.moree at gmail.com
> http://gumuz.looze.net
>


-- 
Guyon Morée
guyon.moree at gmail.com
http://gumuz.looze.net



More information about the netflow-tools mailing list