1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * Copyright (C) 1993-2001 by Darren Reed. 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * See the IPFILTER.LICENCE file for details on licencing. 5*0Sstevel@tonic-gate * 6*0Sstevel@tonic-gate * $Id: print_toif.c,v 1.8 2002/01/28 06:50:47 darrenr Exp $ 7*0Sstevel@tonic-gate * 8*0Sstevel@tonic-gate * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 9*0Sstevel@tonic-gate * Use is subject to license terms. 10*0Sstevel@tonic-gate */ 11*0Sstevel@tonic-gate 12*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 13*0Sstevel@tonic-gate 14*0Sstevel@tonic-gate #include "ipf.h" 15*0Sstevel@tonic-gate 16*0Sstevel@tonic-gate 17*0Sstevel@tonic-gate void print_toif(tag, fdp) 18*0Sstevel@tonic-gate char *tag; 19*0Sstevel@tonic-gate frdest_t *fdp; 20*0Sstevel@tonic-gate { 21*0Sstevel@tonic-gate printf("%s %s", tag, fdp->fd_ifname); 22*0Sstevel@tonic-gate if (opts & OPT_UNDEF) { 23*0Sstevel@tonic-gate if (!fdp->fd_ifp) 24*0Sstevel@tonic-gate printf("(!)"); 25*0Sstevel@tonic-gate } 26*0Sstevel@tonic-gate #ifdef USE_INET6 27*0Sstevel@tonic-gate if (use_inet6 && IP6_NOTZERO(&fdp->fd_ip6.in6)) { 28*0Sstevel@tonic-gate char ipv6addr[80]; 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gate inet_ntop(AF_INET6, &fdp->fd_ip6, ipv6addr, 31*0Sstevel@tonic-gate sizeof(fdp->fd_ip6)); 32*0Sstevel@tonic-gate printf(":%s", ipv6addr); 33*0Sstevel@tonic-gate } else 34*0Sstevel@tonic-gate #endif 35*0Sstevel@tonic-gate if (fdp->fd_ip.s_addr) 36*0Sstevel@tonic-gate printf(":%s", inet_ntoa(fdp->fd_ip)); 37*0Sstevel@tonic-gate putchar(' '); 38*0Sstevel@tonic-gate } 39