summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/lib/printdstlistdata.c
blob: 8b55afdb57c7d93546a7a0d09a74ae313a215852 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 * Copyright (C) 2012 by Darren Reed.
 *
 * See the IPFILTER.LICENCE file for details on licencing.
 */

#include "ipf.h"
#include <ctype.h>


void
printdstlistdata(pool, opts)
	ippool_dst_t *pool;
	int opts;
{

	if ((opts & OPT_DEBUG) == 0) {
		if ((pool->ipld_flags & IPDST_DELETE) != 0)
			PRINTF("# ");
		PRINTF("pool ");
	} else {
		if ((pool->ipld_flags & IPDST_DELETE) != 0)
			PRINTF("# ");
		PRINTF("Name: %s\tRole: ", pool->ipld_name);
	}

	printunit(pool->ipld_unit);

	if ((opts & OPT_DEBUG) == 0) {
		PRINTF("/dstlist (name %s;", pool->ipld_name);
		if (pool->ipld_policy != IPLDP_NONE) {
			PRINTF(" policy ");
			printdstlistpolicy(pool->ipld_policy);
			putchar(';');
		}
		PRINTF(")\n");
	} else {
		putchar(' ');

		PRINTF("\tReferences: %d\n", pool->ipld_ref);
		if ((pool->ipld_flags & IPDST_DELETE) != 0)
			PRINTF("# ");
		PRINTF("Policy: \n");
		printdstlistpolicy(pool->ipld_policy);
		PRINTF("\n\tNodes Starting at %p\n", pool->ipld_dests);
	}
}
OpenPOWER on IntegriCloud