1145519Sdarrenr/* $FreeBSD$ */ 2145510Sdarrenr 3145510Sdarrenr/* 4255332Scy * Copyright (C) 2012 by Darren Reed. 5145510Sdarrenr * 6145510Sdarrenr * See the IPFILTER.LICENCE file for details on licencing. 7145510Sdarrenr */ 8145510Sdarrenr 9145510Sdarrenr#include "ipf.h" 10145510Sdarrenr 11145510Sdarrenr 12255332Scyip_pool_node_t * 13255332Scyprintpoolnode(np, opts, fields) 14255332Scy ip_pool_node_t *np; 15255332Scy int opts; 16255332Scy wordtab_t *fields; 17145510Sdarrenr{ 18255332Scy int i; 19145510Sdarrenr 20255332Scy if (fields != NULL) { 21255332Scy for (i = 0; fields[i].w_value != 0; i++) { 22255332Scy printpoolfield(np, IPLT_POOL, i); 23255332Scy if (fields[i + 1].w_value != 0) 24255332Scy printf("\t"); 25255332Scy } 26255332Scy printf("\n"); 27255332Scy } else if ((opts & OPT_DEBUG) == 0) { 28145510Sdarrenr putchar(' '); 29145510Sdarrenr if (np->ipn_info == 1) 30145510Sdarrenr PRINTF("! "); 31255332Scy printip(np->ipn_addr.adf_family, 32255332Scy (u_32_t *)&np->ipn_addr.adf_addr.in4); 33255332Scy printmask(np->ipn_addr.adf_family, 34255332Scy (u_32_t *)&np->ipn_mask.adf_addr); 35145510Sdarrenr } else { 36170268Sdarrenr PRINTF("\tAddress: %s%s", np->ipn_info ? "! " : "", 37145510Sdarrenr inet_ntoa(np->ipn_addr.adf_addr.in4)); 38255332Scy printmask(np->ipn_addr.adf_family, 39255332Scy (u_32_t *)&np->ipn_mask.adf_addr); 40255332Scy#ifdef USE_QUAD_T 41255332Scy PRINTF("\n\t\tHits %"PRIu64"\tBytes %"PRIu64"\tName %s\tRef %d\n", 42255332Scy np->ipn_hits, np->ipn_bytes, 43255332Scy np->ipn_name, np->ipn_ref); 44255332Scy#else 45255332Scy PRINTF("\n\t\tHits %lu\tBytes %lu\tName %s\tRef %d\n", 46255332Scy np->ipn_hits, np->ipn_bytes, 47255332Scy np->ipn_name, np->ipn_ref); 48255332Scy#endif 49145510Sdarrenr } 50145510Sdarrenr return np->ipn_next; 51145510Sdarrenr} 52