/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 2000-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> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
#include "ptvlib.h"
#define S "----------"
/*
* list table a stats on sp
*/
int
{
int i;
int n;
int pc;
int tc;
int bits;
unsigned char* v;
unsigned char* total_addresses;
unsigned char* total_prefixes;
unsigned char** addresses;
unsigned char** prefixes;
if (!(addresses = (unsigned char**)newof(0, unsigned char, (2 * (bits + 1)) * (sizeof(unsigned char*) + a->size), 0)))
{
return -1;
}
v = total_prefixes + a->size;
for (i = 0; i <= bits; i++)
{
addresses[i] = v;
v += a->size;
prefixes[i] = v;
v += a->size;
}
PTVSCAN(a, b,
{
}
);
for (i = n = 0; i <= bits; i++)
{
n++;
{
else
tc = 0;
}
else
tc = 0;
{
else
pc = 0;
}
else
pc = 0;
sfprintf(sp, "/%-3d %16s %16s %s%s\n", i, fmtfv(a->size, prefixes[i], 10, ',', 3), sizeof(S) - 1, fmtfv(a->size, addresses[i], 10, ',', 3), prt + sizeof(prt) - pc - 1, tot + sizeof(tot) - tc - 1);
}
sfprintf(sp, " %3d %s %s ranges %I*u entries %I*u\n", n, fmtfv(a->size, total_prefixes, 10, ',', 3), sizeof(S) - 1, fmtfv(a->size, total_addresses, 10, ',', 3), sizeof(Ptvcount_t), (Ptvcount_t)dtsize(a->dict), sizeof(a->entries), a->entries);
}