2 * Copyright (C) 2012 by Darren Reed.
4 * See the IPFILTER.LICENCE file for details on licencing.
6 * @(#)ip_fil.h 1.35 6/5/96
11 #define __IP_SCAN_H__ 1
14 # include <sys/ioccom.h>
17 #define IPSCAN_NAME "/dev/ipscan"
18 #define IPL_SCAN IPSCAN_NAME
28 #if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51)
29 # define SIOCADSCA _IOWR('r', 60, struct ipscan *)
30 # define SIOCRMSCA _IOWR('r', 61, struct ipscan *)
31 # define SIOCGSCST _IOWR('r', 62, struct ipscan *)
33 # define SIOCADSCA _IOWR(r, 60, struct ipscan *)
34 # define SIOCRMSCA _IOWR(r, 61, struct ipscan *)
35 # define SIOCGSCST _IOWR(r, 62, struct ipscan *)
39 int act_val; /* what to do */
40 struct in_addr act_ip; /* redirect IP# */
41 u_short act_port; /* redirect port number */
42 int act_else; /* what to do */
43 struct in_addr act_eip; /* redirect IP# */
44 u_short act_eport; /* redirect port number */
48 typedef struct sinfo {
49 char s_txt[ISC_TLEN]; /* text to match */
50 char s_msk[ISC_TLEN]; /* mask of the above to check */
51 int s_len; /* length of server text */
55 typedef struct ipscan {
56 struct ipscan *ipsc_next;
57 struct ipscan **ipsc_pnext;
58 char ipsc_tag[ISC_TLEN]; /* table entry protocol tag */
59 sinfo_t ipsc_si[2]; /* client/server side information */
60 int ipsc_hits; /* times this has been matched */
61 int ipsc_active; /* # of active matches */
62 int ipsc_fref; /* # of references from filter rules */
63 int ipsc_sref; /* # of references from state entries */
64 struct action ipsc_act;
68 #define ipsc_cl ipsc_si[0]
69 #define ipsc_sl ipsc_si[1]
70 #define ipsc_ctxt ipsc_cl.s_txt
71 #define ipsc_cmsk ipsc_cl.s_msk
72 #define ipsc_clen ipsc_cl.s_len
73 #define ipsc_stxt ipsc_sl.s_txt
74 #define ipsc_smsk ipsc_sl.s_msk
75 #define ipsc_slen ipsc_sl.s_len
76 #define ipsc_action ipsc_act.act_val
77 #define ipsc_ip ipsc_act.act_ip
78 #define ipsc_port ipsc_act.act_port
79 #define ipsc_else ipsc_act.act_else
80 #define ipsc_eip ipsc_act.act_eip
81 #define ipsc_eport ipsc_act.act_eport
86 #define ISC_A_REDIRECT 3
89 typedef struct ipscanstat {
90 struct ipscan *iscs_list;
97 extern int ipf_scan_ioctl __P((ipf_main_softc_t *, caddr_t, ioctlcmd_t, int, int, void *));
98 extern int ipf_scan_init __P((void));
99 extern int ipf_scan_attachis __P((struct ipstate *));
100 extern int ipf_scan_attachfr __P((struct frentry *));
101 extern int ipf_scan_detachis __P((struct ipstate *));
102 extern int ipf_scan_detachfr __P((struct frentry *));
103 extern int ipf_scan_packet __P((struct fr_info *, struct ipstate *));
104 extern void ipf_scan_unload __P((ipf_main_softc_t *));
106 #endif /* __IP_SCAN_H__ */