Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / ipf / ip_lookup.h
blobf35ca7a9250f42b763cd065a5d3444e8d72d1596
1 /* $NetBSD$ */
4 #ifndef __IP_LOOKUP_H__
5 #define __IP_LOOKUP_H__
7 #if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51)
8 # define SIOCLOOKUPADDTABLE _IOWR('r', 60, struct iplookupop)
9 # define SIOCLOOKUPDELTABLE _IOWR('r', 61, struct iplookupop)
10 # define SIOCLOOKUPSTAT _IOWR('r', 64, struct iplookupop)
11 # define SIOCLOOKUPSTATW _IOW('r', 64, struct iplookupop)
12 # define SIOCLOOKUPFLUSH _IOWR('r', 65, struct iplookupflush)
13 # define SIOCLOOKUPADDNODE _IOWR('r', 67, struct iplookupop)
14 # define SIOCLOOKUPADDNODEW _IOW('r', 67, struct iplookupop)
15 # define SIOCLOOKUPDELNODE _IOWR('r', 68, struct iplookupop)
16 # define SIOCLOOKUPDELNODEW _IOW('r', 68, struct iplookupop)
17 #else
18 # define SIOCLOOKUPADDTABLE _IOWR(r, 60, struct iplookupop)
19 # define SIOCLOOKUPDELTABLE _IOWR(r, 61, struct iplookupop)
20 # define SIOCLOOKUPSTAT _IOWR(r, 64, struct iplookupop)
21 # define SIOCLOOKUPSTATW _IOW(r, 64, struct iplookupop)
22 # define SIOCLOOKUPFLUSH _IOWR(r, 65, struct iplookupflush)
23 # define SIOCLOOKUPADDNODE _IOWR(r, 67, struct iplookupop)
24 # define SIOCLOOKUPADDNODEW _IOW(r, 67, struct iplookupop)
25 # define SIOCLOOKUPDELNODE _IOWR(r, 68, struct iplookupop)
26 # define SIOCLOOKUPDELNODEW _IOW(r, 68, struct iplookupop)
27 #endif
29 typedef struct iplookupop {
30 int iplo_type; /* IPLT_* */
31 int iplo_unit; /* IPL_LOG* */
32 u_int iplo_arg;
33 char iplo_name[FR_GROUPLEN];
34 size_t iplo_size; /* sizeof struct at iplo_struct */
35 void *iplo_struct;
36 } iplookupop_t;
38 #define LOOKUP_ANON 0x80000000
41 typedef struct iplookupflush {
42 int iplf_type; /* IPLT_* */
43 int iplf_unit; /* IPL_LOG* */
44 u_int iplf_arg;
45 u_int iplf_count;
46 char iplf_name[FR_GROUPLEN];
47 } iplookupflush_t;
49 typedef struct iplookuplink {
50 int ipll_type; /* IPLT_* */
51 int ipll_unit; /* IPL_LOG* */
52 u_int ipll_num;
53 char ipll_group[FR_GROUPLEN];
54 } iplookuplink_t;
56 #define IPLT_ALL -1
57 #define IPLT_NONE 0
58 #define IPLT_POOL 1
59 #define IPLT_HASH 2
61 #define IPLT_ANON 0x80000000
64 typedef union {
65 struct iplookupiterkey {
66 char ilik_ival;
67 u_char ilik_type; /* IPLT_* */
68 u_char ilik_otype;
69 u_char ilik_unit; /* IPL_LOG* */
70 } ilik_unstr;
71 u_32_t ilik_key;
72 } iplookupiterkey_t;
74 typedef struct ipflookupiter {
75 int ili_nitems;
76 iplookupiterkey_t ili_lkey;
77 char ili_name[FR_GROUPLEN];
78 void *ili_data;
79 } ipflookupiter_t;
81 #define ili_key ili_lkey.ilik_key
82 #define ili_ival ili_lkey.ilik_unstr.ilik_ival
83 #define ili_unit ili_lkey.ilik_unstr.ilik_unit
84 #define ili_type ili_lkey.ilik_unstr.ilik_type
85 #define ili_otype ili_lkey.ilik_unstr.ilik_otype
87 #define IPFLOOKUPITER_LIST 0
88 #define IPFLOOKUPITER_NODE 1
91 extern int ip_lookup_init __P((void));
92 extern int ip_lookup_ioctl __P((caddr_t, ioctlcmd_t, int, int, void *));
93 extern void ip_lookup_unload __P((void));
94 extern void ip_lookup_deref __P((int, void *));
95 extern void ip_lookup_iterderef __P((u_32_t, void *));
97 #endif /* __IP_LOOKUP_H__ */