1 /* 2 * Copyright (C) 1993-2005 by Darren Reed. 3 * See the IPFILTER.LICENCE file for details on licencing. 4 */ 5 6 #ifndef __IP_LOOKUP_H__ 7 #define __IP_LOOKUP_H__ 8 9 #if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51) 10 # define SIOCLOOKUPADDTABLE _IOWR('r', 60, struct iplookupop) 11 # define SIOCLOOKUPDELTABLE _IOWR('r', 61, struct iplookupop) 12 # define SIOCLOOKUPSTAT _IOWR('r', 64, struct iplookupop) 13 # define SIOCLOOKUPSTATW _IOW('r', 64, struct iplookupop) 14 # define SIOCLOOKUPFLUSH _IOWR('r', 65, struct iplookupflush) 15 # define SIOCLOOKUPADDNODE _IOWR('r', 67, struct iplookupop) 16 # define SIOCLOOKUPADDNODEW _IOW('r', 67, struct iplookupop) 17 # define SIOCLOOKUPDELNODE _IOWR('r', 68, struct iplookupop) 18 # define SIOCLOOKUPDELNODEW _IOW('r', 68, struct iplookupop) 19 #else 20 # define SIOCLOOKUPADDTABLE _IOWR(r, 60, struct iplookupop) 21 # define SIOCLOOKUPDELTABLE _IOWR(r, 61, struct iplookupop) 22 # define SIOCLOOKUPSTAT _IOWR(r, 64, struct iplookupop) 23 # define SIOCLOOKUPSTATW _IOW(r, 64, struct iplookupop) 24 # define SIOCLOOKUPFLUSH _IOWR(r, 65, struct iplookupflush) 25 # define SIOCLOOKUPADDNODE _IOWR(r, 67, struct iplookupop) 26 # define SIOCLOOKUPADDNODEW _IOW(r, 67, struct iplookupop) 27 # define SIOCLOOKUPDELNODE _IOWR(r, 68, struct iplookupop) 28 # define SIOCLOOKUPDELNODEW _IOW(r, 68, struct iplookupop) 29 #endif 30 31 typedef struct iplookupop { 32 int iplo_type; /* IPLT_* */ 33 int iplo_unit; /* IPL_LOG* */ 34 u_int iplo_arg; 35 char iplo_name[FR_GROUPLEN]; 36 size_t iplo_size; /* sizeof struct at iplo_struct */ 37 void *iplo_struct; 38 } iplookupop_t; 39 40 typedef struct iplookupflush { 41 int iplf_type; /* IPLT_* */ 42 int iplf_unit; /* IPL_LOG* */ 43 u_int iplf_arg; 44 size_t iplf_count; 45 char iplf_name[FR_GROUPLEN]; 46 } iplookupflush_t; 47 48 typedef struct iplookuplink { 49 int ipll_type; /* IPLT_* */ 50 int ipll_unit; /* IPL_LOG* */ 51 u_int ipll_num; 52 char ipll_group[FR_GROUPLEN]; 53 } iplookuplink_t; 54 55 #define IPLT_ALL -1 56 #define IPLT_NONE 0 57 #define IPLT_POOL 1 58 #define IPLT_HASH 2 59 60 #define IPLT_ANON 0x80000000 61 62 extern int ip_lookup_init __P((void)); 63 extern int ip_lookup_ioctl __P((caddr_t, ioctlcmd_t, int)); 64 extern void ip_lookup_unload __P((void)); 65 extern void ip_lookup_deref __P((int, void *)); 66 67 #endif /* __IP_LOOKUP_H__ */ 68