Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / cmd / ipf / lib / common / print_toif.c
blob54916520c50ca9f3b48e3e9d5f23ebbf2ae9830b
1 /*
2 * Copyright (C) 1993-2001 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
6 * $Id: print_toif.c,v 1.8 2002/01/28 06:50:47 darrenr Exp $
8 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
9 * Use is subject to license terms.
12 #pragma ident "%Z%%M% %I% %E% SMI"
14 #include "ipf.h"
17 void print_toif(tag, fdp)
18 char *tag;
19 frdest_t *fdp;
21 printf("%s %s", tag, fdp->fd_ifname);
22 if (opts & OPT_UNDEF) {
23 if (!fdp->fd_ifp)
24 printf("(!)");
26 #ifdef USE_INET6
27 if (use_inet6 && IP6_NOTZERO(&fdp->fd_ip6.in6)) {
28 char ipv6addr[INET6_ADDRSTRLEN];
30 inet_ntop(AF_INET6, &fdp->fd_ip6, ipv6addr,
31 sizeof(ipv6addr));
32 printf(":%s", ipv6addr);
33 } else
34 #endif
35 if (fdp->fd_ip.s_addr)
36 printf(":%s", inet_ntoa(fdp->fd_ip));
37 putchar(' ');