]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/ipfilter/lib/print_toif.c
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / ipfilter / lib / print_toif.c
1 /*      $FreeBSD$       */
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
14 void print_toif(tag, fdp)
15 char *tag;
16 frdest_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 }