2 * Copyright (C) 1993-2005 by Darren Reed.
3 * See the IPFILTER.LICENCE file for details on licencing.
5 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
6 * Use is subject to license terms.
9 #pragma ident "%Z%%M% %I% %E% SMI"
11 #ifndef __IP_LOOKUP_H__
12 #define __IP_LOOKUP_H__
14 #if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51)
15 # define SIOCLOOKUPADDTABLE _IOWR('r', 60, struct iplookupop)
16 # define SIOCLOOKUPDELTABLE _IOWR('r', 61, struct iplookupop)
17 # define SIOCLOOKUPSTAT _IOWR('r', 64, struct iplookupop)
18 # define SIOCLOOKUPSTATW _IOW('r', 64, struct iplookupop)
19 # define SIOCLOOKUPFLUSH _IOWR('r', 65, struct iplookupflush)
20 # define SIOCLOOKUPADDNODE _IOWR('r', 67, struct iplookupop)
21 # define SIOCLOOKUPADDNODEW _IOW('r', 67, struct iplookupop)
22 # define SIOCLOOKUPDELNODE _IOWR('r', 68, struct iplookupop)
23 # define SIOCLOOKUPDELNODEW _IOW('r', 68, struct iplookupop)
25 # define SIOCLOOKUPADDTABLE _IOWR(r, 60, struct iplookupop)
26 # define SIOCLOOKUPDELTABLE _IOWR(r, 61, struct iplookupop)
27 # define SIOCLOOKUPSTAT _IOWR(r, 64, struct iplookupop)
28 # define SIOCLOOKUPSTATW _IOW(r, 64, struct iplookupop)
29 # define SIOCLOOKUPFLUSH _IOWR(r, 65, struct iplookupflush)
30 # define SIOCLOOKUPADDNODE _IOWR(r, 67, struct iplookupop)
31 # define SIOCLOOKUPADDNODEW _IOW(r, 67, struct iplookupop)
32 # define SIOCLOOKUPDELNODE _IOWR(r, 68, struct iplookupop)
33 # define SIOCLOOKUPDELNODEW _IOW(r, 68, struct iplookupop)
36 typedef struct iplookupop
{
37 int iplo_type
; /* IPLT_* */
38 int iplo_unit
; /* IPL_LOG* */
40 char iplo_name
[FR_GROUPLEN
];
41 size_t iplo_size
; /* sizeof struct at iplo_struct */
45 typedef struct iplookupflush
{
46 int iplf_type
; /* IPLT_* */
47 int iplf_unit
; /* IPL_LOG* */
50 char iplf_name
[FR_GROUPLEN
];
53 typedef struct iplookuplink
{
54 int ipll_type
; /* IPLT_* */
55 int ipll_unit
; /* IPL_LOG* */
57 char ipll_group
[FR_GROUPLEN
];
65 #define IPLT_ANON 0x80000000
69 struct iplookupiterkey
{
71 u_char ilik_type
; /* IPLT_* */
73 char ilik_unit
; /* IPL_LOG* */
78 typedef struct ipflookupiter
{
80 iplookupiterkey_t ili_lkey
;
81 char ili_name
[FR_GROUPLEN
];
84 #define ili_key ili_lkey.ilik_key
85 #define ili_ival ili_lkey.ilik_unstr.ilik_ival
86 #define ili_unit ili_lkey.ilik_unstr.ilik_unit
87 #define ili_type ili_lkey.ilik_unstr.ilik_type
88 #define ili_otype ili_lkey.ilik_unstr.ilik_otype
90 #define IPFLOOKUPITER_LIST 0
91 #define IPFLOOKUPITER_NODE 1
94 extern int ip_lookup_init
__P((ipf_stack_t
*));
95 extern int ip_lookup_ioctl
__P((caddr_t
, ioctlcmd_t
, int, int, void *, ipf_stack_t
*));
96 extern void ip_lookup_unload
__P((ipf_stack_t
*));
97 extern void ip_lookup_deref
__P((int, void *, ipf_stack_t
*));
98 extern int ip_lookup_iterate
__P((void *, int, void *, ipf_stack_t
*));
99 extern void ip_lookup_iterderef
__P((u_32_t
, void *, ipf_stack_t
*));
101 #endif /* __IP_LOOKUP_H__ */