summaryrefslogtreecommitdiff
path: root/nest/a-set.c
diff options
context:
space:
mode:
Diffstat (limited to 'nest/a-set.c')
-rw-r--r--nest/a-set.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/nest/a-set.c b/nest/a-set.c
index 40ed573c..e84d7058 100644
--- a/nest/a-set.c
+++ b/nest/a-set.c
@@ -34,7 +34,7 @@
* the buffer to indicate truncation.
*/
int
-int_set_format(const struct adata *set, int way, int from, byte *buf, uint size)
+int_set_format(const struct adata *set, enum isf_way way, int from, byte *buf, uint size)
{
u32 *z = (u32 *) set->data;
byte *end = buf + size - 24;
@@ -56,10 +56,18 @@ int_set_format(const struct adata *set, int way, int from, byte *buf, uint size)
if (i > from2)
*buf++ = ' ';
- if (way)
- buf += bsprintf(buf, "(%d,%d)", z[i] >> 16, z[i] & 0xffff);
- else
- buf += bsprintf(buf, "%R", z[i]);
+ switch (way)
+ {
+ case ISF_COMMUNITY_LIST:
+ buf += bsprintf(buf, "(%d,%d)", z[i] >> 16, z[i] & 0xffff);
+ break;
+ case ISF_ROUTER_ID:
+ buf += bsprintf(buf, "%R", z[i]);
+ break;
+ case ISF_NUMBERS:
+ buf += bsprintf(buf, "%u", z[i]);
+ break;
+ }
}
*buf = 0;
return 0;