blob: 5720defe25206a5f12335738829f5c0c8d378131 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
/* $NetBSD: printlookup.c,v 1.2 2012/07/22 14:27:36 darrenr Exp $ */
/*
* Copyright (C) 2012 by Darren Reed.
*
* See the IPFILTER.LICENCE file for details on licencing.
*
* Id: printlookup.c,v 1.1.1.2 2012/07/22 13:44:41 darrenr Exp $
*/
#include "ipf.h"
void
printlookup(base, addr, mask)
char *base;
i6addr_t *addr, *mask;
{
char name[32];
switch (addr->iplookuptype)
{
case IPLT_POOL :
PRINTF("pool/");
break;
case IPLT_HASH :
PRINTF("hash/");
break;
case IPLT_DSTLIST :
PRINTF("dstlist/");
break;
default :
PRINTF("lookup(%x)=", addr->iplookuptype);
break;
}
if (addr->iplookupsubtype == 0)
PRINTF("%u", addr->iplookupnum);
else if (addr->iplookupsubtype == 1) {
strncpy(name, base + addr->iplookupname, sizeof(name));
name[sizeof(name) - 1] = '\0';
PRINTF("%s", name);
}
}
|