1*d6c23f6fSyx /*
2*d6c23f6fSyx  * Copyright (C) 2002-2004 by Darren Reed.
3*d6c23f6fSyx  *
4*d6c23f6fSyx  * See the IPFILTER.LICENCE file for details on licencing.
5*d6c23f6fSyx  *
6*d6c23f6fSyx  * Added redirect stuff and a variety of bug fixes. (mcn@EnGarde.com)
7*d6c23f6fSyx  */
8*d6c23f6fSyx 
9*d6c23f6fSyx #include "ipf.h"
10*d6c23f6fSyx 
11*d6c23f6fSyx #pragma ident	"%Z%%M%	%I%	%E% SMI"
12*d6c23f6fSyx 
13*d6c23f6fSyx #if !defined(lint)
14*d6c23f6fSyx static const char rcsid[] = "@(#)$Id: printactiveaddr.c,v 1.1 2008/02/12 16:11:49 darren_r Exp $";
15*d6c23f6fSyx #endif
16*d6c23f6fSyx 
17*d6c23f6fSyx void
printactiveaddress(v,fmt,addr,ifname)18*d6c23f6fSyx printactiveaddress(v, fmt, addr, ifname)
19*d6c23f6fSyx 	int v;
20*d6c23f6fSyx 	char *fmt;
21*d6c23f6fSyx 	i6addr_t *addr;
22*d6c23f6fSyx 	char *ifname;
23*d6c23f6fSyx {
24*d6c23f6fSyx 	switch (v)
25*d6c23f6fSyx 	{
26*d6c23f6fSyx 	case 4 :
27*d6c23f6fSyx 		printf(fmt, inet_ntoa(addr->in4));
28*d6c23f6fSyx 		break;
29*d6c23f6fSyx #ifdef USE_INET6
30*d6c23f6fSyx 	case 6 :
31*d6c23f6fSyx 		printaddr(v, FRI_NORMAL, ifname, (u_32_t *)&addr->in6, NULL);
32*d6c23f6fSyx 		break;
33*d6c23f6fSyx #endif
34*d6c23f6fSyx 	default :
35*d6c23f6fSyx 		break;
36*d6c23f6fSyx 	}
37*d6c23f6fSyx }
38