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