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