xref: /onnv-gate/usr/src/cmd/ipf/lib/common/print_toif.c (revision 2873:121998eaf59a)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * Copyright (C) 1993-2001 by Darren Reed.
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * See the IPFILTER.LICENCE file for details on licencing.
50Sstevel@tonic-gate  *
60Sstevel@tonic-gate  * $Id: print_toif.c,v 1.8 2002/01/28 06:50:47 darrenr Exp $
70Sstevel@tonic-gate  *
82393Syz155240  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
90Sstevel@tonic-gate  * Use is subject to license terms.
100Sstevel@tonic-gate  */
110Sstevel@tonic-gate 
120Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
130Sstevel@tonic-gate 
140Sstevel@tonic-gate #include "ipf.h"
150Sstevel@tonic-gate 
160Sstevel@tonic-gate 
print_toif(tag,fdp)170Sstevel@tonic-gate void print_toif(tag, fdp)
180Sstevel@tonic-gate char *tag;
190Sstevel@tonic-gate frdest_t *fdp;
200Sstevel@tonic-gate {
210Sstevel@tonic-gate 	printf("%s %s", tag, fdp->fd_ifname);
220Sstevel@tonic-gate 	if (opts & OPT_UNDEF) {
230Sstevel@tonic-gate 		if (!fdp->fd_ifp)
240Sstevel@tonic-gate 			printf("(!)");
250Sstevel@tonic-gate 	}
260Sstevel@tonic-gate #ifdef	USE_INET6
270Sstevel@tonic-gate 	if (use_inet6 && IP6_NOTZERO(&fdp->fd_ip6.in6)) {
28637Sml37995 		char ipv6addr[INET6_ADDRSTRLEN];
290Sstevel@tonic-gate 
300Sstevel@tonic-gate 		inet_ntop(AF_INET6, &fdp->fd_ip6, ipv6addr,
31*2873Sjojemann 			  sizeof(ipv6addr));
320Sstevel@tonic-gate 		printf(":%s", ipv6addr);
330Sstevel@tonic-gate 	} else
340Sstevel@tonic-gate #endif
350Sstevel@tonic-gate 		if (fdp->fd_ip.s_addr)
360Sstevel@tonic-gate 			printf(":%s", inet_ntoa(fdp->fd_ip));
370Sstevel@tonic-gate 	putchar(' ');
380Sstevel@tonic-gate }
39