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