1 /* $FreeBSD$ */ 2 3 /* 4 * Copyright (C) 2012 by Darren Reed. 5 * 6 * See the IPFILTER.LICENCE file for details on licencing. 7 * 8 * $Id$ 9 */ 10 #include "ipf.h" 11 #include "kmem.h" 12 13 14 void 15 printfraginfo(char *prefix, struct ipfr *ifr) 16 { 17 frentry_t fr; 18 int family; 19 20 PRINTF("%s", prefix); 21 if (ifr->ipfr_v == 6) { 22 PRINTF("inet6"); 23 family = AF_INET6; 24 } else { 25 PRINTF("inet"); 26 family = AF_INET; 27 } 28 fr.fr_flags = 0xffffffff; 29 30 PRINTF(" %s -> ", hostname(family, &ifr->ipfr_src)); 31 /* 32 if (kmemcpy((char *)&fr, (u_long)ifr->ipfr_rule, 33 sizeof(fr)) == -1) 34 return; 35 */ 36 PRINTF("%s id %x ttl %lu pr %d pkts %u bytes %u seen0 %d ref %d\n", 37 hostname(family, &ifr->ipfr_dst), ifr->ipfr_id, 38 ifr->ipfr_ttl, ifr->ipfr_p, ifr->ipfr_pkts, ifr->ipfr_bytes, 39 ifr->ipfr_seen0, ifr->ipfr_ref); 40 } 41