xref: /titanic_44/usr/src/cmd/ipf/lib/common/print_toif.c (revision ef292b7fad311e62bc65379b1190c4ab7a898668)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * Copyright (C) 1993-2001 by Darren Reed.
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * See the IPFILTER.LICENCE file for details on licencing.
57c478bd9Sstevel@tonic-gate  *
67c478bd9Sstevel@tonic-gate  * $Id: print_toif.c,v 1.8 2002/01/28 06:50:47 darrenr Exp $
77c478bd9Sstevel@tonic-gate  *
8ab25eeb5Syz155240  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
97c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
107c478bd9Sstevel@tonic-gate  */
117c478bd9Sstevel@tonic-gate 
127c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
137c478bd9Sstevel@tonic-gate 
147c478bd9Sstevel@tonic-gate #include "ipf.h"
157c478bd9Sstevel@tonic-gate 
167c478bd9Sstevel@tonic-gate 
print_toif(tag,fdp)177c478bd9Sstevel@tonic-gate void print_toif(tag, fdp)
187c478bd9Sstevel@tonic-gate char *tag;
197c478bd9Sstevel@tonic-gate frdest_t *fdp;
207c478bd9Sstevel@tonic-gate {
217c478bd9Sstevel@tonic-gate 	printf("%s %s", tag, fdp->fd_ifname);
227c478bd9Sstevel@tonic-gate 	if (opts & OPT_UNDEF) {
237c478bd9Sstevel@tonic-gate 		if (!fdp->fd_ifp)
247c478bd9Sstevel@tonic-gate 			printf("(!)");
257c478bd9Sstevel@tonic-gate 	}
267c478bd9Sstevel@tonic-gate #ifdef	USE_INET6
277c478bd9Sstevel@tonic-gate 	if (use_inet6 && IP6_NOTZERO(&fdp->fd_ip6.in6)) {
287663b816Sml37995 		char ipv6addr[INET6_ADDRSTRLEN];
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate 		inet_ntop(AF_INET6, &fdp->fd_ip6, ipv6addr,
31*ef292b7fSjojemann 			  sizeof(ipv6addr));
327c478bd9Sstevel@tonic-gate 		printf(":%s", ipv6addr);
337c478bd9Sstevel@tonic-gate 	} else
347c478bd9Sstevel@tonic-gate #endif
357c478bd9Sstevel@tonic-gate 		if (fdp->fd_ip.s_addr)
367c478bd9Sstevel@tonic-gate 			printf(":%s", inet_ntoa(fdp->fd_ip));
377c478bd9Sstevel@tonic-gate 	putchar(' ');
387c478bd9Sstevel@tonic-gate }
39