/***********************************************************************
* *
* 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 flowtool type
*
* Glenn Fowler
* AT&T Research
*/
#include "flowlib.h"
#include <swap.h>
typedef struct ft1header
{
/* 2 for big endian (Motorolla) */
/* 1,5,7,8 - stream version 2 */
} Hdr_t;
typedef struct fts3rec_v1 {
} Rec_1_t;
/* note the v5 struct is a subset of v6 and v7. v6 and v7 are assumed
* to be in the same order so the engine_* src_mask, dst_mask, src_as and
* dst_as are in the same place. v5 is like a generic v5, v6, v7
*/
typedef struct fts3rec_v5 {
} Rec_5_t;
typedef struct fts3rec_v6 {
} Rec_6_t;
typedef struct fts3rec_v7 {
} Rec_7_t;
typedef struct State_s
{
char* data;
char* next;
int swap;
int version;
} State_t;
/*
* identf
*/
static int
{
char* dp;
char* ep;
int size;
int swap;
int type;
int version;
if (n < 4)
return 0;
return 0;
switch (h->byte_order)
{
case FT_BE:
swap = 0;
break;
case FT_LE:
swap = 7;
break;
default:
return 0;
}
switch (h->s_version)
{
case 1:
if (n < file->ident)
return 0;
break;
case 3:
if (n < 8)
return 0;
if (n < file->ident)
return 0;
version = 0;
{
dp += 2;
dp += 2;
break;
if (type == 2)
{
break;
}
}
break;
default:
return 0;
}
switch (version)
{
case 1:
case 5:
case 6:
case 7:
break;
default:
return 0;
}
return 1;
}
/*
* fopenf
*/
static int
{
{
return -1;
}
if (!(state = vmnewof(file->dss->vm, 0, State_t, 1, (file->flags & DSS_FILE_WRITE) ? NETFLOW_PACKET : 0)))
{
return -1;
}
{
case 1:
break;
case 5:
break;
case 6:
break;
case 7:
break;
}
return 0;
}
/*
* freadf
*/
static int
{
register char* fp;
size_t n;
{
{
break;
}
return 0;
{
return -1;
}
}
{
case 1:
{
swapmem(n, &R1(fp)->unix_secs, &R1(fp)->unix_secs, (char*)&R1(fp)->input - (char*)&R1(fp)->unix_secs);
if (n &= 1)
{
}
}
break;
case 5:
{
swapmem(n, &R5(fp)->unix_secs, &R5(fp)->unix_secs, (char*)&R5(fp)->input - (char*)&R5(fp)->unix_secs);
if (n &= 1)
{
}
}
break;
case 6:
{
swapmem(n, &R6(fp)->unix_secs, &R6(fp)->unix_secs, (char*)&R6(fp)->input - (char*)&R6(fp)->unix_secs);
if (n &= 1)
{
}
}
break;
case 7:
{
swapmem(n, &R7(fp)->unix_secs, &R7(fp)->unix_secs, (char*)&R7(fp)->input - (char*)&R7(fp)->unix_secs);
if (n &= 1)
{
}
}
break;
}
return 1;
}
/*
* fwritef
*/
static int
{
return -1;
}
/*
* fclosef
*/
static int
{
if (!state)
return -1;
return 0;
}
{
"flowtool",
"flowtool netflow format (2008-06-21)",
CXH,
0,
0,
0,
};