From ac9299abd0f9df15d52f19cf5c670ea88ba8e05c Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 26 Apr 2006 11:48:47 +0200 Subject: [PATCH] The addrmask type has its own dumper now. --- lib/ipaccess.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/ipaccess.c b/lib/ipaccess.c index 3323d0a7..b152136c 100644 --- a/lib/ipaccess.c +++ b/lib/ipaccess.c @@ -10,6 +10,7 @@ #include "lib/lib.h" #include "lib/clists.h" #include "lib/conf2.h" +#include "lib/fastbuf.h" #include "lib/ipaccess.h" #include @@ -25,7 +26,8 @@ struct ipaccess_entry { struct addrmask addr; }; -static byte *addrmask_parser(byte *c, void *ptr) +static byte * +addrmask_parser(byte *c, void *ptr) { /* * This is tricky: addrmasks will be compared by memcmp(), so we must ensure @@ -53,9 +55,17 @@ static byte *addrmask_parser(byte *c, void *ptr) return NULL; } +static void +addrmask_dumper(struct fastbuf *fb, void *ptr) +{ + struct addrmask *am = ptr; + bprintf(fb, "%08x/%08x ", am->addr, am->mask); +} + static struct cf_user_type addrmask_type = { .size = sizeof(struct addrmask), - .parser = addrmask_parser + .parser = addrmask_parser, + .dumper = addrmask_dumper }; struct cf_section ipaccess_cf = { -- 2.39.2