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