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