xref: /netbsd-src/external/bsd/ipf/dist/lib/printdstlistdata.c (revision c9d5dc6c77aa32fd07899a7a63638e95ffa433dd)
1*c9d5dc6cSdarrenr /*	$NetBSD: printdstlistdata.c,v 1.1.1.2 2012/07/22 13:44:40 darrenr Exp $	*/
2bc4097aaSchristos 
3bc4097aaSchristos /*
4*c9d5dc6cSdarrenr  * Copyright (C) 2012 by Darren Reed.
5bc4097aaSchristos  *
6bc4097aaSchristos  * See the IPFILTER.LICENCE file for details on licencing.
7bc4097aaSchristos  */
8bc4097aaSchristos 
9bc4097aaSchristos #include "ipf.h"
10bc4097aaSchristos #include <ctype.h>
11bc4097aaSchristos 
12bc4097aaSchristos 
13bc4097aaSchristos void
printdstlistdata(pool,opts)14bc4097aaSchristos printdstlistdata(pool, opts)
15bc4097aaSchristos 	ippool_dst_t *pool;
16bc4097aaSchristos 	int opts;
17bc4097aaSchristos {
18bc4097aaSchristos 
19bc4097aaSchristos 	if ((opts & OPT_DEBUG) == 0) {
20bc4097aaSchristos 		if ((pool->ipld_flags & IPDST_DELETE) != 0)
21bc4097aaSchristos 			PRINTF("# ");
22bc4097aaSchristos 		PRINTF("pool ");
23bc4097aaSchristos 	} else {
24bc4097aaSchristos 		if ((pool->ipld_flags & IPDST_DELETE) != 0)
25bc4097aaSchristos 			PRINTF("# ");
26bc4097aaSchristos 		PRINTF("Name: %s\tRole: ", pool->ipld_name);
27bc4097aaSchristos 	}
28bc4097aaSchristos 
29bc4097aaSchristos 	printunit(pool->ipld_unit);
30bc4097aaSchristos 
31bc4097aaSchristos 	if ((opts & OPT_DEBUG) == 0) {
32bc4097aaSchristos 		PRINTF("/dstlist (name %s;", pool->ipld_name);
33bc4097aaSchristos 		if (pool->ipld_policy != IPLDP_NONE) {
34bc4097aaSchristos 			PRINTF(" policy ");
35bc4097aaSchristos 			printdstlistpolicy(pool->ipld_policy);
36bc4097aaSchristos 			putchar(';');
37bc4097aaSchristos 		}
38*c9d5dc6cSdarrenr 		PRINTF(")\n");
39bc4097aaSchristos 	} else {
40bc4097aaSchristos 		putchar(' ');
41bc4097aaSchristos 
42bc4097aaSchristos 		PRINTF("\tReferences: %d\n", pool->ipld_ref);
43bc4097aaSchristos 		if ((pool->ipld_flags & IPDST_DELETE) != 0)
44bc4097aaSchristos 			PRINTF("# ");
45bc4097aaSchristos 		PRINTF("Policy: \n");
46bc4097aaSchristos 		printdstlistpolicy(pool->ipld_policy);
47bc4097aaSchristos 		PRINTF("\n\tNodes Starting at %p\n", pool->ipld_dests);
48bc4097aaSchristos 	}
49bc4097aaSchristos }
50