1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Printing of AS paths and community sets.

This commit is contained in:
Martin Mares
2000-04-17 10:18:55 +00:00
parent afc54517db
commit c6add07fa6
5 changed files with 100 additions and 10 deletions

View File

@@ -9,4 +9,32 @@
#include "nest/bird.h"
#include "nest/route.h"
#include "nest/attrs.h"
#include "lib/resource.h"
#include "lib/string.h"
void
int_set_format(struct adata *set, byte *buf, unsigned int size)
{
u32 *z = (u32 *) set->data;
int l = set->length / 4;
int sp = 1;
byte *end = buf + size - 16;
while (l--)
{
if (sp)
{
sp = 0;
*buf++ = ' ';
}
if (buf > end)
{
strcpy(buf, "...");
return;
}
buf += bsprintf(buf, "%d:%d", *z/65536, *z & 0xffff);
z++;
}
*buf = 0;
}