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