print_toif.c revision 170268
1/* $FreeBSD: head/contrib/ipfilter/lib/print_toif.c 170268 2007-06-04 02:54:36Z darrenr $ */ 2 3/* 4 * Copyright (C) 2000-2002 by Darren Reed. 5 * 6 * See the IPFILTER.LICENCE file for details on licencing. 7 * 8 * $Id: print_toif.c,v 1.8.4.1 2006/06/16 17:21:09 darrenr Exp $ 9 */ 10 11#include "ipf.h" 12 13 14void print_toif(tag, fdp) 15char *tag; 16frdest_t *fdp; 17{ 18 printf("%s %s%s", tag, fdp->fd_ifname, 19 (fdp->fd_ifp || (long)fdp->fd_ifp == -1) ? "" : "(!)"); 20#ifdef USE_INET6 21 if (use_inet6 && IP6_NOTZERO(&fdp->fd_ip6.in6)) { 22 char ipv6addr[80]; 23 24 inet_ntop(AF_INET6, &fdp->fd_ip6, ipv6addr, 25 sizeof(fdp->fd_ip6)); 26 printf(":%s", ipv6addr); 27 } else 28#endif 29 if (fdp->fd_ip.s_addr) 30 printf(":%s", inet_ntoa(fdp->fd_ip)); 31 putchar(' '); 32} 33