summaryrefslogtreecommitdiff
path: root/nest/a-set.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2008-11-08 23:33:22 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2008-11-08 23:33:22 +0100
commitaebe06b40ce730a88cc8a3121be1944b3ddf5765 (patch)
treead154b3ccaef4c816a8a325db7c5561aaf2d7586 /nest/a-set.c
parentb21f68b4cd4794c84e5f0eb2c34204c87ccf0e9a (diff)
Proper format functions for ORIGINATOR_ID, CLUSTER_LIST
Diffstat (limited to 'nest/a-set.c')
-rw-r--r--nest/a-set.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/nest/a-set.c b/nest/a-set.c
index 69c090b7..505c0e51 100644
--- a/nest/a-set.c
+++ b/nest/a-set.c
@@ -14,7 +14,7 @@
#include "lib/string.h"
void
-int_set_format(struct adata *set, byte *buf, unsigned int size)
+int_set_format(struct adata *set, int way, byte *buf, unsigned int size)
{
u32 *z = (u32 *) set->data;
int l = set->length / 4;
@@ -30,7 +30,14 @@ int_set_format(struct adata *set, byte *buf, unsigned int size)
strcpy(buf, "...");
return;
}
- buf += bsprintf(buf, "(%d,%d)", *z >> 16, *z & 0xffff);
+
+ if (way)
+ buf += bsprintf(buf, "(%d,%d)", *z >> 16, *z & 0xffff);
+ else
+ buf += bsprintf(buf, "%d.%d.%d.%d",
+ (*z >> 24) & 0xff, (*z >> 16) & 0xff,
+ (*z >> 8) & 0xff, *z & 0xff);
+
z++;
sp = 0;
}