2 * Copyright (C) 2002 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
6 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
7 * Use is subject to license terms.
10 #pragma ident "%Z%%M% %I% %E% SMI"
14 #define PRINTF (void)printf
15 #define FPRINTF (void)fprintf
17 ip_pool_t
*printpool(pp
, copyfunc
, name
, opts
)
23 ip_pool_node_t
*ipnp
, *ipnpn
, ipn
;
26 if ((*copyfunc
)(pp
, &ipp
, sizeof(ipp
)))
29 if ((name
!= NULL
) && strncmp(name
, ipp
.ipo_name
, FR_GROUPLEN
))
32 if ((opts
& OPT_DEBUG
) == 0) {
33 if ((ipp
.ipo_flags
& IPOOL_ANON
) != 0)
34 PRINTF("# 'anonymous' tree %s\n", ipp
.ipo_name
);
35 PRINTF("table role = ");
37 PRINTF("Name: %s", ipp
.ipo_name
);
38 if ((ipp
.ipo_flags
& IPOOL_ANON
) == IPOOL_ANON
)
71 printf("unknown(%d)", ipp
.ipo_unit
);
74 if ((opts
& OPT_DEBUG
) == 0) {
75 PRINTF(" type = tree number = %s\n", ipp
.ipo_name
);
80 PRINTF("\tReferences: %d\tHits: %lu\n", ipp
.ipo_ref
,
82 PRINTF("\tNodes Starting at %p\n", ipp
.ipo_list
);
87 while (ipnpn
!= NULL
) {
88 ipnp
= (ip_pool_node_t
*)malloc(sizeof(*ipnp
));
89 (*copyfunc
)(ipnpn
, ipnp
, sizeof(ipn
));
90 ipnpn
= ipnp
->ipn_next
;
91 ipnp
->ipn_next
= ipp
.ipo_list
;
95 if (ipp
.ipo_list
== NULL
) {
98 for (ipnp
= ipp
.ipo_list
; ipnp
!= NULL
; ) {
99 ipnp
= printpoolnode(ipnp
, opts
);
101 if ((opts
& OPT_DEBUG
) == 0) {
107 if ((opts
& OPT_DEBUG
) == 0)