add UNLEASHED_OBJ to unleashed.mk
[unleashed/tickless.git] / usr / src / cmd / ipf / lib / common / printaddr.c
blob914ec3c6639f34fef1e90ee07e5909769ba0c345
1 /*
2 * Copyright (C) 2005 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
6 */
8 #pragma ident "%Z%%M% %I% %E% SMI"
10 #include "ipf.h"
13 void printaddr(v, type, ifname, addr, mask)
14 int v, type;
15 char *ifname;
16 u_32_t *addr, *mask;
18 char *suffix;
20 switch (type)
22 case FRI_BROADCAST :
23 suffix = "/bcast";
24 break;
26 case FRI_DYNAMIC :
27 printf("%s", ifname);
28 printmask(v, mask);
29 suffix = NULL;
30 break;
32 case FRI_NETWORK :
33 suffix = "/net";
34 break;
36 case FRI_NETMASKED :
37 suffix = "/netmasked";
38 break;
40 case FRI_PEERADDR :
41 suffix = "/peer";
42 break;
44 case FRI_LOOKUP :
45 suffix = NULL;
46 printlookup((i6addr_t *)addr, (i6addr_t *)mask);
47 break;
49 case FRI_NORMAL :
50 printhostmask(v, addr, mask);
51 suffix = NULL;
52 break;
53 default :
54 printf("<%d>", type);
55 printmask(v, mask);
56 suffix = NULL;
57 break;
60 if (suffix != NULL) {
61 printf("%s/%s", ifname, suffix);