/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 2002-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* netflow dump type
*
* Glenn Fowler
* AT&T Research
*/
#include "flowlib.h"
#define FLOW_TEMPLATE 0
/*
* identf
*/
static int
{
register unsigned char* b = buf;
}
/*
* fopenf
*/
static int
{
if (!(pp = vmnewof(file->vm, 0, Netflow_file_t, 1, (file->flags & DSS_FILE_WRITE) ? NETFLOW_PACKET : 0)))
{
return -1;
}
return 0;
}
/*
* freadf
*/
static int
{
int n;
int m;
int k;
int z;
int o;
{
}
else
{
for (;;)
{
{
{
goto incomplete;
return 0;
}
goto corrupt;
sfprintf(sfstderr, "header version %d size %d flowsets %d offset %I*d\n", rp->version, 20, pp->count, sizeof(file->offset), file->offset);
}
{
continue;
}
if (n > FLOW_META)
{
{
(*disc->errorf)(NiL, disc, 1, "%s%d: undefined template -- flowset ignored", cxlocation(file->dss->cx, record), n);
continue;
}
/* HERE: add an options indicator to the record schema instead of discarding? */
{
continue;
}
break;
}
if (n == FLOW_TEMPLATE)
{
{
break;
if (tp)
{
return -1;
}
else
{
}
o = 0;
while (m--)
{
if (n >= 1 && n <= NETFLOW_TEMPLATE)
{
sfprintf(sfstderr, "template %2d field %2d type %2d size %2d offset %3d\n", tp->id, n, fp->type, fp->size, fp->offset);
}
}
}
}
else if (n == FLOW_OPTION)
{
{
if (tp)
{
return -1;
}
else
{
}
o = 0;
while (m--)
{
o += z;
}
while (k--)
{
if (n >= 1 && n <= NETFLOW_TEMPLATE)
{
sfprintf(sfstderr, "template %2d field %2d type %2d size %2d offset %3d\n", tp->id, n, fp->type, fp->size, fp->offset);
}
o += z;
}
}
}
else
{
(*disc->errorf)(NiL, disc, 1, "%s%d: template index %d definition ignored", cxlocation(file->dss->cx, record), n);
}
}
}
return 1;
return -1;
return -1;
}
/*
* fwritef
*/
static int
{
return -1;
}
/*
* fclosef
*/
static int
{
return 0;
}
{
"dumpv9",
"Cisco netflow v9 dump format (2008-12-10) flow templates are retained across input files",
CXH,
0,
0,
0,
};