bgp-fixed.c revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
/***********************************************************************
* *
* 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
/*
* bgp fixed method
*
* Glenn Fowler
* AT&T Research
*/
#include "bgplib.h"
#include <magicid.h>
#define MAGIC_NAME "bgp"
#define MAGIC_TYPE "router"
#define MAGIC_VERSION 20020311L
typedef union Fixedheader_u
{
typedef struct Fixedstate_s
{
int swap;
} Fixedstate_t;
/*
* fixed identf
*/
static int
{
int swap;
if (n >= sizeof(Bgproute_t) &&
{
return 1;
}
return 0;
}
/*
* fixed file openf
*/
static int
{
{
{
return -1;
}
{
return -1;
}
}
{
}
return 0;
}
/*
* fixed readf
*/
static int
{
register Bgproute_t* rp;
{
{
return -1;
}
return 0;
}
{
swapmem(state->swap, rp->data + rp->cluster.offset, rp->data + rp->cluster.offset, rp->cluster.size * sizeof(Bgpnum_t));
{
swapmem(state->swap & 1, rp->data + rp->path.offset, rp->data + rp->path.offset, rp->path.size * sizeof(Bgpasn_t));
swapmem(state->swap & 1, rp->data + rp->community.offset, rp->data + rp->community.offset, rp->community.size * sizeof(Bgpasn_t));
}
}
return 1;
}
/*
* fixed writef
*/
static int
{
{
return -1;
}
return 0;
}
/*
* fixed closef
*/
static int
{
return -1;
return 0;
}
{
"fixed",
"bgp fixed format (2007-09-27) compresses well with pzip(1)",
CXH,
0,
0,
0,
};