xref: /freebsd/sbin/ipf/libipf/printactiveaddr.c (revision efeb8bffe34422937c7f8df836afb5b817366d16)
141edb306SCy Schubert /*
241edb306SCy Schubert  * Copyright (C) 2012 by Darren Reed.
341edb306SCy Schubert  *
441edb306SCy Schubert  * See the IPFILTER.LICENCE file for details on licencing.
541edb306SCy Schubert  *
641edb306SCy Schubert  * Added redirect stuff and a variety of bug fixes. (mcn@EnGarde.com)
741edb306SCy Schubert  */
841edb306SCy Schubert 
941edb306SCy Schubert #include "ipf.h"
1041edb306SCy Schubert 
1141edb306SCy Schubert 
1241edb306SCy Schubert #if !defined(lint)
1341edb306SCy Schubert static const char rcsid[] = "@(#)$Id: printactiveaddr.c,v 1.3.2.2 2012/07/22 08:04:24 darren_r Exp $";
1441edb306SCy Schubert #endif
1541edb306SCy Schubert 
1641edb306SCy Schubert 
1741edb306SCy Schubert void
18*efeb8bffSCy Schubert printactiveaddress(int v, char *fmt, i6addr_t *addr, char *ifname)
1941edb306SCy Schubert {
2041edb306SCy Schubert 	switch (v)
2141edb306SCy Schubert 	{
2241edb306SCy Schubert 	case 4 :
2341edb306SCy Schubert 		PRINTF(fmt, inet_ntoa(addr->in4));
2441edb306SCy Schubert 		break;
2541edb306SCy Schubert #ifdef USE_INET6
2641edb306SCy Schubert 	case 6 :
2741edb306SCy Schubert 		printaddr(AF_INET6, FRI_NORMAL, ifname, 0,
2841edb306SCy Schubert 			  (u_32_t *)&addr->in6, NULL);
2941edb306SCy Schubert 		break;
3041edb306SCy Schubert #endif
3141edb306SCy Schubert 	default :
3241edb306SCy Schubert 		break;
3341edb306SCy Schubert 	}
3441edb306SCy Schubert }
35