/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 2002-2012 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 table method
*
* Glenn Fowler
* AT&T Research
*/
#include "bgplib.h"
typedef struct Tablestate_s
{
int index;
int v6;
} Tablestate_t;
/*
* table identf
*/
static int
{
register char* s;
register char* e;
register char* f;
register int c;
unsigned char bits;
s = (char*)buf;
e = s + n;
for (;;)
{
for (;;)
{
if (s >= e)
return 0;
c = *s++;
if (!isascii(c))
return 0;
if (!isspace(c))
break;
}
f = s - 1;
for (;;)
{
if (s >= e)
return 0;
c = *s++;
if (!isascii(c))
return 0;
if (c == '\n')
break;
}
if (isdigit(*f) && !strtoip4(f, NiL, &addr, &bits) || !strtoip6(f, NiL, prefix, prefix + IP6BITS) && (file->caller = file))
break;
}
return 1;
}
/*
* table openf
*/
static int
{
{
return -1;
}
return 0;
}
/*
* table readf
*/
static int
{
register char* s;
char* p;
char* e;
for (;;)
{
return 0;
while (*s == ' ' || *s == '\t' || *s == '\r')
s++;
if (*s == 0 || *s == '#' || *s == '\n')
continue;
{
break;
for (s = p; *s == ' ' || *s == '\t'; s++);
switch (*p)
{
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
case ':':
{
}
break;
case '.':
break;
/*FALLTHROUGH*/
default:
{
}
break;
}
continue;
continue;
}
else
{
break;
for (s = p; *s == ' ' || *s == '\t'; s++);
{
}
continue;
}
return 1;
}
return 0;
}
/*
* table writef
*/
static int
{
{
case BGP_internal|BGP_valid:
break;
default:
return 0;
}
else
{
return -1;
}
return 0;
}
/*
* table closef
*/
static int
{
return -1;
return 0;
}
{
"table",
"simple table format (2008-06-20) with prefix mask and optional next hop",
CXH,
0,
0,
0,
};