Retire the K&R/STD C __P prototype declarations.
In the old days when K&R C and STD C were each in use a workaround (read hack) was required to allow the same code to work on each without modification. All C compilers support STD C. We can finally put the __P prototype to rest. MFC after: 1 week
This commit is contained in:
parent
0b7f1af804
commit
4cd1807c7d
@ -71,8 +71,8 @@ static const char rcsid[] =
|
||||
#define int32 bpf_int32
|
||||
#define u_int32 bpf_u_int32
|
||||
|
||||
static int m_xword __P((mb_t *, int, int *));
|
||||
static int m_xhalf __P((mb_t *, int, int *));
|
||||
static int m_xword(mb_t *, int, int *);
|
||||
static int m_xhalf(mb_t *, int, int *);
|
||||
|
||||
#ifndef LBL_ALIGN
|
||||
/*
|
||||
|
@ -73,41 +73,41 @@ typedef struct ipf_dstl_softc_s {
|
||||
} ipf_dstl_softc_t;
|
||||
|
||||
|
||||
static void *ipf_dstlist_soft_create __P((ipf_main_softc_t *));
|
||||
static void ipf_dstlist_soft_destroy __P((ipf_main_softc_t *, void *));
|
||||
static int ipf_dstlist_soft_init __P((ipf_main_softc_t *, void *));
|
||||
static void ipf_dstlist_soft_fini __P((ipf_main_softc_t *, void *));
|
||||
static int ipf_dstlist_addr_find __P((ipf_main_softc_t *, void *, int,
|
||||
void *, u_int));
|
||||
static size_t ipf_dstlist_flush __P((ipf_main_softc_t *, void *,
|
||||
iplookupflush_t *));
|
||||
static int ipf_dstlist_iter_deref __P((ipf_main_softc_t *, void *, int, int,
|
||||
void *));
|
||||
static int ipf_dstlist_iter_next __P((ipf_main_softc_t *, void *, ipftoken_t *,
|
||||
ipflookupiter_t *));
|
||||
static int ipf_dstlist_node_add __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *, int));
|
||||
static int ipf_dstlist_node_del __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *, int));
|
||||
static int ipf_dstlist_stats_get __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *));
|
||||
static int ipf_dstlist_table_add __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *));
|
||||
static int ipf_dstlist_table_del __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *));
|
||||
static int ipf_dstlist_table_deref __P((ipf_main_softc_t *, void *, void *));
|
||||
static void *ipf_dstlist_table_find __P((void *, int, char *));
|
||||
static void ipf_dstlist_table_free __P((ipf_dstl_softc_t *, ippool_dst_t *));
|
||||
static void ipf_dstlist_table_remove __P((ipf_main_softc_t *,
|
||||
ipf_dstl_softc_t *, ippool_dst_t *));
|
||||
static void ipf_dstlist_table_clearnodes __P((ipf_dstl_softc_t *,
|
||||
ippool_dst_t *));
|
||||
static ipf_dstnode_t *ipf_dstlist_select __P((fr_info_t *, ippool_dst_t *));
|
||||
static void *ipf_dstlist_select_ref __P((void *, int, char *));
|
||||
static void ipf_dstlist_node_free __P((ipf_dstl_softc_t *, ippool_dst_t *, ipf_dstnode_t *));
|
||||
static int ipf_dstlist_node_deref __P((void *, ipf_dstnode_t *));
|
||||
static void ipf_dstlist_expire __P((ipf_main_softc_t *, void *));
|
||||
static void ipf_dstlist_sync __P((ipf_main_softc_t *, void *));
|
||||
static void *ipf_dstlist_soft_create(ipf_main_softc_t *);
|
||||
static void ipf_dstlist_soft_destroy(ipf_main_softc_t *, void *);
|
||||
static int ipf_dstlist_soft_init(ipf_main_softc_t *, void *);
|
||||
static void ipf_dstlist_soft_fini(ipf_main_softc_t *, void *);
|
||||
static int ipf_dstlist_addr_find(ipf_main_softc_t *, void *, int,
|
||||
void *, u_int);
|
||||
static size_t ipf_dstlist_flush(ipf_main_softc_t *, void *,
|
||||
iplookupflush_t *);
|
||||
static int ipf_dstlist_iter_deref(ipf_main_softc_t *, void *, int, int,
|
||||
void *);
|
||||
static int ipf_dstlist_iter_next(ipf_main_softc_t *, void *, ipftoken_t *,
|
||||
ipflookupiter_t *);
|
||||
static int ipf_dstlist_node_add(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *, int);
|
||||
static int ipf_dstlist_node_del(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *, int);
|
||||
static int ipf_dstlist_stats_get(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *);
|
||||
static int ipf_dstlist_table_add(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *);
|
||||
static int ipf_dstlist_table_del(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *);
|
||||
static int ipf_dstlist_table_deref(ipf_main_softc_t *, void *, void *);
|
||||
static void *ipf_dstlist_table_find(void *, int, char *);
|
||||
static void ipf_dstlist_table_free(ipf_dstl_softc_t *, ippool_dst_t *);
|
||||
static void ipf_dstlist_table_remove(ipf_main_softc_t *,
|
||||
ipf_dstl_softc_t *, ippool_dst_t *);
|
||||
static void ipf_dstlist_table_clearnodes(ipf_dstl_softc_t *,
|
||||
ippool_dst_t *);
|
||||
static ipf_dstnode_t *ipf_dstlist_select(fr_info_t *, ippool_dst_t *);
|
||||
static void *ipf_dstlist_select_ref(void *, int, char *);
|
||||
static void ipf_dstlist_node_free(ipf_dstl_softc_t *, ippool_dst_t *, ipf_dstnode_t *);
|
||||
static int ipf_dstlist_node_deref(void *, ipf_dstnode_t *);
|
||||
static void ipf_dstlist_expire(ipf_main_softc_t *, void *);
|
||||
static void ipf_dstlist_sync(ipf_main_softc_t *, void *);
|
||||
|
||||
ipf_lookup_t ipf_dstlist_backend = {
|
||||
IPLT_DSTLIST,
|
||||
|
@ -62,7 +62,7 @@ typedef struct dstlist_stat_s {
|
||||
|
||||
extern ipf_lookup_t ipf_dstlist_backend;
|
||||
|
||||
extern int ipf_dstlist_select_node __P((fr_info_t *, void *, u_32_t *,
|
||||
frdest_t *));
|
||||
extern int ipf_dstlist_select_node(fr_info_t *, void *, u_32_t *,
|
||||
frdest_t *);
|
||||
|
||||
#endif /* __IP_DSTLIST_H__ */
|
||||
|
@ -23,12 +23,12 @@ static int nifs = 0;
|
||||
|
||||
struct rtentry;
|
||||
|
||||
static void ipf_setifpaddr __P((struct ifnet *, char *));
|
||||
void init_ifp __P((void));
|
||||
static int no_output __P((struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *));
|
||||
static int write_output __P((struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *));
|
||||
static void ipf_setifpaddr(struct ifnet *, char *);
|
||||
void init_ifp(void);
|
||||
static int no_output(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *);
|
||||
static int write_output(struct ifnet *, struct mbuf *,
|
||||
struct sockaddr *, struct rtentry *);
|
||||
|
||||
struct ifaddr {
|
||||
struct sockaddr_storage ifa_addr;
|
||||
|
@ -73,7 +73,7 @@ typedef struct tcpinfo4 {
|
||||
tcpdata_t ts_data[2];
|
||||
} tcpinfo4_t;
|
||||
|
||||
static void ipf_v5tcpinfoto4 __P((tcpinfo_t *, tcpinfo4_t *));
|
||||
static void ipf_v5tcpinfoto4(tcpinfo_t *, tcpinfo4_t *);
|
||||
|
||||
static void
|
||||
ipf_v5tcpinfoto4(v5, v4)
|
||||
@ -1190,66 +1190,66 @@ typedef struct ipfrstat_4_1_1 {
|
||||
} ipfrstat_4_1_1_t;
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
static int ipf_addfrstr __P((char *, int, char *, int));
|
||||
static void ipf_v4iptov5 __P((frip4_t *, fr_ip_t *));
|
||||
static void ipf_v5iptov4 __P((fr_ip_t *, frip4_t *));
|
||||
static void ipfv4tuctov5 __P((frtuc4_t *, frtuc_t *));
|
||||
static void ipfv5tuctov4 __P((frtuc_t *, frtuc4_t *));
|
||||
static int ipf_v4fripftov5 __P((fripf4_t *, char *));
|
||||
static void ipf_v5fripftov4 __P((fripf_t *, fripf4_t *));
|
||||
static int fr_frflags4to5 __P((u_32_t));
|
||||
static int fr_frflags5to4 __P((u_32_t));
|
||||
static int ipf_addfrstr(char *, int, char *, int);
|
||||
static void ipf_v4iptov5(frip4_t *, fr_ip_t *);
|
||||
static void ipf_v5iptov4(fr_ip_t *, frip4_t *);
|
||||
static void ipfv4tuctov5(frtuc4_t *, frtuc_t *);
|
||||
static void ipfv5tuctov4(frtuc_t *, frtuc4_t *);
|
||||
static int ipf_v4fripftov5(fripf4_t *, char *);
|
||||
static void ipf_v5fripftov4(fripf_t *, fripf4_t *);
|
||||
static int fr_frflags4to5(u_32_t);
|
||||
static int fr_frflags5to4(u_32_t);
|
||||
|
||||
static void friostat_current_to_4_1_0 __P((void *, friostat_4_1_0_t *, int));
|
||||
static void friostat_current_to_4_1_33 __P((void *, friostat_4_1_33_t *, int));
|
||||
static void ipstate_current_to_4_1_0 __P((void *, ipstate_4_1_0_t *));
|
||||
static void ipstate_current_to_4_1_16 __P((void *, ipstate_4_1_16_t *));
|
||||
static void ipnat_current_to_4_1_0 __P((void *, ipnat_4_1_0_t *));
|
||||
static void ipnat_current_to_4_1_14 __P((void *, ipnat_4_1_14_t *));
|
||||
static void frauth_current_to_4_1_11 __P((void *, frauth_4_1_11_t *));
|
||||
static void frauth_current_to_4_1_23 __P((void *, frauth_4_1_23_t *));
|
||||
static void frauth_current_to_4_1_24 __P((void *, frauth_4_1_24_t *));
|
||||
static void frauth_current_to_4_1_29 __P((void *, frauth_4_1_29_t *));
|
||||
static void frentry_current_to_4_1_0 __P((void *, frentry_4_1_0_t *));
|
||||
static void frentry_current_to_4_1_16 __P((void *, frentry_4_1_16_t *));
|
||||
static void frentry_current_to_4_1_34 __P((void *, frentry_4_1_34_t *));
|
||||
static void fr_info_current_to_4_1_11 __P((void *, fr_info_4_1_11_t *));
|
||||
static void fr_info_current_to_4_1_23 __P((void *, fr_info_4_1_23_t *));
|
||||
static void fr_info_current_to_4_1_24 __P((void *, fr_info_4_1_24_t *));
|
||||
static void nat_save_current_to_4_1_3 __P((void *, nat_save_4_1_3_t *));
|
||||
static void nat_save_current_to_4_1_14 __P((void *, nat_save_4_1_14_t *));
|
||||
static void nat_save_current_to_4_1_16 __P((void *, nat_save_4_1_16_t *));
|
||||
static void ipstate_save_current_to_4_1_0 __P((void *, ipstate_save_4_1_0_t *));
|
||||
static void ipstate_save_current_to_4_1_16 __P((void *, ipstate_save_4_1_16_t *));
|
||||
static void ips_stat_current_to_4_1_0 __P((void *, ips_stat_4_1_0_t *));
|
||||
static void ips_stat_current_to_4_1_21 __P((void *, ips_stat_4_1_21_t *));
|
||||
static void natstat_current_to_4_1_0 __P((void *, natstat_4_1_0_t *));
|
||||
static void natstat_current_to_4_1_16 __P((void *, natstat_4_1_16_t *));
|
||||
static void natstat_current_to_4_1_27 __P((void *, natstat_4_1_27_t *));
|
||||
static void natstat_current_to_4_1_32 __P((void *, natstat_4_1_32_t *));
|
||||
static void nat_current_to_4_1_3 __P((void *, nat_4_1_3_t *));
|
||||
static void nat_current_to_4_1_14 __P((void *, nat_4_1_14_t *));
|
||||
static void nat_current_to_4_1_25 __P((void *, nat_4_1_25_t *));
|
||||
static void friostat_current_to_4_1_0(void *, friostat_4_1_0_t *, int);
|
||||
static void friostat_current_to_4_1_33(void *, friostat_4_1_33_t *, int);
|
||||
static void ipstate_current_to_4_1_0(void *, ipstate_4_1_0_t *);
|
||||
static void ipstate_current_to_4_1_16(void *, ipstate_4_1_16_t *);
|
||||
static void ipnat_current_to_4_1_0(void *, ipnat_4_1_0_t *);
|
||||
static void ipnat_current_to_4_1_14(void *, ipnat_4_1_14_t *);
|
||||
static void frauth_current_to_4_1_11(void *, frauth_4_1_11_t *);
|
||||
static void frauth_current_to_4_1_23(void *, frauth_4_1_23_t *);
|
||||
static void frauth_current_to_4_1_24(void *, frauth_4_1_24_t *);
|
||||
static void frauth_current_to_4_1_29(void *, frauth_4_1_29_t *);
|
||||
static void frentry_current_to_4_1_0(void *, frentry_4_1_0_t *);
|
||||
static void frentry_current_to_4_1_16(void *, frentry_4_1_16_t *);
|
||||
static void frentry_current_to_4_1_34(void *, frentry_4_1_34_t *);
|
||||
static void fr_info_current_to_4_1_11(void *, fr_info_4_1_11_t *);
|
||||
static void fr_info_current_to_4_1_23(void *, fr_info_4_1_23_t *);
|
||||
static void fr_info_current_to_4_1_24(void *, fr_info_4_1_24_t *);
|
||||
static void nat_save_current_to_4_1_3(void *, nat_save_4_1_3_t *);
|
||||
static void nat_save_current_to_4_1_14(void *, nat_save_4_1_14_t *);
|
||||
static void nat_save_current_to_4_1_16(void *, nat_save_4_1_16_t *);
|
||||
static void ipstate_save_current_to_4_1_0(void *, ipstate_save_4_1_0_t *);
|
||||
static void ipstate_save_current_to_4_1_16(void *, ipstate_save_4_1_16_t *);
|
||||
static void ips_stat_current_to_4_1_0(void *, ips_stat_4_1_0_t *);
|
||||
static void ips_stat_current_to_4_1_21(void *, ips_stat_4_1_21_t *);
|
||||
static void natstat_current_to_4_1_0(void *, natstat_4_1_0_t *);
|
||||
static void natstat_current_to_4_1_16(void *, natstat_4_1_16_t *);
|
||||
static void natstat_current_to_4_1_27(void *, natstat_4_1_27_t *);
|
||||
static void natstat_current_to_4_1_32(void *, natstat_4_1_32_t *);
|
||||
static void nat_current_to_4_1_3(void *, nat_4_1_3_t *);
|
||||
static void nat_current_to_4_1_14(void *, nat_4_1_14_t *);
|
||||
static void nat_current_to_4_1_25(void *, nat_4_1_25_t *);
|
||||
|
||||
static void friostat_4_1_0_to_current __P((friostat_4_1_0_t *, void *));
|
||||
static void friostat_4_1_33_to_current __P((friostat_4_1_33_t *, void *));
|
||||
static void ipnat_4_1_0_to_current __P((ipnat_4_1_0_t *, void *, int));
|
||||
static void ipnat_4_1_14_to_current __P((ipnat_4_1_14_t *, void *, int));
|
||||
static void frauth_4_1_11_to_current __P((frauth_4_1_11_t *, void *));
|
||||
static void frauth_4_1_23_to_current __P((frauth_4_1_23_t *, void *));
|
||||
static void frauth_4_1_24_to_current __P((frauth_4_1_24_t *, void *));
|
||||
static void frauth_4_1_29_to_current __P((frauth_4_1_29_t *, void *));
|
||||
static void frauth_4_1_32_to_current __P((frauth_4_1_32_t *, void *));
|
||||
static void frentry_4_1_0_to_current __P((ipf_main_softc_t *, frentry_4_1_0_t *, void *, int));
|
||||
static void frentry_4_1_16_to_current __P((ipf_main_softc_t *, frentry_4_1_16_t *, void *, int));
|
||||
static void frentry_4_1_34_to_current __P((ipf_main_softc_t *, frentry_4_1_34_t *, void *, int));
|
||||
static void fr_info_4_1_11_to_current __P((fr_info_4_1_11_t *, void *));
|
||||
static void fr_info_4_1_23_to_current __P((fr_info_4_1_23_t *, void *));
|
||||
static void fr_info_4_1_24_to_current __P((fr_info_4_1_24_t *, void *));
|
||||
static void fr_info_4_1_32_to_current __P((fr_info_4_1_32_t *, void *));
|
||||
static void nat_save_4_1_3_to_current __P((ipf_main_softc_t *, nat_save_4_1_3_t *, void *));
|
||||
static void nat_save_4_1_14_to_current __P((ipf_main_softc_t *, nat_save_4_1_14_t *, void *));
|
||||
static void nat_save_4_1_16_to_current __P((ipf_main_softc_t *, nat_save_4_1_16_t *, void *));
|
||||
static void friostat_4_1_0_to_current(friostat_4_1_0_t *, void *);
|
||||
static void friostat_4_1_33_to_current(friostat_4_1_33_t *, void *);
|
||||
static void ipnat_4_1_0_to_current(ipnat_4_1_0_t *, void *, int);
|
||||
static void ipnat_4_1_14_to_current(ipnat_4_1_14_t *, void *, int);
|
||||
static void frauth_4_1_11_to_current(frauth_4_1_11_t *, void *);
|
||||
static void frauth_4_1_23_to_current(frauth_4_1_23_t *, void *);
|
||||
static void frauth_4_1_24_to_current(frauth_4_1_24_t *, void *);
|
||||
static void frauth_4_1_29_to_current(frauth_4_1_29_t *, void *);
|
||||
static void frauth_4_1_32_to_current(frauth_4_1_32_t *, void *);
|
||||
static void frentry_4_1_0_to_current(ipf_main_softc_t *, frentry_4_1_0_t *, void *, int);
|
||||
static void frentry_4_1_16_to_current(ipf_main_softc_t *, frentry_4_1_16_t *, void *, int);
|
||||
static void frentry_4_1_34_to_current(ipf_main_softc_t *, frentry_4_1_34_t *, void *, int);
|
||||
static void fr_info_4_1_11_to_current(fr_info_4_1_11_t *, void *);
|
||||
static void fr_info_4_1_23_to_current(fr_info_4_1_23_t *, void *);
|
||||
static void fr_info_4_1_24_to_current(fr_info_4_1_24_t *, void *);
|
||||
static void fr_info_4_1_32_to_current(fr_info_4_1_32_t *, void *);
|
||||
static void nat_save_4_1_3_to_current(ipf_main_softc_t *, nat_save_4_1_3_t *, void *);
|
||||
static void nat_save_4_1_14_to_current(ipf_main_softc_t *, nat_save_4_1_14_t *, void *);
|
||||
static void nat_save_4_1_16_to_current(ipf_main_softc_t *, nat_save_4_1_16_t *, void *);
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* In this section is a series of short routines that deal with translating */
|
||||
|
@ -33,12 +33,12 @@ typedef struct msnrpchdr {
|
||||
u_char mrh_ans;
|
||||
} msnrpchdr_t;
|
||||
|
||||
int ippr_msnrpc_init __P((void));
|
||||
void ippr_msnrpc_fini __P((void));
|
||||
int ippr_msnrpc_new __P((fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ippr_msnrpc_out __P((fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ippr_msnrpc_in __P((fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ippr_msnrpc_check __P((ip_t *, msnrpchdr_t *));
|
||||
int ippr_msnrpc_init(void);
|
||||
void ippr_msnrpc_fini(void);
|
||||
int ippr_msnrpc_new(fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ippr_msnrpc_out(fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ippr_msnrpc_in(fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ippr_msnrpc_check(ip_t *, msnrpchdr_t *);
|
||||
|
||||
static frentry_t msnfr;
|
||||
|
||||
|
@ -175,12 +175,12 @@ typedef struct proxyrule {
|
||||
#if defined(__NetBSD__) || defined(__FreeBSD_version) || \
|
||||
SOLARIS
|
||||
# include <stdarg.h>
|
||||
typedef int (* ioctlfunc_t) __P((int, ioctlcmd_t, ...));
|
||||
typedef int (* ioctlfunc_t)(int, ioctlcmd_t, ...);
|
||||
#else
|
||||
typedef int (* ioctlfunc_t) __P((dev_t, ioctlcmd_t, void *));
|
||||
typedef int (* ioctlfunc_t)(dev_t, ioctlcmd_t, void *);
|
||||
#endif
|
||||
typedef int (* addfunc_t) __P((int, ioctlfunc_t, void *));
|
||||
typedef int (* copyfunc_t) __P((void *, void *, size_t));
|
||||
typedef int (* addfunc_t)(int, ioctlfunc_t, void *);
|
||||
typedef int (* copyfunc_t)(void *, void *, size_t);
|
||||
|
||||
|
||||
extern char thishost[MAXHOSTNAMELEN];
|
||||
@ -200,178 +200,178 @@ extern wordtab_t natfields[];
|
||||
extern wordtab_t poolfields[];
|
||||
|
||||
|
||||
extern int addicmp __P((char ***, struct frentry *, int));
|
||||
extern int addipopt __P((char *, struct ipopt_names *, int, char *));
|
||||
extern int addkeep __P((char ***, struct frentry *, int));
|
||||
extern alist_t *alist_new __P((int, char *));
|
||||
extern void alist_free __P((alist_t *));
|
||||
extern void assigndefined __P((char *));
|
||||
extern void binprint __P((void *, size_t));
|
||||
extern u_32_t buildopts __P((char *, char *, int));
|
||||
extern int checkrev __P((char *));
|
||||
extern int connecttcp __P((char *, int));
|
||||
extern int count6bits __P((u_32_t *));
|
||||
extern int count4bits __P((u_32_t));
|
||||
extern char *fac_toname __P((int));
|
||||
extern int fac_findname __P((char *));
|
||||
extern const char *familyname __P((const int));
|
||||
extern void fill6bits __P((int, u_int *));
|
||||
extern wordtab_t *findword __P((wordtab_t *, char *));
|
||||
extern int ftov __P((int));
|
||||
extern char *ipf_geterror __P((int, ioctlfunc_t *));
|
||||
extern int genmask __P((int, char *, i6addr_t *));
|
||||
extern int gethost __P((int, char *, i6addr_t *));
|
||||
extern int geticmptype __P((int, char *));
|
||||
extern int getport __P((struct frentry *, char *, u_short *, char *));
|
||||
extern int getportproto __P((char *, int));
|
||||
extern int getproto __P((char *));
|
||||
extern char *getnattype __P((struct nat *));
|
||||
extern char *getsumd __P((u_32_t));
|
||||
extern u_32_t getoptbyname __P((char *));
|
||||
extern u_32_t getoptbyvalue __P((int));
|
||||
extern u_32_t getv6optbyname __P((char *));
|
||||
extern u_32_t getv6optbyvalue __P((int));
|
||||
extern char *icmptypename __P((int, int));
|
||||
extern void initparse __P((void));
|
||||
extern void ipf_dotuning __P((int, char *, ioctlfunc_t));
|
||||
extern int ipf_addrule __P((int, ioctlfunc_t, void *));
|
||||
extern void ipf_mutex_clean __P((void));
|
||||
extern int ipf_parsefile __P((int, addfunc_t, ioctlfunc_t *, char *));
|
||||
extern int ipf_parsesome __P((int, addfunc_t, ioctlfunc_t *, FILE *));
|
||||
extern void ipf_perror __P((int, char *));
|
||||
extern int ipf_perror_fd __P(( int, ioctlfunc_t, char *));
|
||||
extern void ipf_rwlock_clean __P((void));
|
||||
extern char *ipf_strerror __P((int));
|
||||
extern void ipferror __P((int, char *));
|
||||
extern int ipmon_parsefile __P((char *));
|
||||
extern int ipmon_parsesome __P((FILE *));
|
||||
extern int ipnat_addrule __P((int, ioctlfunc_t, void *));
|
||||
extern int ipnat_parsefile __P((int, addfunc_t, ioctlfunc_t, char *));
|
||||
extern int ipnat_parsesome __P((int, addfunc_t, ioctlfunc_t, FILE *));
|
||||
extern int ippool_parsefile __P((int, char *, ioctlfunc_t));
|
||||
extern int ippool_parsesome __P((int, FILE *, ioctlfunc_t));
|
||||
extern int kmemcpywrap __P((void *, void *, size_t));
|
||||
extern char *kvatoname __P((ipfunc_t, ioctlfunc_t));
|
||||
extern int load_dstlist __P((struct ippool_dst *, ioctlfunc_t,
|
||||
ipf_dstnode_t *));
|
||||
extern int load_dstlistnode __P((int, char *, struct ipf_dstnode *,
|
||||
ioctlfunc_t));
|
||||
extern alist_t *load_file __P((char *));
|
||||
extern int load_hash __P((struct iphtable_s *, struct iphtent_s *,
|
||||
ioctlfunc_t));
|
||||
extern int load_hashnode __P((int, char *, struct iphtent_s *, int,
|
||||
ioctlfunc_t));
|
||||
extern alist_t *load_http __P((char *));
|
||||
extern int load_pool __P((struct ip_pool_s *list, ioctlfunc_t));
|
||||
extern int load_poolnode __P((int, char *, ip_pool_node_t *, int, ioctlfunc_t));
|
||||
extern alist_t *load_url __P((char *));
|
||||
extern alist_t *make_range __P((int, struct in_addr, struct in_addr));
|
||||
extern void mb_hexdump __P((mb_t *, FILE *));
|
||||
extern ipfunc_t nametokva __P((char *, ioctlfunc_t));
|
||||
extern void nat_setgroupmap __P((struct ipnat *));
|
||||
extern int ntomask __P((int, int, u_32_t *));
|
||||
extern u_32_t optname __P((char ***, u_short *, int));
|
||||
extern wordtab_t *parsefields __P((wordtab_t *, char *));
|
||||
extern int *parseipfexpr __P((char *, char **));
|
||||
extern int parsewhoisline __P((char *, addrfamily_t *, addrfamily_t *));
|
||||
extern void pool_close __P((void));
|
||||
extern int pool_fd __P((void));
|
||||
extern int pool_ioctl __P((ioctlfunc_t, ioctlcmd_t, void *));
|
||||
extern int pool_open __P((void));
|
||||
extern char *portname __P((int, int));
|
||||
extern int pri_findname __P((char *));
|
||||
extern char *pri_toname __P((int));
|
||||
extern void print_toif __P((int, char *, char *, struct frdest *));
|
||||
extern void printaps __P((ap_session_t *, int, int));
|
||||
extern void printaddr __P((int, int, char *, int, u_32_t *, u_32_t *));
|
||||
extern void printbuf __P((char *, int, int));
|
||||
extern void printfieldhdr __P((wordtab_t *, wordtab_t *));
|
||||
extern void printfr __P((struct frentry *, ioctlfunc_t));
|
||||
extern struct iphtable_s *printhash __P((struct iphtable_s *, copyfunc_t,
|
||||
char *, int, wordtab_t *));
|
||||
extern struct iphtable_s *printhash_live __P((iphtable_t *, int, char *,
|
||||
int, wordtab_t *));
|
||||
extern ippool_dst_t *printdstl_live __P((ippool_dst_t *, int, char *,
|
||||
int, wordtab_t *));
|
||||
extern void printhashdata __P((iphtable_t *, int));
|
||||
extern struct iphtent_s *printhashnode __P((struct iphtable_s *,
|
||||
extern int addicmp(char ***, struct frentry *, int);
|
||||
extern int addipopt(char *, struct ipopt_names *, int, char *);
|
||||
extern int addkeep(char ***, struct frentry *, int);
|
||||
extern alist_t *alist_new(int, char *);
|
||||
extern void alist_free(alist_t *);
|
||||
extern void assigndefined(char *);
|
||||
extern void binprint(void *, size_t);
|
||||
extern u_32_t buildopts(char *, char *, int);
|
||||
extern int checkrev(char *);
|
||||
extern int connecttcp(char *, int);
|
||||
extern int count6bits(u_32_t *);
|
||||
extern int count4bits(u_32_t);
|
||||
extern char *fac_toname(int);
|
||||
extern int fac_findname(char *);
|
||||
extern const char *familyname(const int);
|
||||
extern void fill6bits(int, u_int *);
|
||||
extern wordtab_t *findword(wordtab_t *, char *);
|
||||
extern int ftov(int);
|
||||
extern char *ipf_geterror(int, ioctlfunc_t *);
|
||||
extern int genmask(int, char *, i6addr_t *);
|
||||
extern int gethost(int, char *, i6addr_t *);
|
||||
extern int geticmptype(int, char *);
|
||||
extern int getport(struct frentry *, char *, u_short *, char *);
|
||||
extern int getportproto(char *, int);
|
||||
extern int getproto(char *);
|
||||
extern char *getnattype(struct nat *);
|
||||
extern char *getsumd(u_32_t);
|
||||
extern u_32_t getoptbyname(char *);
|
||||
extern u_32_t getoptbyvalue(int);
|
||||
extern u_32_t getv6optbyname(char *);
|
||||
extern u_32_t getv6optbyvalue(int);
|
||||
extern char *icmptypename(int, int);
|
||||
extern void initparse(void);
|
||||
extern void ipf_dotuning(int, char *, ioctlfunc_t);
|
||||
extern int ipf_addrule(int, ioctlfunc_t, void *);
|
||||
extern void ipf_mutex_clean(void);
|
||||
extern int ipf_parsefile(int, addfunc_t, ioctlfunc_t *, char *);
|
||||
extern int ipf_parsesome(int, addfunc_t, ioctlfunc_t *, FILE *);
|
||||
extern void ipf_perror(int, char *);
|
||||
extern int ipf_perror_fd( int, ioctlfunc_t, char *);
|
||||
extern void ipf_rwlock_clean(void);
|
||||
extern char *ipf_strerror(int);
|
||||
extern void ipferror(int, char *);
|
||||
extern int ipmon_parsefile(char *);
|
||||
extern int ipmon_parsesome(FILE *);
|
||||
extern int ipnat_addrule(int, ioctlfunc_t, void *);
|
||||
extern int ipnat_parsefile(int, addfunc_t, ioctlfunc_t, char *);
|
||||
extern int ipnat_parsesome(int, addfunc_t, ioctlfunc_t, FILE *);
|
||||
extern int ippool_parsefile(int, char *, ioctlfunc_t);
|
||||
extern int ippool_parsesome(int, FILE *, ioctlfunc_t);
|
||||
extern int kmemcpywrap(void *, void *, size_t);
|
||||
extern char *kvatoname(ipfunc_t, ioctlfunc_t);
|
||||
extern int load_dstlist(struct ippool_dst *, ioctlfunc_t,
|
||||
ipf_dstnode_t *);
|
||||
extern int load_dstlistnode(int, char *, struct ipf_dstnode *,
|
||||
ioctlfunc_t);
|
||||
extern alist_t *load_file(char *);
|
||||
extern int load_hash(struct iphtable_s *, struct iphtent_s *,
|
||||
ioctlfunc_t);
|
||||
extern int load_hashnode(int, char *, struct iphtent_s *, int,
|
||||
ioctlfunc_t);
|
||||
extern alist_t *load_http(char *);
|
||||
extern int load_pool(struct ip_pool_s *list, ioctlfunc_t);
|
||||
extern int load_poolnode(int, char *, ip_pool_node_t *, int, ioctlfunc_t);
|
||||
extern alist_t *load_url(char *);
|
||||
extern alist_t *make_range(int, struct in_addr, struct in_addr);
|
||||
extern void mb_hexdump(mb_t *, FILE *);
|
||||
extern ipfunc_t nametokva(char *, ioctlfunc_t);
|
||||
extern void nat_setgroupmap(struct ipnat *);
|
||||
extern int ntomask(int, int, u_32_t *);
|
||||
extern u_32_t optname(char ***, u_short *, int);
|
||||
extern wordtab_t *parsefields(wordtab_t *, char *);
|
||||
extern int *parseipfexpr(char *, char **);
|
||||
extern int parsewhoisline(char *, addrfamily_t *, addrfamily_t *);
|
||||
extern void pool_close(void);
|
||||
extern int pool_fd(void);
|
||||
extern int pool_ioctl(ioctlfunc_t, ioctlcmd_t, void *);
|
||||
extern int pool_open(void);
|
||||
extern char *portname(int, int);
|
||||
extern int pri_findname(char *);
|
||||
extern char *pri_toname(int);
|
||||
extern void print_toif(int, char *, char *, struct frdest *);
|
||||
extern void printaps(ap_session_t *, int, int);
|
||||
extern void printaddr(int, int, char *, int, u_32_t *, u_32_t *);
|
||||
extern void printbuf(char *, int, int);
|
||||
extern void printfieldhdr(wordtab_t *, wordtab_t *);
|
||||
extern void printfr(struct frentry *, ioctlfunc_t);
|
||||
extern struct iphtable_s *printhash(struct iphtable_s *, copyfunc_t,
|
||||
char *, int, wordtab_t *);
|
||||
extern struct iphtable_s *printhash_live(iphtable_t *, int, char *,
|
||||
int, wordtab_t *);
|
||||
extern ippool_dst_t *printdstl_live(ippool_dst_t *, int, char *,
|
||||
int, wordtab_t *);
|
||||
extern void printhashdata(iphtable_t *, int);
|
||||
extern struct iphtent_s *printhashnode(struct iphtable_s *,
|
||||
struct iphtent_s *,
|
||||
copyfunc_t, int, wordtab_t *));
|
||||
extern void printhost __P((int, u_32_t *));
|
||||
extern void printhostmask __P((int, u_32_t *, u_32_t *));
|
||||
extern void printip __P((int, u_32_t *));
|
||||
extern void printlog __P((struct frentry *));
|
||||
extern void printlookup __P((char *, i6addr_t *addr, i6addr_t *mask));
|
||||
extern void printmask __P((int, u_32_t *));
|
||||
extern void printnataddr __P((int, char *, nat_addr_t *, int));
|
||||
extern void printnatfield __P((nat_t *, int));
|
||||
extern void printnatside __P((char *, nat_stat_side_t *));
|
||||
extern void printpacket __P((int, mb_t *));
|
||||
extern void printpacket6 __P((int, mb_t *));
|
||||
extern struct ippool_dst *printdstlist __P((struct ippool_dst *, copyfunc_t,
|
||||
copyfunc_t, int, wordtab_t *);
|
||||
extern void printhost(int, u_32_t *);
|
||||
extern void printhostmask(int, u_32_t *, u_32_t *);
|
||||
extern void printip(int, u_32_t *);
|
||||
extern void printlog(struct frentry *);
|
||||
extern void printlookup(char *, i6addr_t *addr, i6addr_t *mask);
|
||||
extern void printmask(int, u_32_t *);
|
||||
extern void printnataddr(int, char *, nat_addr_t *, int);
|
||||
extern void printnatfield(nat_t *, int);
|
||||
extern void printnatside(char *, nat_stat_side_t *);
|
||||
extern void printpacket(int, mb_t *);
|
||||
extern void printpacket6(int, mb_t *);
|
||||
extern struct ippool_dst *printdstlist(struct ippool_dst *, copyfunc_t,
|
||||
char *, int, ipf_dstnode_t *,
|
||||
wordtab_t *));
|
||||
extern void printdstlistdata __P((ippool_dst_t *, int));
|
||||
extern ipf_dstnode_t *printdstlistnode __P((ipf_dstnode_t *, copyfunc_t,
|
||||
int, wordtab_t *));
|
||||
extern void printdstlistpolicy __P((ippool_policy_t));
|
||||
extern struct ip_pool_s *printpool __P((struct ip_pool_s *, copyfunc_t,
|
||||
char *, int, wordtab_t *));
|
||||
extern struct ip_pool_s *printpool_live __P((struct ip_pool_s *, int,
|
||||
char *, int, wordtab_t *));
|
||||
extern void printpooldata __P((ip_pool_t *, int));
|
||||
extern void printpoolfield __P((void *, int, int));
|
||||
extern struct ip_pool_node *printpoolnode __P((struct ip_pool_node *,
|
||||
int, wordtab_t *));
|
||||
extern void printproto __P((struct protoent *, int, struct ipnat *));
|
||||
extern void printportcmp __P((int, struct frpcmp *));
|
||||
extern void printstatefield __P((ipstate_t *, int));
|
||||
extern void printtqtable __P((ipftq_t *));
|
||||
extern void printtunable __P((ipftune_t *));
|
||||
extern void printunit __P((int));
|
||||
extern void optprint __P((u_short *, u_long, u_long));
|
||||
wordtab_t *);
|
||||
extern void printdstlistdata(ippool_dst_t *, int);
|
||||
extern ipf_dstnode_t *printdstlistnode(ipf_dstnode_t *, copyfunc_t,
|
||||
int, wordtab_t *);
|
||||
extern void printdstlistpolicy(ippool_policy_t);
|
||||
extern struct ip_pool_s *printpool(struct ip_pool_s *, copyfunc_t,
|
||||
char *, int, wordtab_t *);
|
||||
extern struct ip_pool_s *printpool_live(struct ip_pool_s *, int,
|
||||
char *, int, wordtab_t *);
|
||||
extern void printpooldata(ip_pool_t *, int);
|
||||
extern void printpoolfield(void *, int, int);
|
||||
extern struct ip_pool_node *printpoolnode(struct ip_pool_node *,
|
||||
int, wordtab_t *);
|
||||
extern void printproto(struct protoent *, int, struct ipnat *);
|
||||
extern void printportcmp(int, struct frpcmp *);
|
||||
extern void printstatefield(ipstate_t *, int);
|
||||
extern void printtqtable(ipftq_t *);
|
||||
extern void printtunable(ipftune_t *);
|
||||
extern void printunit(int);
|
||||
extern void optprint(u_short *, u_long, u_long);
|
||||
#ifdef USE_INET6
|
||||
extern void optprintv6 __P((u_short *, u_long, u_long));
|
||||
extern void optprintv6(u_short *, u_long, u_long);
|
||||
#endif
|
||||
extern int remove_hash __P((struct iphtable_s *, ioctlfunc_t));
|
||||
extern int remove_hashnode __P((int, char *, struct iphtent_s *, ioctlfunc_t));
|
||||
extern int remove_pool __P((ip_pool_t *, ioctlfunc_t));
|
||||
extern int remove_poolnode __P((int, char *, ip_pool_node_t *, ioctlfunc_t));
|
||||
extern u_char tcpflags __P((char *));
|
||||
extern void printc __P((struct frentry *));
|
||||
extern void printC __P((int));
|
||||
extern void emit __P((int, int, void *, struct frentry *));
|
||||
extern u_char secbit __P((int));
|
||||
extern u_char seclevel __P((char *));
|
||||
extern void printfraginfo __P((char *, struct ipfr *));
|
||||
extern void printifname __P((char *, char *, void *));
|
||||
extern char *hostname __P((int, void *));
|
||||
extern struct ipstate *printstate __P((struct ipstate *, int, u_long));
|
||||
extern void printsbuf __P((char *));
|
||||
extern void printnat __P((struct ipnat *, int));
|
||||
extern void printactiveaddress __P((int, char *, i6addr_t *, char *));
|
||||
extern void printactivenat __P((struct nat *, int, u_long));
|
||||
extern void printhostmap __P((struct hostmap *, u_int));
|
||||
extern void printtcpflags __P((u_32_t, u_32_t));
|
||||
extern void printipfexpr __P((int *));
|
||||
extern void printstatefield __P((ipstate_t *, int));
|
||||
extern void printstatefieldhdr __P((int));
|
||||
extern int sendtrap_v1_0 __P((int, char *, char *, int, time_t));
|
||||
extern int sendtrap_v2_0 __P((int, char *, char *, int));
|
||||
extern int vtof __P((int));
|
||||
extern int remove_hash(struct iphtable_s *, ioctlfunc_t);
|
||||
extern int remove_hashnode(int, char *, struct iphtent_s *, ioctlfunc_t);
|
||||
extern int remove_pool(ip_pool_t *, ioctlfunc_t);
|
||||
extern int remove_poolnode(int, char *, ip_pool_node_t *, ioctlfunc_t);
|
||||
extern u_char tcpflags(char *);
|
||||
extern void printc(struct frentry *);
|
||||
extern void printC(int);
|
||||
extern void emit(int, int, void *, struct frentry *);
|
||||
extern u_char secbit(int);
|
||||
extern u_char seclevel(char *);
|
||||
extern void printfraginfo(char *, struct ipfr *);
|
||||
extern void printifname(char *, char *, void *);
|
||||
extern char *hostname(int, void *);
|
||||
extern struct ipstate *printstate(struct ipstate *, int, u_long);
|
||||
extern void printsbuf(char *);
|
||||
extern void printnat(struct ipnat *, int);
|
||||
extern void printactiveaddress(int, char *, i6addr_t *, char *);
|
||||
extern void printactivenat(struct nat *, int, u_long);
|
||||
extern void printhostmap(struct hostmap *, u_int);
|
||||
extern void printtcpflags(u_32_t, u_32_t);
|
||||
extern void printipfexpr(int *);
|
||||
extern void printstatefield(ipstate_t *, int);
|
||||
extern void printstatefieldhdr(int);
|
||||
extern int sendtrap_v1_0(int, char *, char *, int, time_t);
|
||||
extern int sendtrap_v2_0(int, char *, char *, int);
|
||||
extern int vtof(int);
|
||||
|
||||
extern void set_variable __P((char *, char *));
|
||||
extern char *get_variable __P((char *, char **, int));
|
||||
extern void resetlexer __P((void));
|
||||
extern void set_variable(char *, char *);
|
||||
extern char *get_variable(char *, char **, int);
|
||||
extern void resetlexer(void);
|
||||
|
||||
extern void debug __P((int, char *, ...));
|
||||
extern void verbose __P((int, char *, ...));
|
||||
extern void ipfkdebug __P((char *, ...));
|
||||
extern void ipfkverbose __P((char *, ...));
|
||||
extern void debug(int, char *, ...);
|
||||
extern void verbose(int, char *, ...);
|
||||
extern void ipfkdebug(char *, ...);
|
||||
extern void ipfkverbose(char *, ...);
|
||||
|
||||
#if SOLARIS
|
||||
extern int gethostname __P((char *, int ));
|
||||
extern void sync __P((void));
|
||||
extern int gethostname(char *, int );
|
||||
extern void sync(void);
|
||||
#endif
|
||||
|
||||
#endif /* __IPF_H__ */
|
||||
|
@ -50,5 +50,5 @@ typedef struct aniphdr {
|
||||
#define ah_udp ah_un.ahu_udp
|
||||
#define ah_icmp ah_un.ahu_icmp
|
||||
|
||||
extern int get_arpipv4 __P((char *, char *));
|
||||
extern int get_arpipv4(char *, char *);
|
||||
|
||||
|
@ -29,14 +29,14 @@ extern int opts;
|
||||
int lineNum = 0, ipproto = 0, oldipproto = 0, next = -1, laststate = 0;
|
||||
int *prstack = NULL, numpr = 0, state = 0, token = 0;
|
||||
|
||||
void yyerror __P((char *));
|
||||
void push_proto __P((void));
|
||||
void pop_proto __P((void));
|
||||
int next_state __P((int, int));
|
||||
int next_item __P((int));
|
||||
int save_token __P((void));
|
||||
void swallow __P((void));
|
||||
int yylex __P((void));
|
||||
void yyerror(char *);
|
||||
void push_proto(void);
|
||||
void pop_proto(void);
|
||||
int next_state(int, int);
|
||||
int next_item(int);
|
||||
int save_token(void);
|
||||
void swallow(void);
|
||||
int yylex(void);
|
||||
|
||||
struct lwordtab {
|
||||
char *word;
|
||||
|
@ -59,8 +59,8 @@ arp_t *arplist = NULL, **arptail = &arplist, *carp = NULL;
|
||||
struct in_addr defrouter;
|
||||
send_t sending;
|
||||
char *sclass = NULL;
|
||||
u_short c_chksum __P((u_short *, u_int, u_long));
|
||||
u_long p_chksum __P((u_short *, u_int));
|
||||
u_short c_chksum(u_short *, u_int, u_long);
|
||||
u_long p_chksum(u_short *, u_int);
|
||||
|
||||
u_long ipbuffer[67584/sizeof(u_long)]; /* 66K */
|
||||
aniphdr_t *aniphead = NULL, *canip = NULL, **aniptail = &aniphead;
|
||||
@ -74,85 +74,85 @@ struct statetoopt {
|
||||
int sto_op;
|
||||
};
|
||||
|
||||
struct in_addr getipv4addr __P((char *arg));
|
||||
u_short getportnum __P((char *, char *));
|
||||
struct ether_addr *geteaddr __P((char *, struct ether_addr *));
|
||||
void *new_header __P((int));
|
||||
void free_aniplist __P((void));
|
||||
void inc_anipheaders __P((int));
|
||||
void new_data __P((void));
|
||||
void set_datalen __P((char **));
|
||||
void set_datafile __P((char **));
|
||||
void set_data __P((char **));
|
||||
void new_packet __P((void));
|
||||
void set_ipv4proto __P((char **));
|
||||
void set_ipv4src __P((char **));
|
||||
void set_ipv4dst __P((char **));
|
||||
void set_ipv4off __P((char **));
|
||||
void set_ipv4v __P((char **));
|
||||
void set_ipv4hl __P((char **));
|
||||
void set_ipv4ttl __P((char **));
|
||||
void set_ipv4tos __P((char **));
|
||||
void set_ipv4id __P((char **));
|
||||
void set_ipv4sum __P((char **));
|
||||
void set_ipv4len __P((char **));
|
||||
void new_tcpheader __P((void));
|
||||
void set_tcpsport __P((char **));
|
||||
void set_tcpdport __P((char **));
|
||||
void set_tcpseq __P((char **));
|
||||
void set_tcpack __P((char **));
|
||||
void set_tcpoff __P((char **));
|
||||
void set_tcpurp __P((char **));
|
||||
void set_tcpwin __P((char **));
|
||||
void set_tcpsum __P((char **));
|
||||
void set_tcpflags __P((char **));
|
||||
void set_tcpopt __P((int, char **));
|
||||
void end_tcpopt __P((void));
|
||||
void new_udpheader __P((void));
|
||||
void set_udplen __P((char **));
|
||||
void set_udpsum __P((char **));
|
||||
void prep_packet __P((void));
|
||||
void packet_done __P((void));
|
||||
void new_interface __P((void));
|
||||
void check_interface __P((void));
|
||||
void set_ifname __P((char **));
|
||||
void set_ifmtu __P((int));
|
||||
void set_ifv4addr __P((char **));
|
||||
void set_ifeaddr __P((char **));
|
||||
void new_arp __P((void));
|
||||
void set_arpeaddr __P((char **));
|
||||
void set_arpv4addr __P((char **));
|
||||
void reset_send __P((void));
|
||||
void set_sendif __P((char **));
|
||||
void set_sendvia __P((char **));
|
||||
void set_defaultrouter __P((char **));
|
||||
void new_icmpheader __P((void));
|
||||
void set_icmpcode __P((int));
|
||||
void set_icmptype __P((int));
|
||||
void set_icmpcodetok __P((char **));
|
||||
void set_icmptypetok __P((char **));
|
||||
void set_icmpid __P((int));
|
||||
void set_icmpseq __P((int));
|
||||
void set_icmpotime __P((int));
|
||||
void set_icmprtime __P((int));
|
||||
void set_icmpttime __P((int));
|
||||
void set_icmpmtu __P((int));
|
||||
void set_redir __P((int, char **));
|
||||
void new_ipv4opt __P((void));
|
||||
void set_icmppprob __P((int));
|
||||
void add_ipopt __P((int, void *));
|
||||
void end_ipopt __P((void));
|
||||
void set_secclass __P((char **));
|
||||
void free_anipheader __P((void));
|
||||
void end_ipv4 __P((void));
|
||||
void end_icmp __P((void));
|
||||
void end_udp __P((void));
|
||||
void end_tcp __P((void));
|
||||
void end_data __P((void));
|
||||
void yyerror __P((char *));
|
||||
void iplang __P((FILE *));
|
||||
int arp_getipv4 __P((char *, char *));
|
||||
int yyparse __P((void));
|
||||
struct in_addr getipv4addr(char *arg);
|
||||
u_short getportnum(char *, char *);
|
||||
struct ether_addr *geteaddr(char *, struct ether_addr *);
|
||||
void *new_header(int);
|
||||
void free_aniplist(void);
|
||||
void inc_anipheaders(int);
|
||||
void new_data(void);
|
||||
void set_datalen(char **);
|
||||
void set_datafile(char **);
|
||||
void set_data(char **);
|
||||
void new_packet(void);
|
||||
void set_ipv4proto(char **);
|
||||
void set_ipv4src(char **);
|
||||
void set_ipv4dst(char **);
|
||||
void set_ipv4off(char **);
|
||||
void set_ipv4v(char **);
|
||||
void set_ipv4hl(char **);
|
||||
void set_ipv4ttl(char **);
|
||||
void set_ipv4tos(char **);
|
||||
void set_ipv4id(char **);
|
||||
void set_ipv4sum(char **);
|
||||
void set_ipv4len(char **);
|
||||
void new_tcpheader(void);
|
||||
void set_tcpsport(char **);
|
||||
void set_tcpdport(char **);
|
||||
void set_tcpseq(char **);
|
||||
void set_tcpack(char **);
|
||||
void set_tcpoff(char **);
|
||||
void set_tcpurp(char **);
|
||||
void set_tcpwin(char **);
|
||||
void set_tcpsum(char **);
|
||||
void set_tcpflags(char **);
|
||||
void set_tcpopt(int, char **);
|
||||
void end_tcpopt(void);
|
||||
void new_udpheader(void);
|
||||
void set_udplen(char **);
|
||||
void set_udpsum(char **);
|
||||
void prep_packet(void);
|
||||
void packet_done(void);
|
||||
void new_interface(void);
|
||||
void check_interface(void);
|
||||
void set_ifname(char **);
|
||||
void set_ifmtu(int);
|
||||
void set_ifv4addr(char **);
|
||||
void set_ifeaddr(char **);
|
||||
void new_arp(void);
|
||||
void set_arpeaddr(char **);
|
||||
void set_arpv4addr(char **);
|
||||
void reset_send(void);
|
||||
void set_sendif(char **);
|
||||
void set_sendvia(char **);
|
||||
void set_defaultrouter(char **);
|
||||
void new_icmpheader(void);
|
||||
void set_icmpcode(int);
|
||||
void set_icmptype(int);
|
||||
void set_icmpcodetok(char **);
|
||||
void set_icmptypetok(char **);
|
||||
void set_icmpid(int);
|
||||
void set_icmpseq(int);
|
||||
void set_icmpotime(int);
|
||||
void set_icmprtime(int);
|
||||
void set_icmpttime(int);
|
||||
void set_icmpmtu(int);
|
||||
void set_redir(int, char **);
|
||||
void new_ipv4opt(void);
|
||||
void set_icmppprob(int);
|
||||
void add_ipopt(int, void *);
|
||||
void end_ipopt(void);
|
||||
void set_secclass(char **);
|
||||
void free_anipheader(void);
|
||||
void end_ipv4(void);
|
||||
void end_icmp(void);
|
||||
void end_udp(void);
|
||||
void end_tcp(void);
|
||||
void end_data(void);
|
||||
void yyerror(char *);
|
||||
void iplang(FILE *);
|
||||
int arp_getipv4(char *, char *);
|
||||
int yyparse(void);
|
||||
%}
|
||||
%union {
|
||||
char *str;
|
||||
|
@ -132,11 +132,11 @@ typedef struct ipmon_action {
|
||||
#define LOGFAC LOG_LOCAL0
|
||||
#endif
|
||||
|
||||
extern void dump_config __P((void));
|
||||
extern int load_config __P((char *));
|
||||
extern void unload_config __P((void));
|
||||
extern void dumphex __P((FILE *, int, char *, int));
|
||||
extern int check_action __P((char *, char *, int, int));
|
||||
extern char *getword __P((int));
|
||||
extern void *add_doing __P((ipmon_saver_t *));
|
||||
extern void dump_config(void);
|
||||
extern int load_config(char *);
|
||||
extern void unload_config(void);
|
||||
extern void dumphex(FILE *, int, char *, int);
|
||||
extern int check_action(char *, char *, int, int);
|
||||
extern char *getword(int);
|
||||
extern void *add_doing(ipmon_saver_t *);
|
||||
|
||||
|
@ -45,8 +45,8 @@ char default_device[] = DEFAULT_DEVICE;
|
||||
#endif
|
||||
|
||||
|
||||
static void usage __P((char *));
|
||||
int main __P((int, char **));
|
||||
static void usage(char *);
|
||||
int main(int, char **);
|
||||
|
||||
|
||||
static void usage(prog)
|
||||
|
@ -29,17 +29,17 @@ static const char rcsid[] = "@(#)$Id$";
|
||||
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
extern void iplang __P((FILE *));
|
||||
extern void iplang(FILE *);
|
||||
|
||||
char options[68];
|
||||
int opts;
|
||||
char default_device[] = "le0";
|
||||
|
||||
|
||||
static void usage __P((char *));
|
||||
static void do_icmp __P((ip_t *, char *));
|
||||
static void usage(char *);
|
||||
static void do_icmp(ip_t *, char *);
|
||||
void udpcksum(ip_t *, struct udphdr *, int);
|
||||
int main __P((int, char **));
|
||||
int main(int, char **);
|
||||
|
||||
|
||||
static void usage(prog)
|
||||
|
@ -27,33 +27,33 @@
|
||||
#include "netinet/tcpip.h"
|
||||
#include "ipt.h"
|
||||
|
||||
extern int resolve __P((char *, char *));
|
||||
extern int arp __P((char *, char *));
|
||||
extern u_short chksum __P((u_short *, int));
|
||||
extern int send_ether __P((int, char *, int, struct in_addr));
|
||||
extern int send_ip __P((int, int, ip_t *, struct in_addr, int));
|
||||
extern int send_tcp __P((int, int, ip_t *, struct in_addr));
|
||||
extern int send_udp __P((int, int, ip_t *, struct in_addr));
|
||||
extern int send_icmp __P((int, int, ip_t *, struct in_addr));
|
||||
extern int send_packet __P((int, int, ip_t *, struct in_addr));
|
||||
extern int send_packets __P((char *, int, ip_t *, struct in_addr));
|
||||
extern u_short ipseclevel __P((char *));
|
||||
extern u_32_t buildopts __P((char *, char *, int));
|
||||
extern int addipopt __P((char *, struct ipopt_names *, int, char *));
|
||||
extern int initdevice __P((char *, int));
|
||||
extern int sendip __P((int, char *, int));
|
||||
extern struct tcpcb *find_tcp __P((int, struct tcpiphdr *));
|
||||
extern int ip_resend __P((char *, int, struct ipread *, struct in_addr, char *));
|
||||
extern int resolve(char *, char *);
|
||||
extern int arp(char *, char *);
|
||||
extern u_short chksum(u_short *, int);
|
||||
extern int send_ether(int, char *, int, struct in_addr);
|
||||
extern int send_ip(int, int, ip_t *, struct in_addr, int);
|
||||
extern int send_tcp(int, int, ip_t *, struct in_addr);
|
||||
extern int send_udp(int, int, ip_t *, struct in_addr);
|
||||
extern int send_icmp(int, int, ip_t *, struct in_addr);
|
||||
extern int send_packet(int, int, ip_t *, struct in_addr);
|
||||
extern int send_packets(char *, int, ip_t *, struct in_addr);
|
||||
extern u_short ipseclevel(char *);
|
||||
extern u_32_t buildopts(char *, char *, int);
|
||||
extern int addipopt(char *, struct ipopt_names *, int, char *);
|
||||
extern int initdevice(char *, int);
|
||||
extern int sendip(int, char *, int);
|
||||
extern struct tcpcb *find_tcp(int, struct tcpiphdr *);
|
||||
extern int ip_resend(char *, int, struct ipread *, struct in_addr, char *);
|
||||
|
||||
extern void ip_test1 __P((char *, int, ip_t *, struct in_addr, int));
|
||||
extern void ip_test2 __P((char *, int, ip_t *, struct in_addr, int));
|
||||
extern void ip_test3 __P((char *, int, ip_t *, struct in_addr, int));
|
||||
extern void ip_test4 __P((char *, int, ip_t *, struct in_addr, int));
|
||||
extern void ip_test5 __P((char *, int, ip_t *, struct in_addr, int));
|
||||
extern void ip_test6 __P((char *, int, ip_t *, struct in_addr, int));
|
||||
extern void ip_test7 __P((char *, int, ip_t *, struct in_addr, int));
|
||||
extern int do_socket __P((char *, int, struct tcpiphdr *, struct in_addr));
|
||||
extern int kmemcpy __P((char *, void *, int));
|
||||
extern void ip_test1(char *, int, ip_t *, struct in_addr, int);
|
||||
extern void ip_test2(char *, int, ip_t *, struct in_addr, int);
|
||||
extern void ip_test3(char *, int, ip_t *, struct in_addr, int);
|
||||
extern void ip_test4(char *, int, ip_t *, struct in_addr, int);
|
||||
extern void ip_test5(char *, int, ip_t *, struct in_addr, int);
|
||||
extern void ip_test6(char *, int, ip_t *, struct in_addr, int);
|
||||
extern void ip_test7(char *, int, ip_t *, struct in_addr, int);
|
||||
extern int do_socket(char *, int, struct tcpiphdr *, struct in_addr);
|
||||
extern int kmemcpy(char *, void *, int);
|
||||
|
||||
#define KMCPY(a,b,c) kmemcpy((char *)(a), (void *)(b), (int)(c))
|
||||
|
||||
|
@ -37,8 +37,8 @@ char default_device[] = "le0";
|
||||
char default_device[] = "lan0";
|
||||
# endif
|
||||
|
||||
static void usage __P((char *));
|
||||
int main __P((int, char **));
|
||||
static void usage(char *);
|
||||
int main(int, char **);
|
||||
|
||||
|
||||
static void usage(prog)
|
||||
|
@ -30,7 +30,7 @@ static const char rcsid[] = "@(#)$Id$";
|
||||
|
||||
extern int opts;
|
||||
|
||||
void dumppacket __P((ip_t *));
|
||||
void dumppacket(ip_t *);
|
||||
|
||||
|
||||
void dumppacket(ip)
|
||||
|
@ -96,9 +96,9 @@ struct proc *proc;
|
||||
|
||||
|
||||
#if BSD < 199103
|
||||
static struct proc *getproc __P((void));
|
||||
static struct proc *getproc(void);
|
||||
#else
|
||||
static struct kinfo_proc *getproc __P((void));
|
||||
static struct kinfo_proc *getproc(void);
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -24,9 +24,9 @@
|
||||
|
||||
|
||||
struct ipread {
|
||||
int (*r_open) __P((char *));
|
||||
int (*r_close) __P((void));
|
||||
int (*r_readip) __P((mb_t *, char **, int *));
|
||||
int (*r_open)(char *);
|
||||
int (*r_close)(void);
|
||||
int (*r_readip)(mb_t *, char **, int *);
|
||||
int r_flags;
|
||||
};
|
||||
|
||||
|
@ -13,9 +13,9 @@
|
||||
#ifndef __P
|
||||
# define __P(x) x
|
||||
#endif
|
||||
extern int openkmem __P((char *, char *));
|
||||
extern int kmemcpy __P((char *, long, int));
|
||||
extern int kstrncpy __P((char *, long, int));
|
||||
extern int openkmem(char *, char *);
|
||||
extern int kmemcpy(char *, long, int);
|
||||
extern int kstrncpy(char *, long, int);
|
||||
|
||||
#if defined(__NetBSD__) || defined(__OpenBSD)
|
||||
# include <paths.h>
|
||||
|
@ -16,11 +16,11 @@
|
||||
# define __P(x) x
|
||||
#endif
|
||||
|
||||
extern char *fac_toname __P((int));
|
||||
extern int fac_findname __P((char *));
|
||||
extern char *fac_toname(int);
|
||||
extern int fac_findname(char *);
|
||||
|
||||
extern char *pri_toname __P((int));
|
||||
extern int pri_findname __P((char *));
|
||||
extern char *pri_toname(int);
|
||||
extern int pri_findname(char *);
|
||||
|
||||
#ifdef P_DEF
|
||||
# undef __P
|
||||
|
@ -68,7 +68,7 @@ static const char rcsid[] = "@(#)$Id: inet_addr.c,v 1.8.2.3 2004/12/09 19:41:20
|
||||
#ifndef __P
|
||||
# define __P(x) x
|
||||
#endif
|
||||
int inet_aton __P((const char *, struct in_addr *));
|
||||
int inet_aton(const char *, struct in_addr *);
|
||||
|
||||
/*
|
||||
* Because the ctype(3) posix definition, if used "safely" in code everywhere,
|
||||
|
@ -13,7 +13,7 @@
|
||||
char thishost[MAXHOSTNAMELEN];
|
||||
|
||||
|
||||
void initparse __P((void))
|
||||
void initparse(void)
|
||||
{
|
||||
gethostname(thishost, sizeof(thishost));
|
||||
thishost[sizeof(thishost) - 1] = '\0';
|
||||
|
@ -15,7 +15,7 @@ typedef struct {
|
||||
char *iee_text;
|
||||
} ipf_error_entry_t;
|
||||
|
||||
static ipf_error_entry_t *find_error __P((int));
|
||||
static ipf_error_entry_t *find_error(int);
|
||||
|
||||
#define IPF_NUM_ERRORS 475
|
||||
|
||||
|
@ -18,10 +18,10 @@ static const char rcsid[] = "@(#)$Id$";
|
||||
|
||||
extern int opts;
|
||||
|
||||
static int hex_open __P((char *));
|
||||
static int hex_close __P((void));
|
||||
static int hex_readip __P((mb_t *, char **, int *));
|
||||
static char *readhex __P((char *, char *));
|
||||
static int hex_open(char *);
|
||||
static int hex_close(void);
|
||||
static int hex_readip(mb_t *, char **, int *);
|
||||
static char *readhex(char *, char *);
|
||||
|
||||
struct ipread iphex = { hex_open, hex_close, hex_readip, 0 };
|
||||
static FILE *tfp = NULL;
|
||||
|
@ -51,11 +51,11 @@ typedef struct {
|
||||
u_32_t wirelen;
|
||||
} packetheader_t;
|
||||
|
||||
static int ipcap_open __P((char *));
|
||||
static int ipcap_close __P((void));
|
||||
static int ipcap_readip __P((mb_t *, char **, int *));
|
||||
static int ipcap_read_rec __P((packetheader_t *));
|
||||
static void iswap_hdr __P((fileheader_t *));
|
||||
static int ipcap_open(char *);
|
||||
static int ipcap_close(void);
|
||||
static int ipcap_readip(mb_t *, char **, int *);
|
||||
static int ipcap_read_rec(packetheader_t *);
|
||||
static void iswap_hdr(fileheader_t *);
|
||||
|
||||
static int pfd = -1, swapped = 0;
|
||||
static struct llc *llcp = NULL;
|
||||
|
@ -21,9 +21,9 @@ extern int opts;
|
||||
|
||||
static char *tx_proto = "";
|
||||
|
||||
static int text_open __P((char *)), text_close __P((void));
|
||||
static int text_readip __P((mb_t *, char **, int *));
|
||||
static int parseline __P((char *, ip_t *, char **, int *));
|
||||
static int text_open(char *), text_close(void);
|
||||
static int text_readip(mb_t *, char **, int *);
|
||||
static int parseline(char *, ip_t *, char **, int *);
|
||||
|
||||
static char myflagset[] = "FSRPAUEC";
|
||||
static u_char myflags[] = { TH_FIN, TH_SYN, TH_RST, TH_PUSH,
|
||||
@ -33,11 +33,11 @@ struct ipread iptext = { text_open, text_close, text_readip, R_DO_CKSUM };
|
||||
static FILE *tfp = NULL;
|
||||
static int tfd = -1;
|
||||
|
||||
static u_32_t tx_hostnum __P((char *, int *));
|
||||
static u_short tx_portnum __P((char *));
|
||||
static u_32_t tx_hostnum(char *, int *);
|
||||
static u_short tx_portnum(char *);
|
||||
|
||||
#ifdef USE_INET6
|
||||
int parseipv6 __P((char **, ip6_t *, char **, int *));
|
||||
int parseipv6(char **, ip6_t *, char **, int *);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -13,9 +13,9 @@
|
||||
#ifndef __P
|
||||
# define __P(x) x
|
||||
#endif
|
||||
extern int openkmem __P((char *, char *));
|
||||
extern int kmemcpy __P((char *, long, int));
|
||||
extern int kstrncpy __P((char *, long, int));
|
||||
extern int openkmem(char *, char *);
|
||||
extern int kmemcpy(char *, long, int);
|
||||
extern int kstrncpy(char *, long, int);
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
# include <paths.h>
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include "ipf.h"
|
||||
|
||||
static void printport __P((int *));
|
||||
static void printhosts __P((int *));
|
||||
static void printsingle __P((int *));
|
||||
static void printport(int *);
|
||||
static void printhosts(int *);
|
||||
static void printsingle(int *);
|
||||
#ifdef USE_INET6
|
||||
static void printhostsv6 __P((int *));
|
||||
static void printhostsv6(int *);
|
||||
#endif
|
||||
|
||||
void
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include "ipf.h"
|
||||
#include "ipmon.h"
|
||||
|
||||
static void *execute_parse __P((char **));
|
||||
static void execute_destroy __P((void *));
|
||||
static int execute_send __P((void *, ipmon_msg_t *));
|
||||
static void execute_print __P((void *));
|
||||
static void *execute_parse(char **);
|
||||
static void execute_destroy(void *);
|
||||
static int execute_send(void *, ipmon_msg_t *);
|
||||
static void execute_print(void *);
|
||||
|
||||
typedef struct execute_opts_s {
|
||||
char *path;
|
||||
|
@ -1,12 +1,12 @@
|
||||
#include "ipf.h"
|
||||
#include "ipmon.h"
|
||||
|
||||
static void *file_parse __P((char **));
|
||||
static void file_destroy __P((void *));
|
||||
static int file_send __P((void *, ipmon_msg_t *));
|
||||
static void file_print __P((void *));
|
||||
static int file_match __P((void *, void *));
|
||||
static void *file_dup __P((void *));
|
||||
static void *file_parse(char **);
|
||||
static void file_destroy(void *);
|
||||
static int file_send(void *, ipmon_msg_t *);
|
||||
static void file_print(void *);
|
||||
static int file_match(void *, void *);
|
||||
static void *file_dup(void *);
|
||||
|
||||
typedef struct file_opts_s {
|
||||
FILE *fp;
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "ipf.h"
|
||||
#include "ipmon.h"
|
||||
|
||||
static void *nothing_parse __P((char **));
|
||||
static void nothing_destroy __P((void *));
|
||||
static int nothing_send __P((void *, ipmon_msg_t *));
|
||||
static void *nothing_parse(char **);
|
||||
static void nothing_destroy(void *);
|
||||
static int nothing_send(void *, ipmon_msg_t *);
|
||||
|
||||
typedef struct nothing_opts_s {
|
||||
FILE *fp;
|
||||
|
@ -2,10 +2,10 @@
|
||||
#include "ipmon.h"
|
||||
#include <syslog.h>
|
||||
|
||||
static void *syslog_parse __P((char **));
|
||||
static void syslog_destroy __P((void *));
|
||||
static int syslog_send __P((void *, ipmon_msg_t *));
|
||||
static void syslog_print __P((void *));
|
||||
static void *syslog_parse(char **);
|
||||
static void syslog_destroy(void *);
|
||||
static int syslog_send(void *, ipmon_msg_t *);
|
||||
static void syslog_print(void *);
|
||||
|
||||
typedef struct syslog_opts_s {
|
||||
int facpri;
|
||||
|
@ -12,16 +12,16 @@ static u_char ipf_enterprise[] = { 6, 7, 0x2b, 6, 1, 4, 1, 0xcd, 0x4c };
|
||||
static u_char ipf_trap0_1[] = { 6, 10, 0x2b, 6, 1, 4, 1, 0xcd, 0x4c, 1, 1, 1 };
|
||||
static u_char ipf_trap0_2[] = { 6, 10, 0x2b, 6, 1, 4, 1, 0xcd, 0x4c, 1, 1, 2 };
|
||||
|
||||
static int writeint __P((u_char *, int));
|
||||
static int writelength __P((u_char *, u_int));
|
||||
static int maketrap_v1 __P((char *, u_char *, int, u_char *, int, u_32_t,
|
||||
time_t));
|
||||
static void snmpv1_destroy __P((void *));
|
||||
static void *snmpv1_dup __P((void *));
|
||||
static int snmpv1_match __P((void *, void *));
|
||||
static void *snmpv1_parse __P((char **));
|
||||
static void snmpv1_print __P((void *));
|
||||
static int snmpv1_send __P((void *, ipmon_msg_t *));
|
||||
static int writeint(u_char *, int);
|
||||
static int writelength(u_char *, u_int);
|
||||
static int maketrap_v1(char *, u_char *, int, u_char *, int, u_32_t,
|
||||
time_t);
|
||||
static void snmpv1_destroy(void *);
|
||||
static void *snmpv1_dup(void *);
|
||||
static int snmpv1_match(void *, void *);
|
||||
static void *snmpv1_parse(char **);
|
||||
static void snmpv1_print(void *);
|
||||
static int snmpv1_send(void *, ipmon_msg_t *);
|
||||
|
||||
typedef struct snmpv1_opts_s {
|
||||
char *community;
|
||||
|
@ -11,18 +11,18 @@ static u_char sysuptime[] = { 6, 8, 0x2b, 6, 1, 2, 1, 1, 3, 0 };
|
||||
static u_char ipf_trap0_1[] = { 6, 10, 0x2b, 6, 1, 4, 1, 0xcd, 0x4c, 1, 1, 1 };
|
||||
static u_char ipf_trap0_2[] = { 6, 10, 0x2b, 6, 1, 4, 1, 0xcd, 0x4c, 1, 1, 2 };
|
||||
|
||||
static int writeint __P((u_char *, int));
|
||||
static int writelength __P((u_char *, u_int));
|
||||
static int maketrap_v2 __P((char *, u_char *, int, u_char *, int));
|
||||
static void snmpv2_destroy __P((void *));
|
||||
static void *snmpv2_dup __P((void *));
|
||||
static int snmpv2_match __P((void *, void *));
|
||||
static void *snmpv2_parse __P((char **));
|
||||
static void snmpv2_print __P((void *));
|
||||
static int snmpv2_send __P((void *, ipmon_msg_t *));
|
||||
static int writeint(u_char *, int);
|
||||
static int writelength(u_char *, u_int);
|
||||
static int maketrap_v2(char *, u_char *, int, u_char *, int);
|
||||
static void snmpv2_destroy(void *);
|
||||
static void *snmpv2_dup(void *);
|
||||
static int snmpv2_match(void *, void *);
|
||||
static void *snmpv2_parse(char **);
|
||||
static void snmpv2_print(void *);
|
||||
static int snmpv2_send(void *, ipmon_msg_t *);
|
||||
|
||||
|
||||
int sendtrap_v2_0 __P((int, char *, char *, int));
|
||||
int sendtrap_v2_0(int, char *, char *, int);
|
||||
|
||||
static char def_community[] = "public"; /* ublic */
|
||||
|
||||
|
@ -20,8 +20,8 @@ typedef struct variable {
|
||||
|
||||
static variable_t *vtop = NULL;
|
||||
|
||||
static variable_t *find_var __P((char *));
|
||||
static char *expand_string __P((char *, int));
|
||||
static variable_t *find_var(char *);
|
||||
static char *expand_string(char *, int);
|
||||
|
||||
|
||||
static variable_t *find_var(name)
|
||||
|
@ -90,7 +90,7 @@ typedef struct frentry {
|
||||
u_32_t fr_flags; /* per-rule flags && options (see below) */
|
||||
u_short fr_skip; /* # of rules to skip */
|
||||
u_short fr_loglevel; /* syslog log facility + priority */
|
||||
int (*fr_func) __P((int, ip_t *, fr_info_t *));
|
||||
int (*fr_func)(int, ip_t *, fr_info_t *));
|
||||
char fr_icode; /* return ICMP code */
|
||||
char fr_ifname[IFNAMSIZ];
|
||||
#if BSD > 199306
|
||||
|
@ -55,7 +55,7 @@
|
||||
*/
|
||||
|
||||
/* forward declaration */
|
||||
static void Transform __P((UINT4 *, UINT4 *));
|
||||
static void Transform(UINT4 *, UINT4 *);
|
||||
|
||||
static unsigned char PADDING[64] = {
|
||||
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
@ -56,9 +56,9 @@ typedef struct {
|
||||
unsigned char digest[16]; /* actual digest after MD5Final call */
|
||||
} MD5_CTX;
|
||||
|
||||
extern void MD5Init __P((MD5_CTX *));
|
||||
extern void MD5Update __P((MD5_CTX *, unsigned char *, unsigned int));
|
||||
extern void MD5Final __P((unsigned char *, MD5_CTX *));
|
||||
extern void MD5Init(MD5_CTX *);
|
||||
extern void MD5Update(MD5_CTX *, unsigned char *, unsigned int);
|
||||
extern void MD5Final(unsigned char *, MD5_CTX *);
|
||||
|
||||
#define __MD5_INCLUDE__
|
||||
#endif /* __MD5_INCLUDE__ */
|
||||
|
@ -27,16 +27,16 @@
|
||||
#define ADF_OFF offsetof(addrfamily_t, adf_addr)
|
||||
#define ADF_OFF_BITS (ADF_OFF << 3)
|
||||
|
||||
static ipf_rdx_node_t *ipf_rx_insert __P((ipf_rdx_head_t *,
|
||||
ipf_rdx_node_t nodes[2], int *));
|
||||
static void ipf_rx_attach_mask __P((ipf_rdx_node_t *, ipf_rdx_mask_t *));
|
||||
static int count_mask_bits __P((addrfamily_t *, u_32_t **));
|
||||
static void buildnodes __P((addrfamily_t *, addrfamily_t *,
|
||||
ipf_rdx_node_t n[2]));
|
||||
static ipf_rdx_node_t *ipf_rx_find_addr __P((ipf_rdx_node_t *, u_32_t *));
|
||||
static ipf_rdx_node_t *ipf_rx_lookup __P((ipf_rdx_head_t *, addrfamily_t *,
|
||||
addrfamily_t *));
|
||||
static ipf_rdx_node_t *ipf_rx_match __P((ipf_rdx_head_t *, addrfamily_t *));
|
||||
static ipf_rdx_node_t *ipf_rx_insert(ipf_rdx_head_t *,
|
||||
ipf_rdx_node_t nodes[2], int *);
|
||||
static void ipf_rx_attach_mask(ipf_rdx_node_t *, ipf_rdx_mask_t *);
|
||||
static int count_mask_bits(addrfamily_t *, u_32_t **);
|
||||
static void buildnodes(addrfamily_t *, addrfamily_t *,
|
||||
ipf_rdx_node_t n[2]);
|
||||
static ipf_rdx_node_t *ipf_rx_find_addr(ipf_rdx_node_t *, u_32_t *);
|
||||
static ipf_rdx_node_t *ipf_rx_lookup(ipf_rdx_head_t *, addrfamily_t *,
|
||||
addrfamily_t *);
|
||||
static ipf_rdx_node_t *ipf_rx_match(ipf_rdx_head_t *, addrfamily_t *);
|
||||
|
||||
/*
|
||||
* Foreword.
|
||||
|
@ -81,17 +81,17 @@ typedef struct radix_softc {
|
||||
# define RADIX_NODE_HEAD_UNLOCK(x)
|
||||
#endif
|
||||
|
||||
extern void *ipf_rx_create __P((void));
|
||||
extern int ipf_rx_init __P((void *));
|
||||
extern void ipf_rx_destroy __P((void *));
|
||||
extern int ipf_rx_inithead __P((radix_softc_t *, ipf_rdx_head_t **));
|
||||
extern void ipf_rx_freehead __P((ipf_rdx_head_t *));
|
||||
extern ipf_rdx_node_t *ipf_rx_addroute __P((ipf_rdx_head_t *,
|
||||
addrfamily_t *, addrfamily_t *,
|
||||
ipf_rdx_node_t *));
|
||||
extern ipf_rdx_node_t *ipf_rx_delete __P((ipf_rdx_head_t *, addrfamily_t *,
|
||||
addrfamily_t *));
|
||||
extern void ipf_rx_walktree __P((ipf_rdx_head_t *, radix_walk_func_t,
|
||||
void *));
|
||||
extern void *ipf_rx_create(void);
|
||||
extern int ipf_rx_init(void *);
|
||||
extern void ipf_rx_destroy(void *);
|
||||
extern int ipf_rx_inithead(radix_softc_t *, ipf_rdx_head_t **);
|
||||
extern void ipf_rx_freehead(ipf_rdx_head_t *);
|
||||
extern ipf_rdx_node_t *ipf_rx_addroute(ipf_rdx_head_t *,
|
||||
addrfamily_t *, addrfamily_t *,
|
||||
ipf_rdx_node_t *);
|
||||
extern ipf_rdx_node_t *ipf_rx_delete(ipf_rdx_head_t *, addrfamily_t *,
|
||||
addrfamily_t *);
|
||||
extern void ipf_rx_walktree(ipf_rdx_head_t *, radix_walk_func_t,
|
||||
void *);
|
||||
|
||||
#endif /* __RADIX_IPF_H__ */
|
||||
|
@ -17,7 +17,7 @@ static const char rcsid[] = "@(#)$Id$";
|
||||
#endif
|
||||
|
||||
#if !defined(__SVR4) && defined(__GNUC__)
|
||||
extern char *index __P((const char *, int));
|
||||
extern char *index(const char *, int);
|
||||
#endif
|
||||
|
||||
extern char *optarg;
|
||||
@ -25,28 +25,28 @@ extern int optind;
|
||||
extern frentry_t *frtop;
|
||||
|
||||
|
||||
void ipf_frsync __P((void));
|
||||
void zerostats __P((void));
|
||||
int main __P((int, char *[]));
|
||||
void ipf_frsync(void);
|
||||
void zerostats(void);
|
||||
int main(int, char *[]);
|
||||
|
||||
int opts = 0;
|
||||
int outputc = 0;
|
||||
int use_inet6 = 0;
|
||||
int exitstatus = 0;
|
||||
|
||||
static void procfile __P((char *));
|
||||
static void flushfilter __P((char *, int *));
|
||||
static void set_state __P((u_int));
|
||||
static void showstats __P((friostat_t *));
|
||||
static void packetlogon __P((char *));
|
||||
static void swapactive __P((void));
|
||||
static int opendevice __P((char *, int));
|
||||
static void closedevice __P((void));
|
||||
static void procfile(char *);
|
||||
static void flushfilter(char *, int *);
|
||||
static void set_state(u_int);
|
||||
static void showstats(friostat_t *);
|
||||
static void packetlogon(char *);
|
||||
static void swapactive(void);
|
||||
static int opendevice(char *, int);
|
||||
static void closedevice(void);
|
||||
static char *ipfname = IPL_NAME;
|
||||
static void usage __P((void));
|
||||
static int showversion __P((void));
|
||||
static int get_flags __P((void));
|
||||
static int ipf_interceptadd __P((int, ioctlfunc_t, void *));
|
||||
static void usage(void);
|
||||
static int showversion(void);
|
||||
static int get_flags(void);
|
||||
static int ipf_interceptadd(int, ioctlfunc_t, void *);
|
||||
|
||||
static int fd = -1;
|
||||
static ioctlfunc_t iocfunctions[IPL_LOGSIZE] = { ioctl, ioctl, ioctl,
|
||||
|
@ -22,36 +22,36 @@
|
||||
#define DOALL(x) for (fr = frc; fr != NULL; fr = fr->fr_next) { x }
|
||||
#define DOREM(x) for (; fr != NULL; fr = fr->fr_next) { x }
|
||||
|
||||
extern void yyerror __P((char *));
|
||||
extern int yyparse __P((void));
|
||||
extern int yylex __P((void));
|
||||
extern void yyerror(char *);
|
||||
extern int yyparse(void);
|
||||
extern int yylex(void);
|
||||
extern int yydebug;
|
||||
extern FILE *yyin;
|
||||
extern int yylineNum;
|
||||
|
||||
static int addname __P((frentry_t **, char *));
|
||||
static frentry_t *addrule __P((void));
|
||||
static frentry_t *allocfr __P((void));
|
||||
static void build_dstaddr_af __P((frentry_t *, void *));
|
||||
static void build_srcaddr_af __P((frentry_t *, void *));
|
||||
static void dobpf __P((int, char *));
|
||||
static void doipfexpr __P((char *));
|
||||
static void do_tuneint __P((char *, int));
|
||||
static void do_tunestr __P((char *, char *));
|
||||
static void fillgroup __P((frentry_t *));
|
||||
static int lookuphost __P((char *, i6addr_t *));
|
||||
static u_int makehash __P((struct alist_s *));
|
||||
static int makepool __P((struct alist_s *));
|
||||
static struct alist_s *newalist __P((struct alist_s *));
|
||||
static void newrule __P((void));
|
||||
static void resetaddr __P((void));
|
||||
static void setgroup __P((frentry_t **, char *));
|
||||
static void setgrhead __P((frentry_t **, char *));
|
||||
static void seticmphead __P((frentry_t **, char *));
|
||||
static void setifname __P((frentry_t **, int, char *));
|
||||
static void setipftype __P((void));
|
||||
static void setsyslog __P((void));
|
||||
static void unsetsyslog __P((void));
|
||||
static int addname(frentry_t **, char *);
|
||||
static frentry_t *addrule(void);
|
||||
static frentry_t *allocfr(void);
|
||||
static void build_dstaddr_af(frentry_t *, void *);
|
||||
static void build_srcaddr_af(frentry_t *, void *);
|
||||
static void dobpf(int, char *);
|
||||
static void doipfexpr(char *);
|
||||
static void do_tuneint(char *, int);
|
||||
static void do_tunestr(char *, char *);
|
||||
static void fillgroup(frentry_t *);
|
||||
static int lookuphost(char *, i6addr_t *);
|
||||
static u_int makehash(struct alist_s *);
|
||||
static int makepool(struct alist_s *);
|
||||
static struct alist_s *newalist(struct alist_s *);
|
||||
static void newrule(void);
|
||||
static void resetaddr(void);
|
||||
static void setgroup(frentry_t **, char *);
|
||||
static void setgrhead(frentry_t **, char *);
|
||||
static void seticmphead(frentry_t **, char *);
|
||||
static void setifname(frentry_t **, int, char *);
|
||||
static void setipftype(void);
|
||||
static void setsyslog(void);
|
||||
static void unsetsyslog(void);
|
||||
|
||||
frentry_t *fr = NULL, *frc = NULL, *frtop = NULL, *frold = NULL;
|
||||
|
||||
|
@ -25,17 +25,17 @@ typedef struct {
|
||||
static char *portcmp[] = { "*", "==", "!=", "<", ">", "<=", ">=", "**", "***" };
|
||||
static int count = 0;
|
||||
|
||||
int intcmp __P((const void *, const void *));
|
||||
static void indent __P((FILE *, int));
|
||||
static void printeq __P((FILE *, char *, int, int, int));
|
||||
static void printipeq __P((FILE *, char *, int, int, int));
|
||||
static void addrule __P((FILE *, frentry_t *));
|
||||
static void printhooks __P((FILE *, int, int, frgroup_t *));
|
||||
static void emitheader __P((frgroup_t *, u_int, u_int));
|
||||
static void emitGroup __P((int, int, void *, frentry_t *, char *,
|
||||
u_int, u_int));
|
||||
static void emittail __P((void));
|
||||
static void printCgroup __P((int, frentry_t *, mc_t *, char *));
|
||||
int intcmp(const void *, const void *);
|
||||
static void indent(FILE *, int);
|
||||
static void printeq(FILE *, char *, int, int, int);
|
||||
static void printipeq(FILE *, char *, int, int, int);
|
||||
static void addrule(FILE *, frentry_t *);
|
||||
static void printhooks(FILE *, int, int, frgroup_t *);
|
||||
static void emitheader(frgroup_t *, u_int, u_int);
|
||||
static void emitGroup(int, int, void *, frentry_t *, char *,
|
||||
u_int, u_int);
|
||||
static void emittail(void);
|
||||
static void printCgroup(int, frentry_t *, mc_t *, char *);
|
||||
|
||||
#define FRC_IFN 0
|
||||
#define FRC_V 1
|
||||
@ -360,15 +360,15 @@ static void emitheader(grp, incount, outcount)
|
||||
if (fph == NULL)
|
||||
return;
|
||||
|
||||
fprintf(fph, "extern int ipfrule_add __P((void));\n");
|
||||
fprintf(fph, "extern int ipfrule_remove __P((void));\n");
|
||||
fprintf(fph, "extern int ipfrule_add(void));\n");
|
||||
fprintf(fph, "extern int ipfrule_remove(void));\n");
|
||||
}
|
||||
|
||||
printhooks(cfile, incount, outcount, grp);
|
||||
|
||||
if (incount) {
|
||||
fprintf(fph, "\n\
|
||||
extern frentry_t *ipfrule_match_in_%s __P((fr_info_t *, u_32_t *));\n\
|
||||
extern frentry_t *ipfrule_match_in_%s(fr_info_t *, u_32_t *));\n\
|
||||
extern frentry_t *ipf_rules_in_%s[%d];\n",
|
||||
grp->fg_name, grp->fg_name, incount);
|
||||
|
||||
@ -379,13 +379,13 @@ extern frentry_t *ipf_rules_in_%s[%d];\n",
|
||||
break;
|
||||
if (g == grp) {
|
||||
fprintf(fph, "\n\
|
||||
extern int ipfrule_add_in_%s __P((void));\n\
|
||||
extern int ipfrule_remove_in_%s __P((void));\n", grp->fg_name, grp->fg_name);
|
||||
extern int ipfrule_add_in_%s(void));\n\
|
||||
extern int ipfrule_remove_in_%s(void));\n", grp->fg_name, grp->fg_name);
|
||||
}
|
||||
}
|
||||
if (outcount) {
|
||||
fprintf(fph, "\n\
|
||||
extern frentry_t *ipfrule_match_out_%s __P((fr_info_t *, u_32_t *));\n\
|
||||
extern frentry_t *ipfrule_match_out_%s(fr_info_t *, u_32_t *));\n\
|
||||
extern frentry_t *ipf_rules_out_%s[%d];\n",
|
||||
grp->fg_name, grp->fg_name, outcount);
|
||||
|
||||
@ -396,8 +396,8 @@ extern frentry_t *ipf_rules_out_%s[%d];\n",
|
||||
break;
|
||||
if (g == grp) {
|
||||
fprintf(fph, "\n\
|
||||
extern int ipfrule_add_out_%s __P((void));\n\
|
||||
extern int ipfrule_remove_out_%s __P((void));\n",
|
||||
extern int ipfrule_add_out_%s(void));\n\
|
||||
extern int ipfrule_remove_out_%s(void));\n",
|
||||
grp->fg_name, grp->fg_name);
|
||||
}
|
||||
}
|
||||
|
@ -46,25 +46,25 @@ static const char rcsid[] = "@(#)$Id$";
|
||||
#endif
|
||||
|
||||
#if !defined(__SVR4) && defined(__GNUC__)
|
||||
extern char *index __P((const char *, int));
|
||||
extern char *index(const char *, int);
|
||||
#endif
|
||||
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
|
||||
int main __P((int, char *[]));
|
||||
void usage __P((void));
|
||||
int changestateif __P((char *, char *));
|
||||
int changenatif __P((char *, char *));
|
||||
int readstate __P((int, char *));
|
||||
int readnat __P((int, char *));
|
||||
int writestate __P((int, char *));
|
||||
int opendevice __P((char *));
|
||||
void closedevice __P((int));
|
||||
int setlock __P((int, int));
|
||||
int writeall __P((char *));
|
||||
int readall __P((char *));
|
||||
int writenat __P((int, char *));
|
||||
int main(int, char *[]);
|
||||
void usage(void);
|
||||
int changestateif(char *, char *);
|
||||
int changenatif(char *, char *);
|
||||
int readstate(int, char *);
|
||||
int readnat(int, char *);
|
||||
int writestate(int, char *);
|
||||
int opendevice(char *);
|
||||
void closedevice(int);
|
||||
int setlock(int, int);
|
||||
int writeall(char *);
|
||||
int readall(char *);
|
||||
int writenat(int, char *);
|
||||
|
||||
int opts = 0;
|
||||
char *progname;
|
||||
|
@ -120,45 +120,45 @@ typedef struct statetop {
|
||||
} statetop_t;
|
||||
#endif
|
||||
|
||||
int main __P((int, char *[]));
|
||||
int main(int, char *[]);
|
||||
|
||||
static int fetchfrag __P((int, int, ipfr_t *));
|
||||
static void showstats __P((friostat_t *, u_32_t));
|
||||
static void showfrstates __P((ipfrstat_t *, u_long));
|
||||
static void showlist __P((friostat_t *));
|
||||
static void showstatestats __P((ips_stat_t *));
|
||||
static void showipstates __P((ips_stat_t *, int *));
|
||||
static void showauthstates __P((ipf_authstat_t *));
|
||||
static void showtqtable_live __P((int));
|
||||
static void showgroups __P((friostat_t *));
|
||||
static void usage __P((char *));
|
||||
static int state_matcharray __P((ipstate_t *, int *));
|
||||
static int printlivelist __P((friostat_t *, int, int, frentry_t *,
|
||||
char *, char *));
|
||||
static void printdeadlist __P((friostat_t *, int, int, frentry_t *,
|
||||
char *, char *));
|
||||
static void printside __P((char *, ipf_statistics_t *));
|
||||
static void parse_ipportstr __P((const char *, i6addr_t *, int *));
|
||||
static void ipfstate_live __P((char *, friostat_t **, ips_stat_t **,
|
||||
ipfrstat_t **, ipf_authstat_t **, u_32_t *));
|
||||
static void ipfstate_dead __P((char *, friostat_t **, ips_stat_t **,
|
||||
ipfrstat_t **, ipf_authstat_t **, u_32_t *));
|
||||
static ipstate_t *fetchstate __P((ipstate_t *, ipstate_t *));
|
||||
static int fetchfrag(int, int, ipfr_t *);
|
||||
static void showstats(friostat_t *, u_32_t);
|
||||
static void showfrstates(ipfrstat_t *, u_long);
|
||||
static void showlist(friostat_t *);
|
||||
static void showstatestats(ips_stat_t *);
|
||||
static void showipstates(ips_stat_t *, int *);
|
||||
static void showauthstates(ipf_authstat_t *);
|
||||
static void showtqtable_live(int);
|
||||
static void showgroups(friostat_t *);
|
||||
static void usage(char *);
|
||||
static int state_matcharray(ipstate_t *, int *);
|
||||
static int printlivelist(friostat_t *, int, int, frentry_t *,
|
||||
char *, char *);
|
||||
static void printdeadlist(friostat_t *, int, int, frentry_t *,
|
||||
char *, char *);
|
||||
static void printside(char *, ipf_statistics_t *);
|
||||
static void parse_ipportstr(const char *, i6addr_t *, int *);
|
||||
static void ipfstate_live(char *, friostat_t **, ips_stat_t **,
|
||||
ipfrstat_t **, ipf_authstat_t **, u_32_t *);
|
||||
static void ipfstate_dead(char *, friostat_t **, ips_stat_t **,
|
||||
ipfrstat_t **, ipf_authstat_t **, u_32_t *);
|
||||
static ipstate_t *fetchstate(ipstate_t *, ipstate_t *);
|
||||
#ifdef STATETOP
|
||||
static void topipstates __P((i6addr_t, i6addr_t, int, int, int,
|
||||
int, int, int, int *));
|
||||
static void sig_break __P((int));
|
||||
static void sig_resize __P((int));
|
||||
static char *getip __P((int, i6addr_t *));
|
||||
static char *ttl_to_string __P((long));
|
||||
static int sort_p __P((const void *, const void *));
|
||||
static int sort_pkts __P((const void *, const void *));
|
||||
static int sort_bytes __P((const void *, const void *));
|
||||
static int sort_ttl __P((const void *, const void *));
|
||||
static int sort_srcip __P((const void *, const void *));
|
||||
static int sort_srcpt __P((const void *, const void *));
|
||||
static int sort_dstip __P((const void *, const void *));
|
||||
static int sort_dstpt __P((const void *, const void *));
|
||||
static void topipstates(i6addr_t, i6addr_t, int, int, int,
|
||||
int, int, int, int *);
|
||||
static void sig_break(int);
|
||||
static void sig_resize(int);
|
||||
static char *getip(int, i6addr_t *);
|
||||
static char *ttl_to_string(long);
|
||||
static int sort_p(const void *, const void *);
|
||||
static int sort_pkts(const void *, const void *);
|
||||
static int sort_bytes(const void *, const void *);
|
||||
static int sort_ttl(const void *, const void *);
|
||||
static int sort_srcip(const void *, const void *);
|
||||
static int sort_srcpt(const void *, const void *);
|
||||
static int sort_dstip(const void *, const void *);
|
||||
static int sort_dstpt(const void *, const void *);
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -43,17 +43,17 @@ extern char *sys_errlist[];
|
||||
#endif
|
||||
|
||||
|
||||
int main __P((int, char *[]));
|
||||
void usage __P((char *));
|
||||
void printsynchdr __P((synchdr_t *));
|
||||
void printtable __P((int));
|
||||
void printsmcproto __P((char *));
|
||||
void printcommand __P((int));
|
||||
int do_kbuff __P((int, char *, int *));
|
||||
int do_packet __P((int, char *));
|
||||
int buildsocket __P((char *, struct sockaddr_in *));
|
||||
void do_io __P((void));
|
||||
void handleterm __P((int));
|
||||
int main(int, char *[]);
|
||||
void usage(char *);
|
||||
void printsynchdr(synchdr_t *);
|
||||
void printtable(int);
|
||||
void printsmcproto(char *);
|
||||
void printcommand(int);
|
||||
int do_kbuff(int, char *, int *);
|
||||
int do_packet(int, char *);
|
||||
int buildsocket(char *, struct sockaddr_in *);
|
||||
void do_io(void);
|
||||
void handleterm(int);
|
||||
|
||||
int terminate = 0;
|
||||
int igmpfd = -1;
|
||||
|
@ -17,9 +17,9 @@ static const char rcsid[] = "@(#)$Id$";
|
||||
|
||||
extern char *optarg;
|
||||
extern struct ipread pcap, iptext, iphex;
|
||||
extern struct ifnet *get_unit __P((char *, int));
|
||||
extern void init_ifp __P((void));
|
||||
extern ipnat_t *natparse __P((char *, int));
|
||||
extern struct ifnet *get_unit(char *, int);
|
||||
extern void init_ifp(void);
|
||||
extern ipnat_t *natparse(char *, int);
|
||||
extern hostmap_t **ipf_hm_maptable;
|
||||
extern hostmap_t *ipf_hm_maplist;
|
||||
|
||||
@ -32,24 +32,24 @@ int opts = OPT_DONTOPEN;
|
||||
int use_inet6 = 0;
|
||||
int docksum = 0;
|
||||
int pfil_delayed_copy = 0;
|
||||
int main __P((int, char *[]));
|
||||
int loadrules __P((char *, int));
|
||||
int kmemcpy __P((char *, long, int));
|
||||
int kstrncpy __P((char *, long, int n));
|
||||
int main(int, char *[]);
|
||||
int loadrules(char *, int);
|
||||
int kmemcpy(char *, long, int);
|
||||
int kstrncpy(char *, long, int n);
|
||||
int blockreason;
|
||||
void dumpnat __P((void *));
|
||||
void dumpgroups __P((ipf_main_softc_t *));
|
||||
void dumprules __P((frentry_t *));
|
||||
void drain_log __P((char *));
|
||||
void fixv4sums __P((mb_t *, ip_t *));
|
||||
void dumpnat(void *);
|
||||
void dumpgroups(ipf_main_softc_t *);
|
||||
void dumprules(frentry_t *);
|
||||
void drain_log(char *);
|
||||
void fixv4sums(mb_t *, ip_t *);
|
||||
|
||||
int ipftestioctl __P((int, ioctlcmd_t, ...));
|
||||
int ipnattestioctl __P((int, ioctlcmd_t, ...));
|
||||
int ipstatetestioctl __P((int, ioctlcmd_t, ...));
|
||||
int ipauthtestioctl __P((int, ioctlcmd_t, ...));
|
||||
int ipscantestioctl __P((int, ioctlcmd_t, ...));
|
||||
int ipsynctestioctl __P((int, ioctlcmd_t, ...));
|
||||
int ipooltestioctl __P((int, ioctlcmd_t, ...));
|
||||
int ipftestioctl(int, ioctlcmd_t, ...);
|
||||
int ipnattestioctl(int, ioctlcmd_t, ...);
|
||||
int ipstatetestioctl(int, ioctlcmd_t, ...);
|
||||
int ipauthtestioctl(int, ioctlcmd_t, ...);
|
||||
int ipscantestioctl(int, ioctlcmd_t, ...);
|
||||
int ipsynctestioctl(int, ioctlcmd_t, ...);
|
||||
int ipooltestioctl(int, ioctlcmd_t, ...);
|
||||
|
||||
static ioctlfunc_t iocfunctions[IPL_LOGSIZE] = { ipftestioctl,
|
||||
ipnattestioctl,
|
||||
|
@ -116,30 +116,30 @@ static char *pidfile = "/var/run/ipmon.pid";
|
||||
|
||||
static char line[2048];
|
||||
static int donehup = 0;
|
||||
static void usage __P((char *));
|
||||
static void handlehup __P((int));
|
||||
static void flushlogs __P((char *, FILE *));
|
||||
static void print_log __P((config_t *, logsource_t *, char *, int));
|
||||
static void print_ipflog __P((config_t *, char *, int));
|
||||
static void print_natlog __P((config_t *, char *, int));
|
||||
static void print_statelog __P((config_t *, char *, int));
|
||||
static int read_log __P((int, int *, char *, int));
|
||||
static void write_pid __P((char *));
|
||||
static char *icmpname __P((u_int, u_int));
|
||||
static char *icmpname6 __P((u_int, u_int));
|
||||
static icmp_type_t *find_icmptype __P((int, icmp_type_t *, size_t));
|
||||
static icmp_subtype_t *find_icmpsubtype __P((int, icmp_subtype_t *, size_t));
|
||||
static struct tm *get_tm __P((time_t));
|
||||
static void usage(char *);
|
||||
static void handlehup(int);
|
||||
static void flushlogs(char *, FILE *);
|
||||
static void print_log(config_t *, logsource_t *, char *, int);
|
||||
static void print_ipflog(config_t *, char *, int);
|
||||
static void print_natlog(config_t *, char *, int);
|
||||
static void print_statelog(config_t *, char *, int);
|
||||
static int read_log(int, int *, char *, int);
|
||||
static void write_pid(char *);
|
||||
static char *icmpname(u_int, u_int);
|
||||
static char *icmpname6(u_int, u_int);
|
||||
static icmp_type_t *find_icmptype(int, icmp_type_t *, size_t);
|
||||
static icmp_subtype_t *find_icmpsubtype(int, icmp_subtype_t *, size_t);
|
||||
static struct tm *get_tm(time_t);
|
||||
|
||||
char *portlocalname __P((int, char *, u_int));
|
||||
int main __P((int, char *[]));
|
||||
char *portlocalname(int, char *, u_int);
|
||||
int main(int, char *[]);
|
||||
|
||||
static void logopts __P((int, char *));
|
||||
static void init_tabs __P((void));
|
||||
static char *getlocalproto __P((u_int));
|
||||
static void openlogs __P((config_t *conf));
|
||||
static int read_loginfo __P((config_t *conf));
|
||||
static void initconfig __P((config_t *conf));
|
||||
static void logopts(int, char *);
|
||||
static void init_tabs(void);
|
||||
static char *getlocalproto(u_int);
|
||||
static void openlogs(config_t *conf);
|
||||
static int read_loginfo(config_t *conf);
|
||||
static void initconfig(config_t *conf);
|
||||
|
||||
static char **protocols = NULL;
|
||||
static char **udp_ports = NULL;
|
||||
|
@ -17,9 +17,9 @@
|
||||
|
||||
#define YYDEBUG 1
|
||||
|
||||
extern void yyerror __P((char *));
|
||||
extern int yyparse __P((void));
|
||||
extern int yylex __P((void));
|
||||
extern void yyerror(char *);
|
||||
extern int yyparse(void);
|
||||
extern int yylex(void);
|
||||
extern int yydebug;
|
||||
extern FILE *yyin;
|
||||
extern int yylineNum;
|
||||
@ -36,14 +36,14 @@ typedef struct opt_s {
|
||||
int o_logpri;
|
||||
} opt_t;
|
||||
|
||||
static void build_action __P((opt_t *, ipmon_doing_t *));
|
||||
static opt_t *new_opt __P((int));
|
||||
static void free_action __P((ipmon_action_t *));
|
||||
static void print_action __P((ipmon_action_t *));
|
||||
static int find_doing __P((char *));
|
||||
static ipmon_doing_t *build_doing __P((char *, char *));
|
||||
static void print_match __P((ipmon_action_t *));
|
||||
static int install_saver __P((char *, char *));
|
||||
static void build_action(opt_t *, ipmon_doing_t *);
|
||||
static opt_t *new_opt(int);
|
||||
static void free_action(ipmon_action_t *);
|
||||
static void print_action(ipmon_action_t *);
|
||||
static int find_doing(char *);
|
||||
static ipmon_doing_t *build_doing(char *, char *);
|
||||
static void print_match(ipmon_action_t *);
|
||||
static int install_saver(char *, char *);
|
||||
|
||||
static ipmon_action_t *alist = NULL;
|
||||
|
||||
|
@ -63,18 +63,18 @@ int use_inet6 = 0;
|
||||
|
||||
extern char *optarg;
|
||||
|
||||
void dostats __P((int, natstat_t *, int, int, int *));
|
||||
void dotable __P((natstat_t *, int, int, int, char *));
|
||||
void flushtable __P((int, int, int *));
|
||||
void usage __P((char *));
|
||||
int main __P((int, char*[]));
|
||||
void showhostmap __P((natstat_t *nsp));
|
||||
void natstat_dead __P((natstat_t *, char *));
|
||||
void dostats_live __P((int, natstat_t *, int, int *));
|
||||
void showhostmap_dead __P((natstat_t *));
|
||||
void showhostmap_live __P((int, natstat_t *));
|
||||
void dostats_dead __P((natstat_t *, int, int *));
|
||||
int nat_matcharray __P((nat_t *, int *));
|
||||
void dostats(int, natstat_t *, int, int, int *);
|
||||
void dotable(natstat_t *, int, int, int, char *);
|
||||
void flushtable(int, int, int *);
|
||||
void usage(char *);
|
||||
int main(int, char*[]);
|
||||
void showhostmap(natstat_t *nsp);
|
||||
void natstat_dead(natstat_t *, char *);
|
||||
void dostats_live(int, natstat_t *, int, int *);
|
||||
void showhostmap_dead(natstat_t *);
|
||||
void showhostmap_live(int, natstat_t *);
|
||||
void dostats_dead(natstat_t *, int, int *);
|
||||
int nat_matcharray(nat_t *, int *);
|
||||
|
||||
int opts;
|
||||
int nohdrfields = 0;
|
||||
|
@ -35,9 +35,9 @@
|
||||
|
||||
#define YYDEBUG 1
|
||||
|
||||
extern void yyerror __P((char *));
|
||||
extern int yyparse __P((void));
|
||||
extern int yylex __P((void));
|
||||
extern void yyerror(char *);
|
||||
extern int yyparse(void);
|
||||
extern int yylex(void);
|
||||
extern int yydebug;
|
||||
extern FILE *yyin;
|
||||
extern int yylineNum;
|
||||
@ -51,22 +51,22 @@ static int suggest_port = 0;
|
||||
static proxyrule_t *prules = NULL;
|
||||
static int parser_error = 0;
|
||||
|
||||
static void newnatrule __P((void));
|
||||
static void setnatproto __P((int));
|
||||
static void setmapifnames __P((void));
|
||||
static void setrdrifnames __P((void));
|
||||
static void proxy_setconfig __P((int));
|
||||
static void proxy_unsetconfig __P((void));
|
||||
static namelist_t *proxy_dns_add_pass __P((char *, char *));
|
||||
static namelist_t *proxy_dns_add_block __P((char *, char *));
|
||||
static void proxy_addconfig __P((char *, int, char *, namelist_t *));
|
||||
static void proxy_loadconfig __P((int, ioctlfunc_t, char *, int,
|
||||
char *, namelist_t *));
|
||||
static void proxy_loadrules __P((int, ioctlfunc_t, proxyrule_t *));
|
||||
static void setmapifnames __P((void));
|
||||
static void setrdrifnames __P((void));
|
||||
static void setifname __P((ipnat_t **, int, char *));
|
||||
static int addname __P((ipnat_t **, char *));
|
||||
static void newnatrule(void);
|
||||
static void setnatproto(int);
|
||||
static void setmapifnames(void);
|
||||
static void setrdrifnames(void);
|
||||
static void proxy_setconfig(int);
|
||||
static void proxy_unsetconfig(void);
|
||||
static namelist_t *proxy_dns_add_pass(char *, char *);
|
||||
static namelist_t *proxy_dns_add_block(char *, char *);
|
||||
static void proxy_addconfig(char *, int, char *, namelist_t *);
|
||||
static void proxy_loadconfig(int, ioctlfunc_t, char *, int,
|
||||
char *, namelist_t *);
|
||||
static void proxy_loadrules(int, ioctlfunc_t, proxyrule_t *);
|
||||
static void setmapifnames(void);
|
||||
static void setrdrifnames(void);
|
||||
static void setifname(ipnat_t **, int, char *);
|
||||
static int addname(ipnat_t **, char *);
|
||||
%}
|
||||
%union {
|
||||
char *str;
|
||||
|
@ -34,28 +34,28 @@
|
||||
#include "kmem.h"
|
||||
|
||||
|
||||
extern int ippool_yyparse __P((void));
|
||||
extern int ippool_yyparse(void);
|
||||
extern int ippool_yydebug;
|
||||
extern FILE *ippool_yyin;
|
||||
extern char *optarg;
|
||||
extern int lineNum;
|
||||
|
||||
void usage __P((char *));
|
||||
int main __P((int, char **));
|
||||
int poolcommand __P((int, int, char *[]));
|
||||
int poolnodecommand __P((int, int, char *[]));
|
||||
int loadpoolfile __P((int, char *[], char *));
|
||||
int poollist __P((int, char *[]));
|
||||
void poollist_dead __P((int, char *, int, char *, char *));
|
||||
void poollist_live __P((int, char *, int, int));
|
||||
int poolflush __P((int, char *[]));
|
||||
int poolstats __P((int, char *[]));
|
||||
int gettype __P((char *, u_int *));
|
||||
int getrole __P((char *));
|
||||
int setnodeaddr __P((int, int, void *ptr, char *arg));
|
||||
void showpools_live __P((int, int, ipf_pool_stat_t *, char *));
|
||||
void showhashs_live __P((int, int, iphtstat_t *, char *));
|
||||
void showdstls_live __P((int, int, ipf_dstl_stat_t *, char *));
|
||||
void usage(char *);
|
||||
int main(int, char **);
|
||||
int poolcommand(int, int, char *[]);
|
||||
int poolnodecommand(int, int, char *[]);
|
||||
int loadpoolfile(int, char *[], char *);
|
||||
int poollist(int, char *[]);
|
||||
void poollist_dead(int, char *, int, char *, char *);
|
||||
void poollist_live(int, char *, int, int);
|
||||
int poolflush(int, char *[]);
|
||||
int poolstats(int, char *[]);
|
||||
int gettype(char *, u_int *);
|
||||
int getrole(char *);
|
||||
int setnodeaddr(int, int, void *ptr, char *arg);
|
||||
void showpools_live(int, int, ipf_pool_stat_t *, char *);
|
||||
void showhashs_live(int, int, iphtstat_t *, char *);
|
||||
void showdstls_live(int, int, ipf_dstl_stat_t *, char *);
|
||||
|
||||
int opts = 0;
|
||||
int fd = -1;
|
||||
|
@ -37,7 +37,7 @@
|
||||
#define YYDEBUG 1
|
||||
#define YYSTACKSIZE 0x00ffffff
|
||||
|
||||
extern int yyparse __P((void));
|
||||
extern int yyparse(void);
|
||||
extern int yydebug;
|
||||
extern FILE *yyin;
|
||||
|
||||
@ -48,10 +48,10 @@ static ippool_dst_t ipld;
|
||||
static ioctlfunc_t poolioctl = NULL;
|
||||
static char poolname[FR_GROUPLEN];
|
||||
|
||||
static iphtent_t *add_htablehosts __P((char *));
|
||||
static ip_pool_node_t *add_poolhosts __P((char *));
|
||||
static ip_pool_node_t *read_whoisfile __P((char *));
|
||||
static void setadflen __P((addrfamily_t *));
|
||||
static iphtent_t *add_htablehosts(char *);
|
||||
static ip_pool_node_t *add_poolhosts(char *);
|
||||
static ip_pool_node_t *read_whoisfile(char *);
|
||||
static void setadflen(addrfamily_t *);
|
||||
|
||||
%}
|
||||
|
||||
|
@ -18,25 +18,25 @@
|
||||
#define YYDEBUG 1
|
||||
|
||||
extern char *optarg;
|
||||
extern void yyerror __P((char *));
|
||||
extern int yyparse __P((void));
|
||||
extern int yylex __P((void));
|
||||
extern void yyerror(char *);
|
||||
extern int yyparse(void);
|
||||
extern int yylex(void);
|
||||
extern int yydebug;
|
||||
extern FILE *yyin;
|
||||
extern int yylineNum;
|
||||
extern void printbuf __P((char *, int, int));
|
||||
extern void printbuf(char *, int, int);
|
||||
|
||||
|
||||
void printent __P((ipscan_t *));
|
||||
void showlist __P((void));
|
||||
int getportnum __P((char *));
|
||||
struct in_addr gethostip __P((char *));
|
||||
struct in_addr combine __P((int, int, int, int));
|
||||
char **makepair __P((char *, char *));
|
||||
void addtag __P((char *, char **, char **, struct action *));
|
||||
int cram __P((char *, char *));
|
||||
void usage __P((char *));
|
||||
int main __P((int, char **));
|
||||
void printent(ipscan_t *);
|
||||
void showlist(void);
|
||||
int getportnum(char *);
|
||||
struct in_addr gethostip(char *);
|
||||
struct in_addr combine(int, int, int, int);
|
||||
char **makepair(char *, char *);
|
||||
void addtag(char *, char **, char **, struct action *);
|
||||
int cram(char *, char *);
|
||||
void usage(char *);
|
||||
int main(int, char **);
|
||||
|
||||
int opts = 0;
|
||||
int fd = -1;
|
||||
|
@ -33,8 +33,8 @@ static const char rcsid[] = "@(#)$Id$";
|
||||
#include "netinet/ip_sync.h"
|
||||
|
||||
|
||||
int main __P((int, char *[]));
|
||||
void usage __P((const char *));
|
||||
int main(int, char *[]);
|
||||
void usage(const char *);
|
||||
|
||||
int terminate = 0;
|
||||
|
||||
|
@ -33,8 +33,8 @@ static const char rcsid[] = "@(#)$Id$";
|
||||
#include "netinet/ip_nat.h"
|
||||
#include "netinet/ip_sync.h"
|
||||
|
||||
int main __P((int, char *[]));
|
||||
void usage __P((const char *progname));
|
||||
int main(int, char *[]);
|
||||
void usage(const char *progname);
|
||||
|
||||
int terminate = 0;
|
||||
|
||||
|
@ -52,13 +52,13 @@ int yysavedepth = 0;
|
||||
wordtab_t *yysavewords[30];
|
||||
|
||||
|
||||
static wordtab_t *yyfindkey __P((char *));
|
||||
static int yygetc __P((int));
|
||||
static void yyunputc __P((int));
|
||||
static int yyswallow __P((int));
|
||||
static char *yytexttostr __P((int, int));
|
||||
static void yystrtotext __P((char *));
|
||||
static char *yytexttochar __P((void));
|
||||
static wordtab_t *yyfindkey(char *);
|
||||
static int yygetc(int);
|
||||
static void yyunputc(int);
|
||||
static int yyswallow(int);
|
||||
static char *yytexttostr(int, int);
|
||||
static void yystrtotext(char *);
|
||||
static char *yytexttochar(void);
|
||||
|
||||
static int yygetc(docont)
|
||||
int docont;
|
||||
|
@ -22,13 +22,13 @@
|
||||
|
||||
#define YYBUFSIZ 8192
|
||||
|
||||
extern wordtab_t *yysettab __P((wordtab_t *));
|
||||
extern void yysetdict __P((wordtab_t *));
|
||||
extern void yysetfixeddict __P((wordtab_t *));
|
||||
extern int yylex __P((void));
|
||||
extern void yyerror __P((char *));
|
||||
extern char *yykeytostr __P((int));
|
||||
extern void yyresetdict __P((void));
|
||||
extern wordtab_t *yysettab(wordtab_t *);
|
||||
extern void yysetdict(wordtab_t *);
|
||||
extern void yysetfixeddict(wordtab_t *);
|
||||
extern int yylex(void);
|
||||
extern void yyerror(char *);
|
||||
extern char *yykeytostr(int);
|
||||
extern void yyresetdict(void);
|
||||
|
||||
extern FILE *yyin;
|
||||
extern int yylineNum;
|
||||
|
@ -120,67 +120,65 @@ extern int blockreason;
|
||||
#define LBUMP(x) softc->x++
|
||||
#define LBUMPD(x, y) do { softc->x.y++; DT(y); } while (0)
|
||||
|
||||
static INLINE int ipf_check_ipf __P((fr_info_t *, frentry_t *, int));
|
||||
static u_32_t ipf_checkcipso __P((fr_info_t *, u_char *, int));
|
||||
static u_32_t ipf_checkripso __P((u_char *));
|
||||
static u_32_t ipf_decaps __P((fr_info_t *, u_32_t, int));
|
||||
static INLINE int ipf_check_ipf(fr_info_t *, frentry_t *, int);
|
||||
static u_32_t ipf_checkcipso(fr_info_t *, u_char *, int);
|
||||
static u_32_t ipf_checkripso(u_char *);
|
||||
static u_32_t ipf_decaps(fr_info_t *, u_32_t, int);
|
||||
#ifdef IPFILTER_LOG
|
||||
static frentry_t *ipf_dolog __P((fr_info_t *, u_32_t *));
|
||||
static frentry_t *ipf_dolog(fr_info_t *, u_32_t *);
|
||||
#endif
|
||||
static int ipf_flushlist __P((ipf_main_softc_t *, int *,
|
||||
frentry_t **));
|
||||
static int ipf_flush_groups __P((ipf_main_softc_t *, frgroup_t **,
|
||||
int));
|
||||
static ipfunc_t ipf_findfunc __P((ipfunc_t));
|
||||
static void *ipf_findlookup __P((ipf_main_softc_t *, int,
|
||||
frentry_t *,
|
||||
i6addr_t *, i6addr_t *));
|
||||
static frentry_t *ipf_firewall __P((fr_info_t *, u_32_t *));
|
||||
static int ipf_fr_matcharray __P((fr_info_t *, int *));
|
||||
static int ipf_frruleiter __P((ipf_main_softc_t *, void *, int,
|
||||
void *));
|
||||
static void ipf_funcfini __P((ipf_main_softc_t *, frentry_t *));
|
||||
static int ipf_funcinit __P((ipf_main_softc_t *, frentry_t *));
|
||||
static int ipf_geniter __P((ipf_main_softc_t *, ipftoken_t *,
|
||||
ipfgeniter_t *));
|
||||
static void ipf_getstat __P((ipf_main_softc_t *,
|
||||
struct friostat *, int));
|
||||
static int ipf_group_flush __P((ipf_main_softc_t *, frgroup_t *));
|
||||
static void ipf_group_free __P((frgroup_t *));
|
||||
static int ipf_grpmapfini __P((struct ipf_main_softc_s *,
|
||||
frentry_t *));
|
||||
static int ipf_grpmapinit __P((struct ipf_main_softc_s *,
|
||||
frentry_t *));
|
||||
static frentry_t *ipf_nextrule __P((ipf_main_softc_t *, int, int,
|
||||
frentry_t *, int));
|
||||
static int ipf_portcheck __P((frpcmp_t *, u_32_t));
|
||||
static INLINE int ipf_pr_ah __P((fr_info_t *));
|
||||
static INLINE void ipf_pr_esp __P((fr_info_t *));
|
||||
static INLINE void ipf_pr_gre __P((fr_info_t *));
|
||||
static INLINE void ipf_pr_udp __P((fr_info_t *));
|
||||
static INLINE void ipf_pr_tcp __P((fr_info_t *));
|
||||
static INLINE void ipf_pr_icmp __P((fr_info_t *));
|
||||
static INLINE void ipf_pr_ipv4hdr __P((fr_info_t *));
|
||||
static INLINE void ipf_pr_short __P((fr_info_t *, int));
|
||||
static INLINE int ipf_pr_tcpcommon __P((fr_info_t *));
|
||||
static INLINE int ipf_pr_udpcommon __P((fr_info_t *));
|
||||
static void ipf_rule_delete __P((ipf_main_softc_t *, frentry_t *f,
|
||||
int, int));
|
||||
static void ipf_rule_expire_insert __P((ipf_main_softc_t *,
|
||||
frentry_t *, int));
|
||||
static int ipf_synclist __P((ipf_main_softc_t *, frentry_t *,
|
||||
void *));
|
||||
static void ipf_token_flush __P((ipf_main_softc_t *));
|
||||
static void ipf_token_unlink __P((ipf_main_softc_t *,
|
||||
ipftoken_t *));
|
||||
static ipftuneable_t *ipf_tune_findbyname __P((ipftuneable_t *,
|
||||
const char *));
|
||||
static ipftuneable_t *ipf_tune_findbycookie __P((ipftuneable_t **, void *,
|
||||
void **));
|
||||
static int ipf_updateipid __P((fr_info_t *));
|
||||
static int ipf_settimeout __P((struct ipf_main_softc_s *,
|
||||
static int ipf_flushlist(ipf_main_softc_t *, int *, frentry_t **);
|
||||
static int ipf_flush_groups(ipf_main_softc_t *, frgroup_t **,
|
||||
int);
|
||||
static ipfunc_t ipf_findfunc(ipfunc_t);
|
||||
static void *ipf_findlookup(ipf_main_softc_t *, int, frentry_t *,
|
||||
i6addr_t *, i6addr_t *);
|
||||
static frentry_t *ipf_firewall(fr_info_t *, u_32_t *);
|
||||
static int ipf_fr_matcharray(fr_info_t *, int *);
|
||||
static int ipf_frruleiter(ipf_main_softc_t *, void *, int,
|
||||
void *);
|
||||
static void ipf_funcfini(ipf_main_softc_t *, frentry_t *);
|
||||
static int ipf_funcinit(ipf_main_softc_t *, frentry_t *);
|
||||
static int ipf_geniter(ipf_main_softc_t *, ipftoken_t *,
|
||||
ipfgeniter_t *);
|
||||
static void ipf_getstat(ipf_main_softc_t *,
|
||||
struct friostat *, int);
|
||||
static int ipf_group_flush(ipf_main_softc_t *, frgroup_t *);
|
||||
static void ipf_group_free(frgroup_t *);
|
||||
static int ipf_grpmapfini(struct ipf_main_softc_s *,
|
||||
frentry_t *);
|
||||
static int ipf_grpmapinit(struct ipf_main_softc_s *,
|
||||
frentry_t *);
|
||||
static frentry_t *ipf_nextrule(ipf_main_softc_t *, int, int,
|
||||
frentry_t *, int);
|
||||
static int ipf_portcheck(frpcmp_t *, u_32_t);
|
||||
static INLINE int ipf_pr_ah(fr_info_t *);
|
||||
static INLINE void ipf_pr_esp(fr_info_t *);
|
||||
static INLINE void ipf_pr_gre(fr_info_t *);
|
||||
static INLINE void ipf_pr_udp(fr_info_t *);
|
||||
static INLINE void ipf_pr_tcp(fr_info_t *);
|
||||
static INLINE void ipf_pr_icmp(fr_info_t *);
|
||||
static INLINE void ipf_pr_ipv4hdr(fr_info_t *);
|
||||
static INLINE void ipf_pr_short(fr_info_t *, int);
|
||||
static INLINE int ipf_pr_tcpcommon(fr_info_t *);
|
||||
static INLINE int ipf_pr_udpcommon(fr_info_t *);
|
||||
static void ipf_rule_delete(ipf_main_softc_t *, frentry_t *f,
|
||||
int, int);
|
||||
static void ipf_rule_expire_insert(ipf_main_softc_t *,
|
||||
frentry_t *, int);
|
||||
static int ipf_synclist(ipf_main_softc_t *, frentry_t *,
|
||||
void *);
|
||||
static void ipf_token_flush(ipf_main_softc_t *);
|
||||
static void ipf_token_unlink(ipf_main_softc_t *,
|
||||
ipftoken_t *);
|
||||
static ipftuneable_t *ipf_tune_findbyname(ipftuneable_t *,
|
||||
const char *);
|
||||
static ipftuneable_t *ipf_tune_findbycookie(ipftuneable_t **, void *,
|
||||
void **);
|
||||
static int ipf_updateipid(fr_info_t *);
|
||||
static int ipf_settimeout(struct ipf_main_softc_s *,
|
||||
struct ipftuneable *,
|
||||
ipftuneval_t *));
|
||||
ipftuneval_t *);
|
||||
#if !defined(_KERNEL) || SOLARIS
|
||||
static int ppsratecheck(struct timeval *, int *, int);
|
||||
#endif
|
||||
@ -394,20 +392,20 @@ static ipftuneable_t ipf_main_tuneables[] = {
|
||||
* adding more code to a growing switch statement.
|
||||
*/
|
||||
#ifdef USE_INET6
|
||||
static INLINE int ipf_pr_ah6 __P((fr_info_t *));
|
||||
static INLINE void ipf_pr_esp6 __P((fr_info_t *));
|
||||
static INLINE void ipf_pr_gre6 __P((fr_info_t *));
|
||||
static INLINE void ipf_pr_udp6 __P((fr_info_t *));
|
||||
static INLINE void ipf_pr_tcp6 __P((fr_info_t *));
|
||||
static INLINE void ipf_pr_icmp6 __P((fr_info_t *));
|
||||
static INLINE void ipf_pr_ipv6hdr __P((fr_info_t *));
|
||||
static INLINE void ipf_pr_short6 __P((fr_info_t *, int));
|
||||
static INLINE int ipf_pr_hopopts6 __P((fr_info_t *));
|
||||
static INLINE int ipf_pr_mobility6 __P((fr_info_t *));
|
||||
static INLINE int ipf_pr_routing6 __P((fr_info_t *));
|
||||
static INLINE int ipf_pr_dstopts6 __P((fr_info_t *));
|
||||
static INLINE int ipf_pr_fragment6 __P((fr_info_t *));
|
||||
static INLINE struct ip6_ext *ipf_pr_ipv6exthdr __P((fr_info_t *, int, int));
|
||||
static INLINE int ipf_pr_ah6(fr_info_t *);
|
||||
static INLINE void ipf_pr_esp6(fr_info_t *);
|
||||
static INLINE void ipf_pr_gre6(fr_info_t *);
|
||||
static INLINE void ipf_pr_udp6(fr_info_t *);
|
||||
static INLINE void ipf_pr_tcp6(fr_info_t *);
|
||||
static INLINE void ipf_pr_icmp6(fr_info_t *);
|
||||
static INLINE void ipf_pr_ipv6hdr(fr_info_t *);
|
||||
static INLINE void ipf_pr_short6(fr_info_t *, int);
|
||||
static INLINE int ipf_pr_hopopts6(fr_info_t *);
|
||||
static INLINE int ipf_pr_mobility6(fr_info_t *);
|
||||
static INLINE int ipf_pr_routing6(fr_info_t *);
|
||||
static INLINE int ipf_pr_dstopts6(fr_info_t *);
|
||||
static INLINE int ipf_pr_fragment6(fr_info_t *);
|
||||
static INLINE struct ip6_ext *ipf_pr_ipv6exthdr(fr_info_t *, int, int);
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
@ -9809,9 +9807,9 @@ ipf_rule_expire(softc)
|
||||
}
|
||||
|
||||
|
||||
static int ipf_ht_node_cmp __P((struct host_node_s *, struct host_node_s *));
|
||||
static void ipf_ht_node_make_key __P((host_track_t *, host_node_t *, int,
|
||||
i6addr_t *));
|
||||
static int ipf_ht_node_cmp(struct host_node_s *, struct host_node_s *);
|
||||
static void ipf_ht_node_make_key(host_track_t *, host_node_t *, int,
|
||||
i6addr_t *);
|
||||
|
||||
host_node_t RBI_ZERO(ipf_rb);
|
||||
RBI_CODE(ipf_rb, host_node_t, hn_entry, ipf_ht_node_cmp)
|
||||
|
@ -115,13 +115,13 @@ static const char rcsid[] = "@(#)$FreeBSD$";
|
||||
#endif
|
||||
|
||||
|
||||
static void ipf_auth_deref __P((frauthent_t **));
|
||||
static void ipf_auth_deref_unlocked __P((ipf_auth_softc_t *, frauthent_t **));
|
||||
static int ipf_auth_geniter __P((ipf_main_softc_t *, ipftoken_t *,
|
||||
ipfgeniter_t *, ipfobj_t *));
|
||||
static int ipf_auth_reply __P((ipf_main_softc_t *, ipf_auth_softc_t *, char *));
|
||||
static int ipf_auth_wait __P((ipf_main_softc_t *, ipf_auth_softc_t *, char *));
|
||||
static int ipf_auth_flush __P((void *));
|
||||
static void ipf_auth_deref(frauthent_t **);
|
||||
static void ipf_auth_deref_unlocked(ipf_auth_softc_t *, frauthent_t **);
|
||||
static int ipf_auth_geniter(ipf_main_softc_t *, ipftoken_t *,
|
||||
ipfgeniter_t *, ipfobj_t *);
|
||||
static int ipf_auth_reply(ipf_main_softc_t *, ipf_auth_softc_t *, char *);
|
||||
static int ipf_auth_wait(ipf_main_softc_t *, ipf_auth_softc_t *, char *);
|
||||
static int ipf_auth_flush(void *);
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
@ -68,25 +68,25 @@ typedef struct ipf_auth_softc_s {
|
||||
frentry_t *ipf_auth_rules;
|
||||
} ipf_auth_softc_t;
|
||||
|
||||
extern frentry_t *ipf_auth_check __P((fr_info_t *, u_32_t *));
|
||||
extern void ipf_auth_expire __P((ipf_main_softc_t *));
|
||||
extern int ipf_auth_ioctl __P((ipf_main_softc_t *, caddr_t, ioctlcmd_t,
|
||||
int, int, void *));
|
||||
extern int ipf_auth_init __P((void));
|
||||
extern int ipf_auth_main_load __P((void));
|
||||
extern int ipf_auth_main_unload __P((void));
|
||||
extern void ipf_auth_soft_destroy __P((ipf_main_softc_t *, void *));
|
||||
extern void *ipf_auth_soft_create __P((ipf_main_softc_t *));
|
||||
extern int ipf_auth_new __P((mb_t *, fr_info_t *));
|
||||
extern int ipf_auth_precmd __P((ipf_main_softc_t *, ioctlcmd_t,
|
||||
frentry_t *, frentry_t **));
|
||||
extern void ipf_auth_unload __P((ipf_main_softc_t *));
|
||||
extern int ipf_auth_waiting __P((ipf_main_softc_t *));
|
||||
extern void ipf_auth_setlock __P((void *, int));
|
||||
extern int ipf_auth_soft_init __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_auth_soft_fini __P((ipf_main_softc_t *, void *));
|
||||
extern u_32_t ipf_auth_pre_scanlist __P((ipf_main_softc_t *, fr_info_t *,
|
||||
u_32_t));
|
||||
extern frentry_t **ipf_auth_rulehead __P((ipf_main_softc_t *));
|
||||
extern frentry_t *ipf_auth_check(fr_info_t *, u_32_t *);
|
||||
extern void ipf_auth_expire(ipf_main_softc_t *);
|
||||
extern int ipf_auth_ioctl(ipf_main_softc_t *, caddr_t, ioctlcmd_t,
|
||||
int, int, void *);
|
||||
extern int ipf_auth_init(void);
|
||||
extern int ipf_auth_main_load(void);
|
||||
extern int ipf_auth_main_unload(void);
|
||||
extern void ipf_auth_soft_destroy(ipf_main_softc_t *, void *);
|
||||
extern void *ipf_auth_soft_create(ipf_main_softc_t *);
|
||||
extern int ipf_auth_new(mb_t *, fr_info_t *);
|
||||
extern int ipf_auth_precmd(ipf_main_softc_t *, ioctlcmd_t,
|
||||
frentry_t *, frentry_t **);
|
||||
extern void ipf_auth_unload(ipf_main_softc_t *);
|
||||
extern int ipf_auth_waiting(ipf_main_softc_t *);
|
||||
extern void ipf_auth_setlock(void *, int);
|
||||
extern int ipf_auth_soft_init(ipf_main_softc_t *, void *);
|
||||
extern int ipf_auth_soft_fini(ipf_main_softc_t *, void *);
|
||||
extern u_32_t ipf_auth_pre_scanlist(ipf_main_softc_t *, fr_info_t *,
|
||||
u_32_t);
|
||||
extern frentry_t **ipf_auth_rulehead(ipf_main_softc_t *);
|
||||
|
||||
#endif /* __IP_AUTH_H__ */
|
||||
|
@ -11,10 +11,6 @@
|
||||
#ifndef __IP_COMPAT_H__
|
||||
#define __IP_COMPAT_H__
|
||||
|
||||
#ifndef __P
|
||||
# define __P(x) x
|
||||
#endif
|
||||
|
||||
#if defined(_KERNEL) || defined(KERNEL) || defined(__KERNEL__)
|
||||
# undef KERNEL
|
||||
# undef _KERNEL
|
||||
@ -366,12 +362,12 @@ typedef struct mb_s {
|
||||
MTOD((mb_t *)m, char *) + (o), \
|
||||
(l))
|
||||
# define UIOMOVE(a,b,c,d) ipfuiomove((caddr_t)a,b,c,d)
|
||||
extern void m_copydata __P((mb_t *, int, int, caddr_t));
|
||||
extern int ipfuiomove __P((caddr_t, int, int, struct uio *));
|
||||
extern int bcopywrap __P((void *, void *, size_t));
|
||||
extern mb_t *allocmbt __P((size_t));
|
||||
extern mb_t *dupmbt __P((mb_t *));
|
||||
extern void freembt __P((mb_t *));
|
||||
extern void m_copydata(mb_t *, int, int, caddr_t);
|
||||
extern int ipfuiomove(caddr_t, int, int, struct uio *);
|
||||
extern int bcopywrap(void *, void *, size_t);
|
||||
extern mb_t *allocmbt(size_t);
|
||||
extern mb_t *dupmbt(mb_t *);
|
||||
extern void freembt(mb_t *);
|
||||
|
||||
# define MUTEX_DESTROY(x) eMmutex_destroy(&(x)->ipf_emu, \
|
||||
__FILE__, __LINE__)
|
||||
@ -398,16 +394,16 @@ extern void freembt __P((mb_t *));
|
||||
|
||||
# define USE_MUTEXES 1
|
||||
|
||||
extern void eMmutex_destroy __P((eMmutex_t *, char *, int));
|
||||
extern void eMmutex_enter __P((eMmutex_t *, char *, int));
|
||||
extern void eMmutex_exit __P((eMmutex_t *, char *, int));
|
||||
extern void eMmutex_init __P((eMmutex_t *, char *, char *, int));
|
||||
extern void eMrwlock_destroy __P((eMrwlock_t *));
|
||||
extern void eMrwlock_exit __P((eMrwlock_t *));
|
||||
extern void eMrwlock_init __P((eMrwlock_t *, char *));
|
||||
extern void eMrwlock_read_enter __P((eMrwlock_t *, char *, int));
|
||||
extern void eMrwlock_write_enter __P((eMrwlock_t *, char *, int));
|
||||
extern void eMrwlock_downgrade __P((eMrwlock_t *, char *, int));
|
||||
extern void eMmutex_destroy(eMmutex_t *, char *, int);
|
||||
extern void eMmutex_enter(eMmutex_t *, char *, int);
|
||||
extern void eMmutex_exit(eMmutex_t *, char *, int);
|
||||
extern void eMmutex_init(eMmutex_t *, char *, char *, int);
|
||||
extern void eMrwlock_destroy(eMrwlock_t *);
|
||||
extern void eMrwlock_exit(eMrwlock_t *);
|
||||
extern void eMrwlock_init(eMrwlock_t *, char *);
|
||||
extern void eMrwlock_read_enter(eMrwlock_t *, char *, int);
|
||||
extern void eMrwlock_write_enter(eMrwlock_t *, char *, int);
|
||||
extern void eMrwlock_downgrade(eMrwlock_t *, char *, int);
|
||||
|
||||
#endif
|
||||
|
||||
@ -586,7 +582,7 @@ MALLOC_DECLARE(M_IPFILTER);
|
||||
#endif
|
||||
#ifndef COPYIFNAME
|
||||
# define NEED_FRGETIFNAME
|
||||
extern char *ipf_getifname __P((struct ifnet *, char *));
|
||||
extern char *ipf_getifname(struct ifnet *, char *);
|
||||
# define COPYIFNAME(v, x, b) \
|
||||
ipf_getifname((struct ifnet *)x, b)
|
||||
#endif
|
||||
|
@ -27,16 +27,16 @@ typedef struct ipf_dns_softc_s {
|
||||
u_long ipf_p_dns_nospace;
|
||||
} ipf_dns_softc_t;
|
||||
|
||||
int ipf_p_dns_allow_query __P((ipf_dns_softc_t *, dnsinfo_t *));
|
||||
int ipf_p_dns_ctl __P((ipf_main_softc_t *, void *, ap_ctl_t *));
|
||||
void ipf_p_dns_del __P((ipf_main_softc_t *, ap_session_t *));
|
||||
int ipf_p_dns_get_name __P((ipf_dns_softc_t *, char *, int, char *, int));
|
||||
int ipf_p_dns_inout __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ipf_p_dns_match __P((fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ipf_p_dns_match_names __P((ipf_dns_filter_t *, char *, int));
|
||||
int ipf_p_dns_new __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
void *ipf_p_dns_soft_create __P((ipf_main_softc_t *));
|
||||
void ipf_p_dns_soft_destroy __P((ipf_main_softc_t *, void *));
|
||||
int ipf_p_dns_allow_query(ipf_dns_softc_t *, dnsinfo_t *);
|
||||
int ipf_p_dns_ctl(ipf_main_softc_t *, void *, ap_ctl_t *);
|
||||
void ipf_p_dns_del(ipf_main_softc_t *, ap_session_t *);
|
||||
int ipf_p_dns_get_name(ipf_dns_softc_t *, char *, int, char *, int);
|
||||
int ipf_p_dns_inout(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ipf_p_dns_match(fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ipf_p_dns_match_names(ipf_dns_filter_t *, char *, int);
|
||||
int ipf_p_dns_new(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
void *ipf_p_dns_soft_create(ipf_main_softc_t *);
|
||||
void ipf_p_dns_soft_destroy(ipf_main_softc_t *, void *);
|
||||
|
||||
typedef struct {
|
||||
u_char dns_id[2];
|
||||
|
@ -73,41 +73,41 @@ typedef struct ipf_dstl_softc_s {
|
||||
} ipf_dstl_softc_t;
|
||||
|
||||
|
||||
static void *ipf_dstlist_soft_create __P((ipf_main_softc_t *));
|
||||
static void ipf_dstlist_soft_destroy __P((ipf_main_softc_t *, void *));
|
||||
static int ipf_dstlist_soft_init __P((ipf_main_softc_t *, void *));
|
||||
static void ipf_dstlist_soft_fini __P((ipf_main_softc_t *, void *));
|
||||
static int ipf_dstlist_addr_find __P((ipf_main_softc_t *, void *, int,
|
||||
void *, u_int));
|
||||
static size_t ipf_dstlist_flush __P((ipf_main_softc_t *, void *,
|
||||
iplookupflush_t *));
|
||||
static int ipf_dstlist_iter_deref __P((ipf_main_softc_t *, void *, int, int,
|
||||
void *));
|
||||
static int ipf_dstlist_iter_next __P((ipf_main_softc_t *, void *, ipftoken_t *,
|
||||
ipflookupiter_t *));
|
||||
static int ipf_dstlist_node_add __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *, int));
|
||||
static int ipf_dstlist_node_del __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *, int));
|
||||
static int ipf_dstlist_stats_get __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *));
|
||||
static int ipf_dstlist_table_add __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *));
|
||||
static int ipf_dstlist_table_del __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *));
|
||||
static int ipf_dstlist_table_deref __P((ipf_main_softc_t *, void *, void *));
|
||||
static void *ipf_dstlist_table_find __P((void *, int, char *));
|
||||
static void ipf_dstlist_table_free __P((ipf_dstl_softc_t *, ippool_dst_t *));
|
||||
static void ipf_dstlist_table_remove __P((ipf_main_softc_t *,
|
||||
ipf_dstl_softc_t *, ippool_dst_t *));
|
||||
static void ipf_dstlist_table_clearnodes __P((ipf_dstl_softc_t *,
|
||||
ippool_dst_t *));
|
||||
static ipf_dstnode_t *ipf_dstlist_select __P((fr_info_t *, ippool_dst_t *));
|
||||
static void *ipf_dstlist_select_ref __P((void *, int, char *));
|
||||
static void ipf_dstlist_node_free __P((ipf_dstl_softc_t *, ippool_dst_t *, ipf_dstnode_t *));
|
||||
static int ipf_dstlist_node_deref __P((void *, ipf_dstnode_t *));
|
||||
static void ipf_dstlist_expire __P((ipf_main_softc_t *, void *));
|
||||
static void ipf_dstlist_sync __P((ipf_main_softc_t *, void *));
|
||||
static void *ipf_dstlist_soft_create(ipf_main_softc_t *);
|
||||
static void ipf_dstlist_soft_destroy(ipf_main_softc_t *, void *);
|
||||
static int ipf_dstlist_soft_init(ipf_main_softc_t *, void *);
|
||||
static void ipf_dstlist_soft_fini(ipf_main_softc_t *, void *);
|
||||
static int ipf_dstlist_addr_find(ipf_main_softc_t *, void *, int,
|
||||
void *, u_int);
|
||||
static size_t ipf_dstlist_flush(ipf_main_softc_t *, void *,
|
||||
iplookupflush_t *);
|
||||
static int ipf_dstlist_iter_deref(ipf_main_softc_t *, void *, int, int,
|
||||
void *);
|
||||
static int ipf_dstlist_iter_next(ipf_main_softc_t *, void *, ipftoken_t *,
|
||||
ipflookupiter_t *);
|
||||
static int ipf_dstlist_node_add(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *, int);
|
||||
static int ipf_dstlist_node_del(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *, int);
|
||||
static int ipf_dstlist_stats_get(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *);
|
||||
static int ipf_dstlist_table_add(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *);
|
||||
static int ipf_dstlist_table_del(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *);
|
||||
static int ipf_dstlist_table_deref(ipf_main_softc_t *, void *, void *);
|
||||
static void *ipf_dstlist_table_find(void *, int, char *);
|
||||
static void ipf_dstlist_table_free(ipf_dstl_softc_t *, ippool_dst_t *);
|
||||
static void ipf_dstlist_table_remove(ipf_main_softc_t *,
|
||||
ipf_dstl_softc_t *, ippool_dst_t *);
|
||||
static void ipf_dstlist_table_clearnodes(ipf_dstl_softc_t *,
|
||||
ippool_dst_t *);
|
||||
static ipf_dstnode_t *ipf_dstlist_select(fr_info_t *, ippool_dst_t *);
|
||||
static void *ipf_dstlist_select_ref(void *, int, char *);
|
||||
static void ipf_dstlist_node_free(ipf_dstl_softc_t *, ippool_dst_t *, ipf_dstnode_t *);
|
||||
static int ipf_dstlist_node_deref(void *, ipf_dstnode_t *);
|
||||
static void ipf_dstlist_expire(ipf_main_softc_t *, void *);
|
||||
static void ipf_dstlist_sync(ipf_main_softc_t *, void *);
|
||||
|
||||
ipf_lookup_t ipf_dstlist_backend = {
|
||||
IPLT_DSTLIST,
|
||||
|
@ -62,7 +62,7 @@ typedef struct dstlist_stat_s {
|
||||
|
||||
extern ipf_lookup_t ipf_dstlist_backend;
|
||||
|
||||
extern int ipf_dstlist_select_node __P((fr_info_t *, void *, u_32_t *,
|
||||
frdest_t *));
|
||||
extern int ipf_dstlist_select_node(fr_info_t *, void *, u_32_t *,
|
||||
frdest_t *);
|
||||
|
||||
#endif /* __IP_DSTLIST_H__ */
|
||||
|
@ -84,8 +84,8 @@ struct ipscan;
|
||||
struct ifnet;
|
||||
struct ipf_main_softc_s;
|
||||
|
||||
typedef int (* lookupfunc_t) __P((struct ipf_main_softc_s *, void *,
|
||||
int, void *, u_int));
|
||||
typedef int (* lookupfunc_t)(struct ipf_main_softc_s *, void *,
|
||||
int, void *, u_int);
|
||||
|
||||
/*
|
||||
* i6addr is used as a container for both IPv4 and IPv6 addresses, as well
|
||||
@ -435,8 +435,8 @@ typedef struct fr_info {
|
||||
#define IPF_IN 0
|
||||
#define IPF_OUT 1
|
||||
|
||||
typedef struct frentry *(*ipfunc_t) __P((fr_info_t *, u_32_t *));
|
||||
typedef int (*ipfuncinit_t) __P((struct ipf_main_softc_s *, struct frentry *));
|
||||
typedef struct frentry *(*ipfunc_t)(fr_info_t *, u_32_t *);
|
||||
typedef int (*ipfuncinit_t)(struct ipf_main_softc_s *, struct frentry *);
|
||||
|
||||
typedef struct ipfunc_resolve {
|
||||
char ipfu_name[32];
|
||||
@ -621,7 +621,7 @@ typedef enum fr_rtypes_e {
|
||||
FR_T_IPFEXPR_BUILTIN
|
||||
} fr_rtypes_t;
|
||||
|
||||
typedef struct frentry * (* frentfunc_t) __P((fr_info_t *));
|
||||
typedef struct frentry * (* frentfunc_t)(fr_info_t *);
|
||||
|
||||
typedef struct frentry {
|
||||
ipfmutex_t fr_lock;
|
||||
@ -1325,7 +1325,7 @@ typedef union ipftuneval {
|
||||
} ipftuneval_t;
|
||||
|
||||
struct ipftuneable;
|
||||
typedef int (* ipftunefunc_t) __P((struct ipf_main_softc_s *, struct ipftuneable *, ipftuneval_t *));
|
||||
typedef int (* ipftunefunc_t)(struct ipf_main_softc_s *, struct ipftuneable *, ipftuneval_t *);
|
||||
|
||||
typedef struct ipftuneable {
|
||||
ipftunevalptr_t ipft_una;
|
||||
@ -1382,8 +1382,8 @@ typedef struct ipftune {
|
||||
# define FR_VERBOSE(verb_pr)
|
||||
# define FR_DEBUG(verb_pr)
|
||||
#else
|
||||
extern void ipfkdebug __P((char *, ...));
|
||||
extern void ipfkverbose __P((char *, ...));
|
||||
extern void ipfkdebug(char *, ...);
|
||||
extern void ipfkverbose(char *, ...);
|
||||
# define FR_VERBOSE(verb_pr) ipfkverbose verb_pr
|
||||
# define FR_DEBUG(verb_pr) ipfkdebug verb_pr
|
||||
#endif
|
||||
@ -1611,233 +1611,233 @@ typedef struct ipf_main_softc_s {
|
||||
} while (0)
|
||||
|
||||
#ifndef _KERNEL
|
||||
extern int ipf_check __P((void *, struct ip *, int, struct ifnet *, int, mb_t **));
|
||||
extern struct ifnet *get_unit __P((char *, int));
|
||||
extern char *get_ifname __P((struct ifnet *));
|
||||
extern int ipfioctl __P((ipf_main_softc_t *, int, ioctlcmd_t,
|
||||
caddr_t, int));
|
||||
extern void m_freem __P((mb_t *));
|
||||
extern size_t msgdsize __P((mb_t *));
|
||||
extern int bcopywrap __P((void *, void *, size_t));
|
||||
extern int ipf_check(void *, struct ip *, int, struct ifnet *, int, mb_t **);
|
||||
extern struct ifnet *get_unit(char *, int);
|
||||
extern char *get_ifname(struct ifnet *);
|
||||
extern int ipfioctl(ipf_main_softc_t *, int, ioctlcmd_t,
|
||||
caddr_t, int);
|
||||
extern void m_freem(mb_t *);
|
||||
extern size_t msgdsize(mb_t *);
|
||||
extern int bcopywrap(void *, void *, size_t);
|
||||
extern void ip_fillid(struct ip *);
|
||||
#else /* #ifndef _KERNEL */
|
||||
# if defined(__NetBSD__) && defined(PFIL_HOOKS)
|
||||
extern void ipfilterattach __P((int));
|
||||
extern void ipfilterattach(int);
|
||||
# endif
|
||||
extern int ipl_enable __P((void));
|
||||
extern int ipl_disable __P((void));
|
||||
extern int ipl_enable(void);
|
||||
extern int ipl_disable(void);
|
||||
# ifdef MENTAT
|
||||
/* XXX MENTAT is always defined for Solaris */
|
||||
extern int ipf_check __P((void *, struct ip *, int, struct ifnet *, int, void *,
|
||||
mblk_t **));
|
||||
extern int ipf_check(void *, struct ip *, int, struct ifnet *, int, void *,
|
||||
mblk_t **);
|
||||
# if SOLARIS
|
||||
extern void ipf_prependmbt(fr_info_t *, mblk_t *);
|
||||
extern int ipfioctl __P((dev_t, int, intptr_t, int, cred_t *, int *));
|
||||
extern int ipfioctl(dev_t, int, intptr_t, int, cred_t *, int *);
|
||||
# endif
|
||||
extern int ipf_qout __P((queue_t *, mblk_t *));
|
||||
extern int ipf_qout(queue_t *, mblk_t *);
|
||||
# else /* MENTAT */
|
||||
/* XXX MENTAT is never defined for FreeBSD & NetBSD */
|
||||
extern int ipf_check __P((void *, struct ip *, int, struct ifnet *, int, mb_t **));
|
||||
extern int (*fr_checkp) __P((ip_t *, int, void *, int, mb_t **));
|
||||
extern size_t mbufchainlen __P((mb_t *));
|
||||
extern int ipf_check(void *, struct ip *, int, struct ifnet *, int, mb_t **);
|
||||
extern int (*fr_checkp)(ip_t *, int, void *, int, mb_t **);
|
||||
extern size_t mbufchainlen(mb_t *);
|
||||
# ifdef IPFILTER_LKM
|
||||
extern int ipf_identify __P((char *));
|
||||
extern int ipf_identify(char *);
|
||||
# endif
|
||||
# if defined(__FreeBSD_version)
|
||||
extern int ipfioctl __P((struct cdev*, u_long, caddr_t, int, struct thread *));
|
||||
extern int ipfioctl(struct cdev*, u_long, caddr_t, int, struct thread *);
|
||||
# elif defined(__NetBSD__)
|
||||
extern int ipfioctl __P((dev_t, u_long, void *, int, struct lwp *));
|
||||
extern int ipfioctl(dev_t, u_long, void *, int, struct lwp *);
|
||||
# endif
|
||||
# endif /* MENTAT */
|
||||
|
||||
# if defined(__FreeBSD_version)
|
||||
extern int ipf_pfil_hook __P((void));
|
||||
extern int ipf_pfil_unhook __P((void));
|
||||
extern void ipf_event_reg __P((void));
|
||||
extern void ipf_event_dereg __P((void));
|
||||
extern int ipf_pfil_hook(void);
|
||||
extern int ipf_pfil_unhook(void);
|
||||
extern void ipf_event_reg(void);
|
||||
extern void ipf_event_dereg(void);
|
||||
# endif
|
||||
|
||||
# if defined(INSTANCES)
|
||||
extern ipf_main_softc_t *ipf_find_softc __P((u_long));
|
||||
extern int ipf_set_loopback __P((ipf_main_softc_t *, ipftuneable_t *,
|
||||
ipftuneval_t *));
|
||||
extern ipf_main_softc_t *ipf_find_softc(u_long);
|
||||
extern int ipf_set_loopback(ipf_main_softc_t *, ipftuneable_t *,
|
||||
ipftuneval_t *);
|
||||
# endif
|
||||
|
||||
#endif /* #ifndef _KERNEL */
|
||||
|
||||
extern char *memstr __P((const char *, char *, size_t, size_t));
|
||||
extern int count4bits __P((u_32_t));
|
||||
extern char *memstr(const char *, char *, size_t, size_t);
|
||||
extern int count4bits(u_32_t);
|
||||
#ifdef USE_INET6
|
||||
extern int count6bits __P((u_32_t *));
|
||||
extern int count6bits(u_32_t *);
|
||||
#endif
|
||||
extern int frrequest __P((ipf_main_softc_t *, int, ioctlcmd_t, caddr_t,
|
||||
int, int));
|
||||
extern char *getifname __P((struct ifnet *));
|
||||
extern int ipfattach __P((ipf_main_softc_t *));
|
||||
extern int ipfdetach __P((ipf_main_softc_t *));
|
||||
extern u_short ipf_cksum __P((u_short *, int));
|
||||
extern int copyinptr __P((ipf_main_softc_t *, void *, void *, size_t));
|
||||
extern int copyoutptr __P((ipf_main_softc_t *, void *, void *, size_t));
|
||||
extern int ipf_fastroute __P((mb_t *, mb_t **, fr_info_t *, frdest_t *));
|
||||
extern int ipf_inject __P((fr_info_t *, mb_t *));
|
||||
extern int ipf_inobj __P((ipf_main_softc_t *, void *, ipfobj_t *,
|
||||
void *, int));
|
||||
extern int ipf_inobjsz __P((ipf_main_softc_t *, void *, void *,
|
||||
int , int));
|
||||
extern int ipf_ioctlswitch __P((ipf_main_softc_t *, int, void *,
|
||||
ioctlcmd_t, int, int, void *));
|
||||
extern int ipf_ipf_ioctl __P((ipf_main_softc_t *, caddr_t, ioctlcmd_t,
|
||||
int, int, void *));
|
||||
extern int ipf_ipftune __P((ipf_main_softc_t *, ioctlcmd_t, void *));
|
||||
extern int ipf_matcharray_load __P((ipf_main_softc_t *, caddr_t,
|
||||
ipfobj_t *, int **));
|
||||
extern int ipf_matcharray_verify __P((int *, int));
|
||||
extern int ipf_outobj __P((ipf_main_softc_t *, void *, void *, int));
|
||||
extern int ipf_outobjk __P((ipf_main_softc_t *, ipfobj_t *, void *));
|
||||
extern int ipf_outobjsz __P((ipf_main_softc_t *, void *, void *,
|
||||
int, int));
|
||||
extern void *ipf_pullup __P((mb_t *, fr_info_t *, int));
|
||||
extern int ipf_resolvedest __P((ipf_main_softc_t *, char *,
|
||||
struct frdest *, int));
|
||||
extern int ipf_resolvefunc __P((ipf_main_softc_t *, void *));
|
||||
extern void *ipf_resolvenic __P((ipf_main_softc_t *, char *, int));
|
||||
extern int ipf_send_icmp_err __P((int, fr_info_t *, int));
|
||||
extern int ipf_send_reset __P((fr_info_t *));
|
||||
extern void ipf_apply_timeout __P((ipftq_t *, u_int));
|
||||
extern ipftq_t *ipf_addtimeoutqueue __P((ipf_main_softc_t *, ipftq_t **,
|
||||
u_int));
|
||||
extern void ipf_deletequeueentry __P((ipftqent_t *));
|
||||
extern int ipf_deletetimeoutqueue __P((ipftq_t *));
|
||||
extern void ipf_freetimeoutqueue __P((ipf_main_softc_t *, ipftq_t *));
|
||||
extern void ipf_movequeue __P((u_long, ipftqent_t *, ipftq_t *,
|
||||
ipftq_t *));
|
||||
extern void ipf_queueappend __P((u_long, ipftqent_t *, ipftq_t *, void *));
|
||||
extern void ipf_queueback __P((u_long, ipftqent_t *));
|
||||
extern int ipf_queueflush __P((ipf_main_softc_t *, ipftq_delete_fn_t,
|
||||
ipftq_t *, ipftq_t *, u_int *, int, int));
|
||||
extern void ipf_queuefront __P((ipftqent_t *));
|
||||
extern int ipf_settimeout_tcp __P((ipftuneable_t *, ipftuneval_t *,
|
||||
ipftq_t *));
|
||||
extern int ipf_checkv4sum __P((fr_info_t *));
|
||||
extern int ipf_checkl4sum __P((fr_info_t *));
|
||||
extern int ipf_ifpfillv4addr __P((int, struct sockaddr_in *,
|
||||
extern int frrequest(ipf_main_softc_t *, int, ioctlcmd_t, caddr_t,
|
||||
int, int);
|
||||
extern char *getifname(struct ifnet *);
|
||||
extern int ipfattach(ipf_main_softc_t *);
|
||||
extern int ipfdetach(ipf_main_softc_t *);
|
||||
extern u_short ipf_cksum(u_short *, int);
|
||||
extern int copyinptr(ipf_main_softc_t *, void *, void *, size_t);
|
||||
extern int copyoutptr(ipf_main_softc_t *, void *, void *, size_t);
|
||||
extern int ipf_fastroute(mb_t *, mb_t **, fr_info_t *, frdest_t *);
|
||||
extern int ipf_inject(fr_info_t *, mb_t *);
|
||||
extern int ipf_inobj(ipf_main_softc_t *, void *, ipfobj_t *,
|
||||
void *, int);
|
||||
extern int ipf_inobjsz(ipf_main_softc_t *, void *, void *,
|
||||
int , int);
|
||||
extern int ipf_ioctlswitch(ipf_main_softc_t *, int, void *,
|
||||
ioctlcmd_t, int, int, void *);
|
||||
extern int ipf_ipf_ioctl(ipf_main_softc_t *, caddr_t, ioctlcmd_t,
|
||||
int, int, void *);
|
||||
extern int ipf_ipftune(ipf_main_softc_t *, ioctlcmd_t, void *);
|
||||
extern int ipf_matcharray_load(ipf_main_softc_t *, caddr_t,
|
||||
ipfobj_t *, int **);
|
||||
extern int ipf_matcharray_verify(int *, int);
|
||||
extern int ipf_outobj(ipf_main_softc_t *, void *, void *, int);
|
||||
extern int ipf_outobjk(ipf_main_softc_t *, ipfobj_t *, void *);
|
||||
extern int ipf_outobjsz(ipf_main_softc_t *, void *, void *,
|
||||
int, int);
|
||||
extern void *ipf_pullup(mb_t *, fr_info_t *, int);
|
||||
extern int ipf_resolvedest(ipf_main_softc_t *, char *,
|
||||
struct frdest *, int);
|
||||
extern int ipf_resolvefunc(ipf_main_softc_t *, void *);
|
||||
extern void *ipf_resolvenic(ipf_main_softc_t *, char *, int);
|
||||
extern int ipf_send_icmp_err(int, fr_info_t *, int);
|
||||
extern int ipf_send_reset(fr_info_t *);
|
||||
extern void ipf_apply_timeout(ipftq_t *, u_int);
|
||||
extern ipftq_t *ipf_addtimeoutqueue(ipf_main_softc_t *, ipftq_t **,
|
||||
u_int);
|
||||
extern void ipf_deletequeueentry(ipftqent_t *);
|
||||
extern int ipf_deletetimeoutqueue(ipftq_t *);
|
||||
extern void ipf_freetimeoutqueue(ipf_main_softc_t *, ipftq_t *);
|
||||
extern void ipf_movequeue(u_long, ipftqent_t *, ipftq_t *,
|
||||
ipftq_t *);
|
||||
extern void ipf_queueappend(u_long, ipftqent_t *, ipftq_t *, void *);
|
||||
extern void ipf_queueback(u_long, ipftqent_t *);
|
||||
extern int ipf_queueflush(ipf_main_softc_t *, ipftq_delete_fn_t,
|
||||
ipftq_t *, ipftq_t *, u_int *, int, int);
|
||||
extern void ipf_queuefront(ipftqent_t *);
|
||||
extern int ipf_settimeout_tcp(ipftuneable_t *, ipftuneval_t *,
|
||||
ipftq_t *);
|
||||
extern int ipf_checkv4sum(fr_info_t *);
|
||||
extern int ipf_checkl4sum(fr_info_t *);
|
||||
extern int ipf_ifpfillv4addr(int, struct sockaddr_in *,
|
||||
struct sockaddr_in *, struct in_addr *,
|
||||
struct in_addr *));
|
||||
extern int ipf_coalesce __P((fr_info_t *));
|
||||
struct in_addr *);
|
||||
extern int ipf_coalesce(fr_info_t *);
|
||||
#ifdef USE_INET6
|
||||
extern int ipf_checkv6sum __P((fr_info_t *));
|
||||
extern int ipf_ifpfillv6addr __P((int, struct sockaddr_in6 *,
|
||||
extern int ipf_checkv6sum(fr_info_t *);
|
||||
extern int ipf_ifpfillv6addr(int, struct sockaddr_in6 *,
|
||||
struct sockaddr_in6 *, i6addr_t *,
|
||||
i6addr_t *));
|
||||
i6addr_t *);
|
||||
#endif
|
||||
|
||||
extern int ipf_tune_add __P((ipf_main_softc_t *, ipftuneable_t *));
|
||||
extern int ipf_tune_add_array __P((ipf_main_softc_t *, ipftuneable_t *));
|
||||
extern int ipf_tune_del __P((ipf_main_softc_t *, ipftuneable_t *));
|
||||
extern int ipf_tune_del_array __P((ipf_main_softc_t *, ipftuneable_t *));
|
||||
extern int ipf_tune_array_link __P((ipf_main_softc_t *, ipftuneable_t *));
|
||||
extern int ipf_tune_array_unlink __P((ipf_main_softc_t *,
|
||||
ipftuneable_t *));
|
||||
extern ipftuneable_t *ipf_tune_array_copy __P((void *, size_t,
|
||||
ipftuneable_t *));
|
||||
extern int ipf_tune_add(ipf_main_softc_t *, ipftuneable_t *);
|
||||
extern int ipf_tune_add_array(ipf_main_softc_t *, ipftuneable_t *);
|
||||
extern int ipf_tune_del(ipf_main_softc_t *, ipftuneable_t *);
|
||||
extern int ipf_tune_del_array(ipf_main_softc_t *, ipftuneable_t *);
|
||||
extern int ipf_tune_array_link(ipf_main_softc_t *, ipftuneable_t *);
|
||||
extern int ipf_tune_array_unlink(ipf_main_softc_t *,
|
||||
ipftuneable_t *);
|
||||
extern ipftuneable_t *ipf_tune_array_copy(void *, size_t,
|
||||
ipftuneable_t *);
|
||||
|
||||
extern int ipf_pr_pullup __P((fr_info_t *, int));
|
||||
extern int ipf_pr_pullup(fr_info_t *, int);
|
||||
|
||||
extern int ipf_flush __P((ipf_main_softc_t *, minor_t, int));
|
||||
extern frgroup_t *ipf_group_add __P((ipf_main_softc_t *, char *, void *,
|
||||
u_32_t, minor_t, int));
|
||||
extern void ipf_group_del __P((ipf_main_softc_t *, frgroup_t *,
|
||||
frentry_t *));
|
||||
extern int ipf_derefrule __P((ipf_main_softc_t *, frentry_t **));
|
||||
extern frgroup_t *ipf_findgroup __P((ipf_main_softc_t *, char *, minor_t,
|
||||
int, frgroup_t ***));
|
||||
extern int ipf_flush(ipf_main_softc_t *, minor_t, int);
|
||||
extern frgroup_t *ipf_group_add(ipf_main_softc_t *, char *, void *,
|
||||
u_32_t, minor_t, int);
|
||||
extern void ipf_group_del(ipf_main_softc_t *, frgroup_t *,
|
||||
frentry_t *);
|
||||
extern int ipf_derefrule(ipf_main_softc_t *, frentry_t **);
|
||||
extern frgroup_t *ipf_findgroup(ipf_main_softc_t *, char *, minor_t,
|
||||
int, frgroup_t ***);
|
||||
|
||||
extern int ipf_log_init __P((void));
|
||||
extern int ipf_log_bytesused __P((ipf_main_softc_t *, int));
|
||||
extern int ipf_log_canread __P((ipf_main_softc_t *, int));
|
||||
extern int ipf_log_clear __P((ipf_main_softc_t *, minor_t));
|
||||
extern u_long ipf_log_failures __P((ipf_main_softc_t *, int));
|
||||
extern int ipf_log_read __P((ipf_main_softc_t *, minor_t, uio_t *));
|
||||
extern int ipf_log_items __P((ipf_main_softc_t *, int, fr_info_t *,
|
||||
void **, size_t *, int *, int));
|
||||
extern u_long ipf_log_logok __P((ipf_main_softc_t *, int));
|
||||
extern void ipf_log_unload __P((ipf_main_softc_t *));
|
||||
extern int ipf_log_pkt __P((fr_info_t *, u_int));
|
||||
extern int ipf_log_init(void);
|
||||
extern int ipf_log_bytesused(ipf_main_softc_t *, int);
|
||||
extern int ipf_log_canread(ipf_main_softc_t *, int);
|
||||
extern int ipf_log_clear(ipf_main_softc_t *, minor_t);
|
||||
extern u_long ipf_log_failures(ipf_main_softc_t *, int);
|
||||
extern int ipf_log_read(ipf_main_softc_t *, minor_t, uio_t *);
|
||||
extern int ipf_log_items(ipf_main_softc_t *, int, fr_info_t *,
|
||||
void **, size_t *, int *, int);
|
||||
extern u_long ipf_log_logok(ipf_main_softc_t *, int);
|
||||
extern void ipf_log_unload(ipf_main_softc_t *);
|
||||
extern int ipf_log_pkt(fr_info_t *, u_int);
|
||||
|
||||
extern frentry_t *ipf_acctpkt __P((fr_info_t *, u_32_t *));
|
||||
extern u_short fr_cksum __P((fr_info_t *, ip_t *, int, void *));
|
||||
extern void ipf_deinitialise __P((ipf_main_softc_t *));
|
||||
extern int ipf_deliverlocal __P((ipf_main_softc_t *, int, void *,
|
||||
i6addr_t *));
|
||||
extern frentry_t *ipf_dstgrpmap __P((fr_info_t *, u_32_t *));
|
||||
extern void ipf_fixskip __P((frentry_t **, frentry_t *, int));
|
||||
extern void ipf_forgetifp __P((ipf_main_softc_t *, void *));
|
||||
extern frentry_t *ipf_getrulen __P((ipf_main_softc_t *, int, char *,
|
||||
u_32_t));
|
||||
extern int ipf_ifpaddr __P((ipf_main_softc_t *, int, int, void *,
|
||||
i6addr_t *, i6addr_t *));
|
||||
extern void ipf_inet_mask_add __P((int, ipf_v4_masktab_t *));
|
||||
extern void ipf_inet_mask_del __P((int, ipf_v4_masktab_t *));
|
||||
extern frentry_t *ipf_acctpkt(fr_info_t *, u_32_t *);
|
||||
extern u_short fr_cksum(fr_info_t *, ip_t *, int, void *);
|
||||
extern void ipf_deinitialise(ipf_main_softc_t *);
|
||||
extern int ipf_deliverlocal(ipf_main_softc_t *, int, void *,
|
||||
i6addr_t *);
|
||||
extern frentry_t *ipf_dstgrpmap(fr_info_t *, u_32_t *);
|
||||
extern void ipf_fixskip(frentry_t **, frentry_t *, int);
|
||||
extern void ipf_forgetifp(ipf_main_softc_t *, void *);
|
||||
extern frentry_t *ipf_getrulen(ipf_main_softc_t *, int, char *,
|
||||
u_32_t);
|
||||
extern int ipf_ifpaddr(ipf_main_softc_t *, int, int, void *,
|
||||
i6addr_t *, i6addr_t *);
|
||||
extern void ipf_inet_mask_add(int, ipf_v4_masktab_t *);
|
||||
extern void ipf_inet_mask_del(int, ipf_v4_masktab_t *);
|
||||
#ifdef USE_INET6
|
||||
extern void ipf_inet6_mask_add __P((int, i6addr_t *,
|
||||
ipf_v6_masktab_t *));
|
||||
extern void ipf_inet6_mask_del __P((int, i6addr_t *,
|
||||
ipf_v6_masktab_t *));
|
||||
extern void ipf_inet6_mask_add(int, i6addr_t *,
|
||||
ipf_v6_masktab_t *);
|
||||
extern void ipf_inet6_mask_del(int, i6addr_t *,
|
||||
ipf_v6_masktab_t *);
|
||||
#endif
|
||||
extern int ipf_initialise __P((void));
|
||||
extern int ipf_lock __P((caddr_t, int *));
|
||||
extern int ipf_makefrip __P((int, ip_t *, fr_info_t *));
|
||||
extern int ipf_matchtag __P((ipftag_t *, ipftag_t *));
|
||||
extern int ipf_matchicmpqueryreply __P((int, icmpinfo_t *,
|
||||
struct icmp *, int));
|
||||
extern u_32_t ipf_newisn __P((fr_info_t *));
|
||||
extern u_int ipf_pcksum __P((fr_info_t *, int, u_int));
|
||||
extern int ipf_initialise(void);
|
||||
extern int ipf_lock(caddr_t, int *);
|
||||
extern int ipf_makefrip(int, ip_t *, fr_info_t *);
|
||||
extern int ipf_matchtag(ipftag_t *, ipftag_t *);
|
||||
extern int ipf_matchicmpqueryreply(int, icmpinfo_t *,
|
||||
struct icmp *, int);
|
||||
extern u_32_t ipf_newisn(fr_info_t *);
|
||||
extern u_int ipf_pcksum(fr_info_t *, int, u_int);
|
||||
#ifdef USE_INET6
|
||||
extern u_int ipf_pcksum6 __P((struct mbuf *, ip6_t *,
|
||||
u_int32_t, u_int32_t));
|
||||
extern u_int ipf_pcksum6(struct mbuf *, ip6_t *,
|
||||
u_int32_t, u_int32_t);
|
||||
#endif
|
||||
extern void ipf_rule_expire __P((ipf_main_softc_t *));
|
||||
extern int ipf_scanlist __P((fr_info_t *, u_32_t));
|
||||
extern frentry_t *ipf_srcgrpmap __P((fr_info_t *, u_32_t *));
|
||||
extern int ipf_tcpudpchk __P((fr_ip_t *, frtuc_t *));
|
||||
extern int ipf_verifysrc __P((fr_info_t *fin));
|
||||
extern int ipf_zerostats __P((ipf_main_softc_t *, char *));
|
||||
extern int ipf_getnextrule __P((ipf_main_softc_t *, ipftoken_t *,
|
||||
void *));
|
||||
extern int ipf_sync __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_token_deref __P((ipf_main_softc_t *, ipftoken_t *));
|
||||
extern void ipf_token_expire __P((ipf_main_softc_t *));
|
||||
extern ipftoken_t *ipf_token_find __P((ipf_main_softc_t *, int, int,
|
||||
void *));
|
||||
extern int ipf_token_del __P((ipf_main_softc_t *, int, int,
|
||||
void *));
|
||||
extern void ipf_token_mark_complete __P((ipftoken_t *));
|
||||
extern int ipf_genericiter __P((ipf_main_softc_t *, void *,
|
||||
int, void *));
|
||||
extern void ipf_rule_expire(ipf_main_softc_t *);
|
||||
extern int ipf_scanlist(fr_info_t *, u_32_t);
|
||||
extern frentry_t *ipf_srcgrpmap(fr_info_t *, u_32_t *);
|
||||
extern int ipf_tcpudpchk(fr_ip_t *, frtuc_t *);
|
||||
extern int ipf_verifysrc(fr_info_t *fin);
|
||||
extern int ipf_zerostats(ipf_main_softc_t *, char *);
|
||||
extern int ipf_getnextrule(ipf_main_softc_t *, ipftoken_t *,
|
||||
void *);
|
||||
extern int ipf_sync(ipf_main_softc_t *, void *);
|
||||
extern int ipf_token_deref(ipf_main_softc_t *, ipftoken_t *);
|
||||
extern void ipf_token_expire(ipf_main_softc_t *);
|
||||
extern ipftoken_t *ipf_token_find(ipf_main_softc_t *, int, int,
|
||||
void *);
|
||||
extern int ipf_token_del(ipf_main_softc_t *, int, int,
|
||||
void *);
|
||||
extern void ipf_token_mark_complete(ipftoken_t *);
|
||||
extern int ipf_genericiter(ipf_main_softc_t *, void *,
|
||||
int, void *);
|
||||
#ifdef IPFILTER_LOOKUP
|
||||
extern void *ipf_resolvelookup __P((int, u_int, u_int,
|
||||
lookupfunc_t *));
|
||||
extern void *ipf_resolvelookup(int, u_int, u_int,
|
||||
lookupfunc_t *);
|
||||
#endif
|
||||
extern u_32_t ipf_random __P((void));
|
||||
extern u_32_t ipf_random(void);
|
||||
|
||||
extern int ipf_main_load __P((void));
|
||||
extern void *ipf_main_soft_create __P((void *));
|
||||
extern void ipf_main_soft_destroy __P((ipf_main_softc_t *));
|
||||
extern int ipf_main_soft_init __P((ipf_main_softc_t *));
|
||||
extern int ipf_main_soft_fini __P((ipf_main_softc_t *));
|
||||
extern int ipf_main_unload __P((void));
|
||||
extern int ipf_load_all __P((void));
|
||||
extern int ipf_unload_all __P((void));
|
||||
extern void ipf_destroy_all __P((ipf_main_softc_t *));
|
||||
extern ipf_main_softc_t *ipf_create_all __P((void *));
|
||||
extern int ipf_init_all __P((ipf_main_softc_t *));
|
||||
extern int ipf_fini_all __P((ipf_main_softc_t *));
|
||||
extern void ipf_log_soft_destroy __P((ipf_main_softc_t *, void *));
|
||||
extern void *ipf_log_soft_create __P((ipf_main_softc_t *));
|
||||
extern int ipf_log_soft_init __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_log_soft_fini __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_log_main_load __P((void));
|
||||
extern int ipf_log_main_unload __P((void));
|
||||
extern int ipf_main_load(void);
|
||||
extern void *ipf_main_soft_create(void *);
|
||||
extern void ipf_main_soft_destroy(ipf_main_softc_t *);
|
||||
extern int ipf_main_soft_init(ipf_main_softc_t *);
|
||||
extern int ipf_main_soft_fini(ipf_main_softc_t *);
|
||||
extern int ipf_main_unload(void);
|
||||
extern int ipf_load_all(void);
|
||||
extern int ipf_unload_all(void);
|
||||
extern void ipf_destroy_all(ipf_main_softc_t *);
|
||||
extern ipf_main_softc_t *ipf_create_all(void *);
|
||||
extern int ipf_init_all(ipf_main_softc_t *);
|
||||
extern int ipf_fini_all(ipf_main_softc_t *);
|
||||
extern void ipf_log_soft_destroy(ipf_main_softc_t *, void *);
|
||||
extern void *ipf_log_soft_create(ipf_main_softc_t *);
|
||||
extern int ipf_log_soft_init(ipf_main_softc_t *, void *);
|
||||
extern int ipf_log_soft_fini(ipf_main_softc_t *, void *);
|
||||
extern int ipf_log_main_load(void);
|
||||
extern int ipf_log_main_unload(void);
|
||||
|
||||
|
||||
extern char ipfilter_version[];
|
||||
@ -1847,16 +1847,16 @@ extern int icmptoicmp6unreach[ICMP_MAX_UNREACH];
|
||||
extern int icmpreplytype6[ICMP6_MAXTYPE + 1];
|
||||
#endif
|
||||
#ifdef IPFILTER_COMPAT
|
||||
extern int ipf_in_compat __P((ipf_main_softc_t *, ipfobj_t *, void *,int));
|
||||
extern int ipf_out_compat __P((ipf_main_softc_t *, ipfobj_t *, void *));
|
||||
extern int ipf_in_compat(ipf_main_softc_t *, ipfobj_t *, void *,int);
|
||||
extern int ipf_out_compat(ipf_main_softc_t *, ipfobj_t *, void *);
|
||||
#endif
|
||||
extern int icmpreplytype4[ICMP_MAXTYPE + 1];
|
||||
|
||||
extern int ipf_ht_node_add __P((ipf_main_softc_t *, host_track_t *,
|
||||
int, i6addr_t *));
|
||||
extern int ipf_ht_node_del __P((host_track_t *, int, i6addr_t *));
|
||||
extern void ipf_rb_ht_flush __P((host_track_t *));
|
||||
extern void ipf_rb_ht_freenode __P((host_node_t *, void *));
|
||||
extern void ipf_rb_ht_init __P((host_track_t *));
|
||||
extern int ipf_ht_node_add(ipf_main_softc_t *, host_track_t *,
|
||||
int, i6addr_t *);
|
||||
extern int ipf_ht_node_del(host_track_t *, int, i6addr_t *);
|
||||
extern void ipf_rb_ht_flush(host_track_t *);
|
||||
extern void ipf_rb_ht_freenode(host_node_t *, void *);
|
||||
extern void ipf_rb_ht_init(host_track_t *);
|
||||
|
||||
#endif /* __IP_FIL_H__ */
|
||||
|
@ -83,15 +83,15 @@ static const char rcsid[] = "@(#)$Id$";
|
||||
#ifdef CSUM_DATA_VALID
|
||||
#include <machine/in_cksum.h>
|
||||
#endif
|
||||
extern int ip_optcopy __P((struct ip *, struct ip *));
|
||||
extern int ip_optcopy(struct ip *, struct ip *);
|
||||
|
||||
# ifdef IPFILTER_M_IPFILTER
|
||||
MALLOC_DEFINE(M_IPFILTER, "ipfilter", "IP Filter packet filter data structures");
|
||||
# endif
|
||||
|
||||
|
||||
static int ipf_send_ip __P((fr_info_t *, mb_t *));
|
||||
static void ipf_timer_func __P((void *arg));
|
||||
static int ipf_send_ip(fr_info_t *, mb_t *);
|
||||
static void ipf_timer_func(void *arg);
|
||||
|
||||
VNET_DEFINE(ipf_main_softc_t, ipfmain) = {
|
||||
.ipf_running = -2,
|
||||
|
@ -81,23 +81,23 @@ static const char rcsid[] = "@(#)$FreeBSD$";
|
||||
|
||||
|
||||
#ifdef USE_MUTEXES
|
||||
static ipfr_t *ipfr_frag_new __P((ipf_main_softc_t *, ipf_frag_softc_t *,
|
||||
static ipfr_t *ipfr_frag_new(ipf_main_softc_t *, ipf_frag_softc_t *,
|
||||
fr_info_t *, u_32_t, ipfr_t **,
|
||||
ipfrwlock_t *));
|
||||
static ipfr_t *ipf_frag_lookup __P((ipf_main_softc_t *, ipf_frag_softc_t *, fr_info_t *, ipfr_t **, ipfrwlock_t *));
|
||||
static void ipf_frag_deref __P((void *, ipfr_t **, ipfrwlock_t *));
|
||||
static int ipf_frag_next __P((ipf_main_softc_t *, ipftoken_t *, ipfgeniter_t *,
|
||||
ipfr_t **, ipfrwlock_t *));
|
||||
ipfrwlock_t *);
|
||||
static ipfr_t *ipf_frag_lookup(ipf_main_softc_t *, ipf_frag_softc_t *, fr_info_t *, ipfr_t **, ipfrwlock_t *);
|
||||
static void ipf_frag_deref(void *, ipfr_t **, ipfrwlock_t *);
|
||||
static int ipf_frag_next(ipf_main_softc_t *, ipftoken_t *, ipfgeniter_t *,
|
||||
ipfr_t **, ipfrwlock_t *);
|
||||
#else
|
||||
static ipfr_t *ipfr_frag_new __P((ipf_main_softc_t *, ipf_frag_softc_t *,
|
||||
fr_info_t *, u_32_t, ipfr_t **));
|
||||
static ipfr_t *ipf_frag_lookup __P((ipf_main_softc_t *, ipf_frag_softc_t *, fr_info_t *, ipfr_t **));
|
||||
static void ipf_frag_deref __P((void *, ipfr_t **));
|
||||
static int ipf_frag_next __P((ipf_main_softc_t *, ipftoken_t *, ipfgeniter_t *,
|
||||
ipfr_t **));
|
||||
static ipfr_t *ipfr_frag_new(ipf_main_softc_t *, ipf_frag_softc_t *,
|
||||
fr_info_t *, u_32_t, ipfr_t **);
|
||||
static ipfr_t *ipf_frag_lookup(ipf_main_softc_t *, ipf_frag_softc_t *, fr_info_t *, ipfr_t **);
|
||||
static void ipf_frag_deref(void *, ipfr_t **);
|
||||
static int ipf_frag_next(ipf_main_softc_t *, ipftoken_t *, ipfgeniter_t *,
|
||||
ipfr_t **);
|
||||
#endif
|
||||
static void ipf_frag_delete __P((ipf_main_softc_t *, ipfr_t *, ipfr_t ***));
|
||||
static void ipf_frag_free __P((ipf_frag_softc_t *, ipfr_t *));
|
||||
static void ipf_frag_delete(ipf_main_softc_t *, ipfr_t *, ipfr_t ***);
|
||||
static void ipf_frag_free(ipf_frag_softc_t *, ipfr_t *);
|
||||
|
||||
static frentry_t ipfr_block;
|
||||
|
||||
|
@ -94,32 +94,32 @@ typedef struct ipf_frag_softc_s {
|
||||
#define IPFR_CMPSZ (offsetof(ipfr_t, ipfr_pass) - \
|
||||
offsetof(ipfr_t, ipfr_ifp))
|
||||
|
||||
extern void *ipf_frag_soft_create __P((ipf_main_softc_t *));
|
||||
extern int ipf_frag_soft_init __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_frag_soft_fini __P((ipf_main_softc_t *, void *));
|
||||
extern void ipf_frag_soft_destroy __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_frag_main_load __P((void));
|
||||
extern int ipf_frag_main_unload __P((void));
|
||||
extern int ipf_frag_load __P((void));
|
||||
extern void ipf_frag_clear __P((ipf_main_softc_t *));
|
||||
extern void ipf_frag_expire __P((ipf_main_softc_t *));
|
||||
extern void ipf_frag_forget __P((void *));
|
||||
extern int ipf_frag_init __P((void));
|
||||
extern u_32_t ipf_frag_ipidknown __P((fr_info_t *));
|
||||
extern int ipf_frag_ipidnew __P((fr_info_t *, u_32_t));
|
||||
extern frentry_t *ipf_frag_known __P((fr_info_t *, u_32_t *));
|
||||
extern void ipf_frag_natforget __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_frag_natnew __P((ipf_main_softc_t *, fr_info_t *, u_32_t, struct nat *));
|
||||
extern nat_t *ipf_frag_natknown __P((fr_info_t *));
|
||||
extern int ipf_frag_new __P((ipf_main_softc_t *, fr_info_t *, u_32_t));
|
||||
extern ipfrstat_t *ipf_frag_stats __P((void *));
|
||||
extern void ipf_frag_setlock __P((void *, int));
|
||||
extern void ipf_frag_pkt_deref __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_frag_pkt_next __P((ipf_main_softc_t *, ipftoken_t *,
|
||||
ipfgeniter_t *));
|
||||
extern void ipf_frag_nat_deref __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_frag_nat_next __P((ipf_main_softc_t *, ipftoken_t *,
|
||||
ipfgeniter_t *));
|
||||
extern void ipf_slowtimer __P((ipf_main_softc_t *));
|
||||
extern void *ipf_frag_soft_create(ipf_main_softc_t *);
|
||||
extern int ipf_frag_soft_init(ipf_main_softc_t *, void *);
|
||||
extern int ipf_frag_soft_fini(ipf_main_softc_t *, void *);
|
||||
extern void ipf_frag_soft_destroy(ipf_main_softc_t *, void *);
|
||||
extern int ipf_frag_main_load(void);
|
||||
extern int ipf_frag_main_unload(void);
|
||||
extern int ipf_frag_load(void);
|
||||
extern void ipf_frag_clear(ipf_main_softc_t *);
|
||||
extern void ipf_frag_expire(ipf_main_softc_t *);
|
||||
extern void ipf_frag_forget(void *);
|
||||
extern int ipf_frag_init(void);
|
||||
extern u_32_t ipf_frag_ipidknown(fr_info_t *);
|
||||
extern int ipf_frag_ipidnew(fr_info_t *, u_32_t);
|
||||
extern frentry_t *ipf_frag_known(fr_info_t *, u_32_t *);
|
||||
extern void ipf_frag_natforget(ipf_main_softc_t *, void *);
|
||||
extern int ipf_frag_natnew(ipf_main_softc_t *, fr_info_t *, u_32_t, struct nat *);
|
||||
extern nat_t *ipf_frag_natknown(fr_info_t *);
|
||||
extern int ipf_frag_new(ipf_main_softc_t *, fr_info_t *, u_32_t);
|
||||
extern ipfrstat_t *ipf_frag_stats(void *);
|
||||
extern void ipf_frag_setlock(void *, int);
|
||||
extern void ipf_frag_pkt_deref(ipf_main_softc_t *, void *);
|
||||
extern int ipf_frag_pkt_next(ipf_main_softc_t *, ipftoken_t *,
|
||||
ipfgeniter_t *);
|
||||
extern void ipf_frag_nat_deref(ipf_main_softc_t *, void *);
|
||||
extern int ipf_frag_nat_next(ipf_main_softc_t *, ipftoken_t *,
|
||||
ipfgeniter_t *);
|
||||
extern void ipf_slowtimer(ipf_main_softc_t *);
|
||||
|
||||
#endif /* __IP_FRAG_H__ */
|
||||
|
@ -66,45 +66,45 @@ typedef struct ipf_ftp_softc_s {
|
||||
} ipf_ftp_softc_t;
|
||||
|
||||
|
||||
void ipf_p_ftp_main_load __P((void));
|
||||
void ipf_p_ftp_main_unload __P((void));
|
||||
void *ipf_p_ftp_soft_create __P((ipf_main_softc_t *));
|
||||
void ipf_p_ftp_soft_destroy __P((ipf_main_softc_t *, void *));
|
||||
void ipf_p_ftp_main_load(void);
|
||||
void ipf_p_ftp_main_unload(void);
|
||||
void *ipf_p_ftp_soft_create(ipf_main_softc_t *);
|
||||
void ipf_p_ftp_soft_destroy(ipf_main_softc_t *, void *);
|
||||
|
||||
int ipf_p_ftp_client __P((ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int));
|
||||
int ipf_p_ftp_complete __P((char *, size_t));
|
||||
int ipf_p_ftp_in __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ipf_p_ftp_new __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
void ipf_p_ftp_del __P((ipf_main_softc_t *, ap_session_t *));
|
||||
int ipf_p_ftp_out __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ipf_p_ftp_pasv __P((ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int));
|
||||
int ipf_p_ftp_epsv __P((ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int));
|
||||
int ipf_p_ftp_port __P((ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int));
|
||||
int ipf_p_ftp_process __P((ipf_ftp_softc_t *, fr_info_t *, nat_t *,
|
||||
ftpinfo_t *, int));
|
||||
int ipf_p_ftp_server __P((ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int));
|
||||
int ipf_p_ftp_valid __P((ipf_ftp_softc_t *, ftpinfo_t *, int, char *, size_t));
|
||||
int ipf_p_ftp_server_valid __P((ipf_ftp_softc_t *, ftpside_t *, char *,
|
||||
size_t));
|
||||
int ipf_p_ftp_client_valid __P((ipf_ftp_softc_t *, ftpside_t *, char *,
|
||||
size_t));
|
||||
u_short ipf_p_ftp_atoi __P((char **));
|
||||
int ipf_p_ftp_pasvreply __P((ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, u_int, char *, char *));
|
||||
int ipf_p_ftp_eprt __P((ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int));
|
||||
int ipf_p_ftp_eprt4 __P((ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int));
|
||||
int ipf_p_ftp_eprt6 __P((ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int));
|
||||
int ipf_p_ftp_addport __P((ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int, int, int));
|
||||
void ipf_p_ftp_setpending __P((ipf_main_softc_t *, ftpinfo_t *));
|
||||
int ipf_p_ftp_client(ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int);
|
||||
int ipf_p_ftp_complete(char *, size_t);
|
||||
int ipf_p_ftp_in(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ipf_p_ftp_new(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
void ipf_p_ftp_del(ipf_main_softc_t *, ap_session_t *);
|
||||
int ipf_p_ftp_out(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ipf_p_ftp_pasv(ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int);
|
||||
int ipf_p_ftp_epsv(ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int);
|
||||
int ipf_p_ftp_port(ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int);
|
||||
int ipf_p_ftp_process(ipf_ftp_softc_t *, fr_info_t *, nat_t *,
|
||||
ftpinfo_t *, int);
|
||||
int ipf_p_ftp_server(ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int);
|
||||
int ipf_p_ftp_valid(ipf_ftp_softc_t *, ftpinfo_t *, int, char *, size_t);
|
||||
int ipf_p_ftp_server_valid(ipf_ftp_softc_t *, ftpside_t *, char *,
|
||||
size_t);
|
||||
int ipf_p_ftp_client_valid(ipf_ftp_softc_t *, ftpside_t *, char *,
|
||||
size_t);
|
||||
u_short ipf_p_ftp_atoi(char **);
|
||||
int ipf_p_ftp_pasvreply(ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, u_int, char *, char *);
|
||||
int ipf_p_ftp_eprt(ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int);
|
||||
int ipf_p_ftp_eprt4(ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int);
|
||||
int ipf_p_ftp_eprt6(ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int);
|
||||
int ipf_p_ftp_addport(ipf_ftp_softc_t *, fr_info_t *, ip_t *, nat_t *,
|
||||
ftpinfo_t *, int, int, int);
|
||||
void ipf_p_ftp_setpending(ipf_main_softc_t *, ftpinfo_t *);
|
||||
|
||||
/*
|
||||
* Debug levels
|
||||
|
@ -53,45 +53,45 @@ static const char rcsid[] = "@(#)$Id$";
|
||||
#endif
|
||||
|
||||
# ifdef USE_INET6
|
||||
static iphtent_t *ipf_iphmfind6 __P((iphtable_t *, i6addr_t *));
|
||||
static iphtent_t *ipf_iphmfind6(iphtable_t *, i6addr_t *);
|
||||
# endif
|
||||
static iphtent_t *ipf_iphmfind __P((iphtable_t *, struct in_addr *));
|
||||
static int ipf_iphmfindip __P((ipf_main_softc_t *, void *, int, void *, u_int));
|
||||
static int ipf_htable_clear __P((ipf_main_softc_t *, void *, iphtable_t *));
|
||||
static int ipf_htable_create __P((ipf_main_softc_t *, void *, iplookupop_t *));
|
||||
static int ipf_htable_deref __P((ipf_main_softc_t *, void *, void *));
|
||||
static int ipf_htable_destroy __P((ipf_main_softc_t *, void *, int, char *));
|
||||
static void *ipf_htable_exists __P((void *, int, char *));
|
||||
static size_t ipf_htable_flush __P((ipf_main_softc_t *, void *,
|
||||
iplookupflush_t *));
|
||||
static void ipf_htable_free __P((void *, iphtable_t *));
|
||||
static int ipf_htable_iter_deref __P((ipf_main_softc_t *, void *, int,
|
||||
int, void *));
|
||||
static int ipf_htable_iter_next __P((ipf_main_softc_t *, void *, ipftoken_t *,
|
||||
ipflookupiter_t *));
|
||||
static int ipf_htable_node_add __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *, int));
|
||||
static int ipf_htable_node_del __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *, int));
|
||||
static int ipf_htable_remove __P((ipf_main_softc_t *, void *, iphtable_t *));
|
||||
static void *ipf_htable_soft_create __P((ipf_main_softc_t *));
|
||||
static void ipf_htable_soft_destroy __P((ipf_main_softc_t *, void *));
|
||||
static int ipf_htable_soft_init __P((ipf_main_softc_t *, void *));
|
||||
static void ipf_htable_soft_fini __P((ipf_main_softc_t *, void *));
|
||||
static int ipf_htable_stats_get __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *));
|
||||
static int ipf_htable_table_add __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *));
|
||||
static int ipf_htable_table_del __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *));
|
||||
static int ipf_htent_deref __P((void *, iphtent_t *));
|
||||
static iphtent_t *ipf_htent_find __P((iphtable_t *, iphtent_t *));
|
||||
static int ipf_htent_insert __P((ipf_main_softc_t *, void *, iphtable_t *,
|
||||
iphtent_t *));
|
||||
static int ipf_htent_remove __P((ipf_main_softc_t *, void *, iphtable_t *,
|
||||
iphtent_t *));
|
||||
static void *ipf_htable_select_add_ref __P((void *, int, char *));
|
||||
static void ipf_htable_expire __P((ipf_main_softc_t *, void *));
|
||||
static iphtent_t *ipf_iphmfind(iphtable_t *, struct in_addr *);
|
||||
static int ipf_iphmfindip(ipf_main_softc_t *, void *, int, void *, u_int);
|
||||
static int ipf_htable_clear(ipf_main_softc_t *, void *, iphtable_t *);
|
||||
static int ipf_htable_create(ipf_main_softc_t *, void *, iplookupop_t *);
|
||||
static int ipf_htable_deref(ipf_main_softc_t *, void *, void *);
|
||||
static int ipf_htable_destroy(ipf_main_softc_t *, void *, int, char *);
|
||||
static void *ipf_htable_exists(void *, int, char *);
|
||||
static size_t ipf_htable_flush(ipf_main_softc_t *, void *,
|
||||
iplookupflush_t *);
|
||||
static void ipf_htable_free(void *, iphtable_t *);
|
||||
static int ipf_htable_iter_deref(ipf_main_softc_t *, void *, int,
|
||||
int, void *);
|
||||
static int ipf_htable_iter_next(ipf_main_softc_t *, void *, ipftoken_t *,
|
||||
ipflookupiter_t *);
|
||||
static int ipf_htable_node_add(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *, int);
|
||||
static int ipf_htable_node_del(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *, int);
|
||||
static int ipf_htable_remove(ipf_main_softc_t *, void *, iphtable_t *);
|
||||
static void *ipf_htable_soft_create(ipf_main_softc_t *);
|
||||
static void ipf_htable_soft_destroy(ipf_main_softc_t *, void *);
|
||||
static int ipf_htable_soft_init(ipf_main_softc_t *, void *);
|
||||
static void ipf_htable_soft_fini(ipf_main_softc_t *, void *);
|
||||
static int ipf_htable_stats_get(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *);
|
||||
static int ipf_htable_table_add(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *);
|
||||
static int ipf_htable_table_del(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *);
|
||||
static int ipf_htent_deref(void *, iphtent_t *);
|
||||
static iphtent_t *ipf_htent_find(iphtable_t *, iphtent_t *);
|
||||
static int ipf_htent_insert(ipf_main_softc_t *, void *, iphtable_t *,
|
||||
iphtent_t *);
|
||||
static int ipf_htent_remove(ipf_main_softc_t *, void *, iphtable_t *,
|
||||
iphtent_t *);
|
||||
static void *ipf_htable_select_add_ref(void *, int, char *);
|
||||
static void ipf_htable_expire(ipf_main_softc_t *, void *);
|
||||
|
||||
|
||||
typedef struct ipf_htable_softc_s {
|
||||
|
@ -71,11 +71,11 @@ typedef struct iphtstat_s {
|
||||
} iphtstat_t;
|
||||
|
||||
|
||||
extern void *ipf_iphmfindgroup __P((ipf_main_softc_t *, void *, void *));
|
||||
extern iphtable_t *ipf_htable_find __P((void *, int, char *));
|
||||
extern void *ipf_iphmfindgroup(ipf_main_softc_t *, void *, void *);
|
||||
extern iphtable_t *ipf_htable_find(void *, int, char *);
|
||||
extern ipf_lookup_t ipf_htable_backend;
|
||||
#ifndef _KERNEL
|
||||
extern void ipf_htable_dump __P((ipf_main_softc_t *, void *));
|
||||
extern void ipf_htable_dump(ipf_main_softc_t *, void *);
|
||||
#endif
|
||||
|
||||
#endif /* __IP_HTABLE_H__ */
|
||||
|
@ -25,16 +25,16 @@ typedef struct ipf_ipsec_softc_s {
|
||||
} ipf_ipsec_softc_t;
|
||||
|
||||
|
||||
void *ipf_p_ipsec_soft_create __P((ipf_main_softc_t *));
|
||||
void ipf_p_ipsec_soft_destroy __P((ipf_main_softc_t *, void *));
|
||||
int ipf_p_ipsec_soft_init __P((ipf_main_softc_t *, void *));
|
||||
void ipf_p_ipsec_soft_fini __P((ipf_main_softc_t *, void *));
|
||||
int ipf_p_ipsec_init __P((void));
|
||||
void ipf_p_ipsec_fini __P((void));
|
||||
int ipf_p_ipsec_new __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
void ipf_p_ipsec_del __P((ipf_main_softc_t *, ap_session_t *));
|
||||
int ipf_p_ipsec_inout __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ipf_p_ipsec_match __P((fr_info_t *, ap_session_t *, nat_t *));
|
||||
void *ipf_p_ipsec_soft_create(ipf_main_softc_t *);
|
||||
void ipf_p_ipsec_soft_destroy(ipf_main_softc_t *, void *);
|
||||
int ipf_p_ipsec_soft_init(ipf_main_softc_t *, void *);
|
||||
void ipf_p_ipsec_soft_fini(ipf_main_softc_t *, void *);
|
||||
int ipf_p_ipsec_init(void);
|
||||
void ipf_p_ipsec_fini(void);
|
||||
int ipf_p_ipsec_new(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
void ipf_p_ipsec_del(ipf_main_softc_t *, ap_session_t *);
|
||||
int ipf_p_ipsec_inout(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ipf_p_ipsec_match(fr_info_t *, ap_session_t *, nat_t *);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -11,13 +11,13 @@
|
||||
#define IPF_IRCBUFSZ 96 /* This *MUST* be >= 64! */
|
||||
|
||||
|
||||
void ipf_p_irc_main_load __P((void));
|
||||
void ipf_p_irc_main_unload __P((void));
|
||||
int ipf_p_irc_new __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ipf_p_irc_out __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ipf_p_irc_send __P((fr_info_t *, nat_t *));
|
||||
int ipf_p_irc_complete __P((ircinfo_t *, char *, size_t));
|
||||
u_short ipf_irc_atoi __P((char **));
|
||||
void ipf_p_irc_main_load(void);
|
||||
void ipf_p_irc_main_unload(void);
|
||||
int ipf_p_irc_new(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ipf_p_irc_out(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ipf_p_irc_send(fr_info_t *, nat_t *);
|
||||
int ipf_p_irc_complete(ircinfo_t *, char *, size_t);
|
||||
u_short ipf_irc_atoi(char **);
|
||||
|
||||
static frentry_t ircnatfr;
|
||||
|
||||
|
@ -66,14 +66,14 @@ static const char rcsid[] = "@(#)$Id$";
|
||||
* array indexing on the unit, +1 is used to map [-1.IPL_LOGMAX] to
|
||||
* [0.POOL_LOOKUP_MAX].
|
||||
*/
|
||||
static int ipf_lookup_addnode __P((ipf_main_softc_t *, caddr_t, int));
|
||||
static int ipf_lookup_delnode __P((ipf_main_softc_t *, caddr_t, int));
|
||||
static int ipf_lookup_addtable __P((ipf_main_softc_t *, caddr_t));
|
||||
static int ipf_lookup_deltable __P((ipf_main_softc_t *, caddr_t));
|
||||
static int ipf_lookup_stats __P((ipf_main_softc_t *, caddr_t));
|
||||
static int ipf_lookup_flush __P((ipf_main_softc_t *, caddr_t));
|
||||
static int ipf_lookup_iterate __P((ipf_main_softc_t *, void *, int, void *));
|
||||
static int ipf_lookup_deltok __P((ipf_main_softc_t *, void *, int, void *));
|
||||
static int ipf_lookup_addnode(ipf_main_softc_t *, caddr_t, int);
|
||||
static int ipf_lookup_delnode(ipf_main_softc_t *, caddr_t, int);
|
||||
static int ipf_lookup_addtable(ipf_main_softc_t *, caddr_t);
|
||||
static int ipf_lookup_deltable(ipf_main_softc_t *, caddr_t);
|
||||
static int ipf_lookup_stats(ipf_main_softc_t *, caddr_t);
|
||||
static int ipf_lookup_flush(ipf_main_softc_t *, caddr_t);
|
||||
static int ipf_lookup_iterate(ipf_main_softc_t *, void *, int, void *);
|
||||
static int ipf_lookup_deltok(ipf_main_softc_t *, void *, int, void *);
|
||||
|
||||
#define MAX_BACKENDS 3
|
||||
static ipf_lookup_t *backends[MAX_BACKENDS] = {
|
||||
|
@ -87,54 +87,54 @@ typedef struct ipflookupiter {
|
||||
|
||||
typedef struct ipf_lookup {
|
||||
int ipfl_type;
|
||||
void *(*ipfl_create) __P((ipf_main_softc_t *));
|
||||
void (*ipfl_destroy) __P((ipf_main_softc_t *, void *));
|
||||
int (*ipfl_init) __P((ipf_main_softc_t *, void *));
|
||||
void (*ipfl_fini) __P((ipf_main_softc_t *, void *));
|
||||
int (*ipfl_addr_find) __P((ipf_main_softc_t *, void *,
|
||||
int, void *, u_int));
|
||||
size_t (*ipfl_flush) __P((ipf_main_softc_t *, void *,
|
||||
iplookupflush_t *));
|
||||
int (*ipfl_iter_deref) __P((ipf_main_softc_t *, void *,
|
||||
int, int, void *));
|
||||
int (*ipfl_iter_next) __P((ipf_main_softc_t *, void *,
|
||||
ipftoken_t *, ipflookupiter_t *));
|
||||
int (*ipfl_node_add) __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *, int));
|
||||
int (*ipfl_node_del) __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *, int));
|
||||
int (*ipfl_stats_get) __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *));
|
||||
int (*ipfl_table_add) __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *));
|
||||
int (*ipfl_table_del) __P((ipf_main_softc_t *, void *,
|
||||
iplookupop_t *));
|
||||
int (*ipfl_table_deref) __P((ipf_main_softc_t *, void *, void *));
|
||||
void *(*ipfl_table_find) __P((void *, int, char *));
|
||||
void *(*ipfl_select_add_ref) __P((void *, int, char *));
|
||||
int (*ipfl_select_node) __P((fr_info_t *, void *, u_32_t *,
|
||||
frdest_t *));
|
||||
void (*ipfl_expire) __P((ipf_main_softc_t *, void *));
|
||||
void (*ipfl_sync) __P((ipf_main_softc_t *, void *));
|
||||
void *(*ipfl_create)(ipf_main_softc_t *);
|
||||
void (*ipfl_destroy)(ipf_main_softc_t *, void *);
|
||||
int (*ipfl_init)(ipf_main_softc_t *, void *);
|
||||
void (*ipfl_fini)(ipf_main_softc_t *, void *);
|
||||
int (*ipfl_addr_find)(ipf_main_softc_t *, void *,
|
||||
int, void *, u_int);
|
||||
size_t (*ipfl_flush)(ipf_main_softc_t *, void *,
|
||||
iplookupflush_t *);
|
||||
int (*ipfl_iter_deref)(ipf_main_softc_t *, void *,
|
||||
int, int, void *);
|
||||
int (*ipfl_iter_next)(ipf_main_softc_t *, void *,
|
||||
ipftoken_t *, ipflookupiter_t *);
|
||||
int (*ipfl_node_add)(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *, int);
|
||||
int (*ipfl_node_del)(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *, int);
|
||||
int (*ipfl_stats_get)(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *);
|
||||
int (*ipfl_table_add)(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *);
|
||||
int (*ipfl_table_del)(ipf_main_softc_t *, void *,
|
||||
iplookupop_t *);
|
||||
int (*ipfl_table_deref)(ipf_main_softc_t *, void *, void *);
|
||||
void *(*ipfl_table_find)(void *, int, char *);
|
||||
void *(*ipfl_select_add_ref)(void *, int, char *);
|
||||
int (*ipfl_select_node)(fr_info_t *, void *, u_32_t *,
|
||||
frdest_t *);
|
||||
void (*ipfl_expire)(ipf_main_softc_t *, void *);
|
||||
void (*ipfl_sync)(ipf_main_softc_t *, void *);
|
||||
} ipf_lookup_t;
|
||||
|
||||
extern int ipf_lookup_init __P((void));
|
||||
extern int ipf_lookup_ioctl __P((ipf_main_softc_t *, caddr_t, ioctlcmd_t, int, int, void *));
|
||||
extern void ipf_lookup_main_unload __P((void));
|
||||
extern void ipf_lookup_deref __P((ipf_main_softc_t *, int, void *));
|
||||
extern void ipf_lookup_iterderef __P((ipf_main_softc_t *, u_32_t, void *));
|
||||
extern void *ipf_lookup_res_name __P((ipf_main_softc_t *, int, u_int, char *,
|
||||
lookupfunc_t *));
|
||||
extern void *ipf_lookup_res_num __P((ipf_main_softc_t *, int, u_int, u_int,
|
||||
lookupfunc_t *));
|
||||
extern void ipf_lookup_soft_destroy __P((ipf_main_softc_t *, void *));
|
||||
extern void *ipf_lookup_soft_create __P((ipf_main_softc_t *));
|
||||
extern int ipf_lookup_soft_init __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_lookup_soft_fini __P((ipf_main_softc_t *, void *));
|
||||
extern void *ipf_lookup_find_htable __P((ipf_main_softc_t *, int, char *));
|
||||
extern void ipf_lookup_expire __P((ipf_main_softc_t *));
|
||||
extern void ipf_lookup_sync __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_lookup_init(void);
|
||||
extern int ipf_lookup_ioctl(ipf_main_softc_t *, caddr_t, ioctlcmd_t, int, int, void *);
|
||||
extern void ipf_lookup_main_unload(void);
|
||||
extern void ipf_lookup_deref(ipf_main_softc_t *, int, void *);
|
||||
extern void ipf_lookup_iterderef(ipf_main_softc_t *, u_32_t, void *);
|
||||
extern void *ipf_lookup_res_name(ipf_main_softc_t *, int, u_int, char *,
|
||||
lookupfunc_t *);
|
||||
extern void *ipf_lookup_res_num(ipf_main_softc_t *, int, u_int, u_int,
|
||||
lookupfunc_t *);
|
||||
extern void ipf_lookup_soft_destroy(ipf_main_softc_t *, void *);
|
||||
extern void *ipf_lookup_soft_create(ipf_main_softc_t *);
|
||||
extern int ipf_lookup_soft_init(ipf_main_softc_t *, void *);
|
||||
extern int ipf_lookup_soft_fini(ipf_main_softc_t *, void *);
|
||||
extern void *ipf_lookup_find_htable(ipf_main_softc_t *, int, char *);
|
||||
extern void ipf_lookup_expire(ipf_main_softc_t *);
|
||||
extern void ipf_lookup_sync(ipf_main_softc_t *, void *);
|
||||
#ifndef _KERNEL
|
||||
extern void ipf_lookup_dump __P((ipf_main_softc_t *, void *));
|
||||
extern void ipf_lookup_dump(ipf_main_softc_t *, void *);
|
||||
#endif
|
||||
#endif /* __IP_LOOKUP_H__ */
|
||||
|
@ -204,56 +204,56 @@ static ipftuneable_t ipf_nat_tuneables[] = {
|
||||
extern int pfil_delayed_copy;
|
||||
#endif
|
||||
|
||||
static int ipf_nat_flush_entry __P((ipf_main_softc_t *, void *));
|
||||
static int ipf_nat_getent __P((ipf_main_softc_t *, caddr_t, int));
|
||||
static int ipf_nat_getsz __P((ipf_main_softc_t *, caddr_t, int));
|
||||
static int ipf_nat_putent __P((ipf_main_softc_t *, caddr_t, int));
|
||||
static void ipf_nat_addmap __P((ipf_nat_softc_t *, ipnat_t *));
|
||||
static void ipf_nat_addrdr __P((ipf_nat_softc_t *, ipnat_t *));
|
||||
static int ipf_nat_builddivertmp __P((ipf_nat_softc_t *, ipnat_t *));
|
||||
static int ipf_nat_clearlist __P((ipf_main_softc_t *, ipf_nat_softc_t *));
|
||||
static int ipf_nat_cmp_rules __P((ipnat_t *, ipnat_t *));
|
||||
static int ipf_nat_decap __P((fr_info_t *, nat_t *));
|
||||
static void ipf_nat_delrule __P((ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
ipnat_t *, int));
|
||||
static int ipf_nat_extraflush __P((ipf_main_softc_t *, ipf_nat_softc_t *, int));
|
||||
static int ipf_nat_finalise __P((fr_info_t *, nat_t *));
|
||||
static int ipf_nat_flushtable __P((ipf_main_softc_t *, ipf_nat_softc_t *));
|
||||
static int ipf_nat_getnext __P((ipf_main_softc_t *, ipftoken_t *,
|
||||
ipfgeniter_t *, ipfobj_t *));
|
||||
static int ipf_nat_gettable __P((ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
char *));
|
||||
static hostmap_t *ipf_nat_hostmap __P((ipf_nat_softc_t *, ipnat_t *,
|
||||
static int ipf_nat_flush_entry(ipf_main_softc_t *, void *);
|
||||
static int ipf_nat_getent(ipf_main_softc_t *, caddr_t, int);
|
||||
static int ipf_nat_getsz(ipf_main_softc_t *, caddr_t, int);
|
||||
static int ipf_nat_putent(ipf_main_softc_t *, caddr_t, int);
|
||||
static void ipf_nat_addmap(ipf_nat_softc_t *, ipnat_t *);
|
||||
static void ipf_nat_addrdr(ipf_nat_softc_t *, ipnat_t *);
|
||||
static int ipf_nat_builddivertmp(ipf_nat_softc_t *, ipnat_t *);
|
||||
static int ipf_nat_clearlist(ipf_main_softc_t *, ipf_nat_softc_t *);
|
||||
static int ipf_nat_cmp_rules(ipnat_t *, ipnat_t *);
|
||||
static int ipf_nat_decap(fr_info_t *, nat_t *);
|
||||
static void ipf_nat_delrule(ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
ipnat_t *, int);
|
||||
static int ipf_nat_extraflush(ipf_main_softc_t *, ipf_nat_softc_t *, int);
|
||||
static int ipf_nat_finalise(fr_info_t *, nat_t *);
|
||||
static int ipf_nat_flushtable(ipf_main_softc_t *, ipf_nat_softc_t *);
|
||||
static int ipf_nat_getnext(ipf_main_softc_t *, ipftoken_t *,
|
||||
ipfgeniter_t *, ipfobj_t *);
|
||||
static int ipf_nat_gettable(ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
char *);
|
||||
static hostmap_t *ipf_nat_hostmap(ipf_nat_softc_t *, ipnat_t *,
|
||||
struct in_addr, struct in_addr,
|
||||
struct in_addr, u_32_t));
|
||||
static int ipf_nat_icmpquerytype __P((int));
|
||||
static int ipf_nat_iterator __P((ipf_main_softc_t *, ipftoken_t *,
|
||||
ipfgeniter_t *, ipfobj_t *));
|
||||
static int ipf_nat_match __P((fr_info_t *, ipnat_t *));
|
||||
static int ipf_nat_matcharray __P((nat_t *, int *, u_long));
|
||||
static int ipf_nat_matchflush __P((ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
caddr_t));
|
||||
static void ipf_nat_mssclamp __P((tcphdr_t *, u_32_t, fr_info_t *,
|
||||
u_short *));
|
||||
static int ipf_nat_newmap __P((fr_info_t *, nat_t *, natinfo_t *));
|
||||
static int ipf_nat_newdivert __P((fr_info_t *, nat_t *, natinfo_t *));
|
||||
static int ipf_nat_newrdr __P((fr_info_t *, nat_t *, natinfo_t *));
|
||||
static int ipf_nat_newrewrite __P((fr_info_t *, nat_t *, natinfo_t *));
|
||||
static int ipf_nat_nextaddr __P((fr_info_t *, nat_addr_t *, u_32_t *,
|
||||
u_32_t *));
|
||||
static int ipf_nat_nextaddrinit __P((ipf_main_softc_t *, char *,
|
||||
nat_addr_t *, int, void *));
|
||||
static int ipf_nat_resolverule __P((ipf_main_softc_t *, ipnat_t *));
|
||||
static int ipf_nat_ruleaddrinit __P((ipf_main_softc_t *,
|
||||
ipf_nat_softc_t *, ipnat_t *));
|
||||
static void ipf_nat_rule_fini __P((ipf_main_softc_t *, ipnat_t *));
|
||||
static int ipf_nat_rule_init __P((ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
ipnat_t *));
|
||||
static int ipf_nat_siocaddnat __P((ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
ipnat_t *, int));
|
||||
static void ipf_nat_siocdelnat __P((ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
ipnat_t *, int));
|
||||
static void ipf_nat_tabmove __P((ipf_nat_softc_t *, nat_t *));
|
||||
struct in_addr, u_32_t);
|
||||
static int ipf_nat_icmpquerytype(int);
|
||||
static int ipf_nat_iterator(ipf_main_softc_t *, ipftoken_t *,
|
||||
ipfgeniter_t *, ipfobj_t *);
|
||||
static int ipf_nat_match(fr_info_t *, ipnat_t *);
|
||||
static int ipf_nat_matcharray(nat_t *, int *, u_long);
|
||||
static int ipf_nat_matchflush(ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
caddr_t);
|
||||
static void ipf_nat_mssclamp(tcphdr_t *, u_32_t, fr_info_t *,
|
||||
u_short *);
|
||||
static int ipf_nat_newmap(fr_info_t *, nat_t *, natinfo_t *);
|
||||
static int ipf_nat_newdivert(fr_info_t *, nat_t *, natinfo_t *);
|
||||
static int ipf_nat_newrdr(fr_info_t *, nat_t *, natinfo_t *);
|
||||
static int ipf_nat_newrewrite(fr_info_t *, nat_t *, natinfo_t *);
|
||||
static int ipf_nat_nextaddr(fr_info_t *, nat_addr_t *, u_32_t *,
|
||||
u_32_t *);
|
||||
static int ipf_nat_nextaddrinit(ipf_main_softc_t *, char *,
|
||||
nat_addr_t *, int, void *);
|
||||
static int ipf_nat_resolverule(ipf_main_softc_t *, ipnat_t *);
|
||||
static int ipf_nat_ruleaddrinit(ipf_main_softc_t *,
|
||||
ipf_nat_softc_t *, ipnat_t *);
|
||||
static void ipf_nat_rule_fini(ipf_main_softc_t *, ipnat_t *);
|
||||
static int ipf_nat_rule_init(ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
ipnat_t *);
|
||||
static int ipf_nat_siocaddnat(ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
ipnat_t *, int);
|
||||
static void ipf_nat_siocdelnat(ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
ipnat_t *, int);
|
||||
static void ipf_nat_tabmove(ipf_nat_softc_t *, nat_t *);
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* Function: ipf_nat_main_load */
|
||||
|
@ -670,96 +670,96 @@ typedef struct ipf_nat_softc_s {
|
||||
|
||||
extern frentry_t ipfnatblock;
|
||||
|
||||
extern void ipf_fix_datacksum __P((u_short *, u_32_t));
|
||||
extern void ipf_fix_incksum __P((int, u_short *, u_32_t, u_32_t));
|
||||
extern void ipf_fix_outcksum __P((int, u_short *, u_32_t, u_32_t));
|
||||
extern void ipf_fix_datacksum(u_short *, u_32_t);
|
||||
extern void ipf_fix_incksum(int, u_short *, u_32_t, u_32_t);
|
||||
extern void ipf_fix_outcksum(int, u_short *, u_32_t, u_32_t);
|
||||
|
||||
extern int ipf_nat_checkin __P((fr_info_t *, u_32_t *));
|
||||
extern int ipf_nat_checkout __P((fr_info_t *, u_32_t *));
|
||||
extern void ipf_nat_delete __P((ipf_main_softc_t *, struct nat *, int));
|
||||
extern void ipf_nat_deref __P((ipf_main_softc_t *, nat_t **));
|
||||
extern void ipf_nat_expire __P((ipf_main_softc_t *));
|
||||
extern int ipf_nat_hashtab_add __P((ipf_main_softc_t *,
|
||||
ipf_nat_softc_t *, nat_t *));
|
||||
extern void ipf_nat_hostmapdel __P((ipf_main_softc_t *, hostmap_t **));
|
||||
extern int ipf_nat_hostmap_rehash __P((ipf_main_softc_t *,
|
||||
ipftuneable_t *, ipftuneval_t *));
|
||||
extern nat_t *ipf_nat_icmperrorlookup __P((fr_info_t *, int));
|
||||
extern nat_t *ipf_nat_icmperror __P((fr_info_t *, u_int *, int));
|
||||
extern int ipf_nat_init __P((void));
|
||||
extern nat_t *ipf_nat_inlookup __P((fr_info_t *, u_int, u_int,
|
||||
struct in_addr, struct in_addr));
|
||||
extern int ipf_nat_in __P((fr_info_t *, nat_t *, int, u_32_t));
|
||||
extern int ipf_nat_insert __P((ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
nat_t *));
|
||||
extern int ipf_nat_ioctl __P((ipf_main_softc_t *, caddr_t, ioctlcmd_t,
|
||||
int, int, void *));
|
||||
extern void ipf_nat_log __P((ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
struct nat *, u_int));
|
||||
extern nat_t *ipf_nat_lookupredir __P((natlookup_t *));
|
||||
extern nat_t *ipf_nat_maplookup __P((void *, u_int, struct in_addr,
|
||||
struct in_addr));
|
||||
extern nat_t *ipf_nat_add __P((fr_info_t *, ipnat_t *, nat_t **,
|
||||
u_int, int));
|
||||
extern int ipf_nat_out __P((fr_info_t *, nat_t *, int, u_32_t));
|
||||
extern nat_t *ipf_nat_outlookup __P((fr_info_t *, u_int, u_int,
|
||||
struct in_addr, struct in_addr));
|
||||
extern u_short *ipf_nat_proto __P((fr_info_t *, nat_t *, u_int));
|
||||
extern void ipf_nat_rule_deref __P((ipf_main_softc_t *, ipnat_t **));
|
||||
extern void ipf_nat_setqueue __P((ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
nat_t *));
|
||||
extern void ipf_nat_setpending __P((ipf_main_softc_t *, nat_t *));
|
||||
extern nat_t *ipf_nat_tnlookup __P((fr_info_t *, int));
|
||||
extern void ipf_nat_update __P((fr_info_t *, nat_t *));
|
||||
extern int ipf_nat_rehash __P((ipf_main_softc_t *, ipftuneable_t *,
|
||||
ipftuneval_t *));
|
||||
extern int ipf_nat_rehash_rules __P((ipf_main_softc_t *, ipftuneable_t *,
|
||||
ipftuneval_t *));
|
||||
extern int ipf_nat_settimeout __P((struct ipf_main_softc_s *,
|
||||
ipftuneable_t *, ipftuneval_t *));
|
||||
extern void ipf_nat_sync __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_nat_checkin(fr_info_t *, u_32_t *);
|
||||
extern int ipf_nat_checkout(fr_info_t *, u_32_t *);
|
||||
extern void ipf_nat_delete(ipf_main_softc_t *, struct nat *, int);
|
||||
extern void ipf_nat_deref(ipf_main_softc_t *, nat_t **);
|
||||
extern void ipf_nat_expire(ipf_main_softc_t *);
|
||||
extern int ipf_nat_hashtab_add(ipf_main_softc_t *,
|
||||
ipf_nat_softc_t *, nat_t *);
|
||||
extern void ipf_nat_hostmapdel(ipf_main_softc_t *, hostmap_t **);
|
||||
extern int ipf_nat_hostmap_rehash(ipf_main_softc_t *,
|
||||
ipftuneable_t *, ipftuneval_t *);
|
||||
extern nat_t *ipf_nat_icmperrorlookup(fr_info_t *, int);
|
||||
extern nat_t *ipf_nat_icmperror(fr_info_t *, u_int *, int);
|
||||
extern int ipf_nat_init(void);
|
||||
extern nat_t *ipf_nat_inlookup(fr_info_t *, u_int, u_int,
|
||||
struct in_addr, struct in_addr);
|
||||
extern int ipf_nat_in(fr_info_t *, nat_t *, int, u_32_t);
|
||||
extern int ipf_nat_insert(ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
nat_t *);
|
||||
extern int ipf_nat_ioctl(ipf_main_softc_t *, caddr_t, ioctlcmd_t,
|
||||
int, int, void *);
|
||||
extern void ipf_nat_log(ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
struct nat *, u_int);
|
||||
extern nat_t *ipf_nat_lookupredir(natlookup_t *);
|
||||
extern nat_t *ipf_nat_maplookup(void *, u_int, struct in_addr,
|
||||
struct in_addr);
|
||||
extern nat_t *ipf_nat_add(fr_info_t *, ipnat_t *, nat_t **,
|
||||
u_int, int);
|
||||
extern int ipf_nat_out(fr_info_t *, nat_t *, int, u_32_t);
|
||||
extern nat_t *ipf_nat_outlookup(fr_info_t *, u_int, u_int,
|
||||
struct in_addr, struct in_addr);
|
||||
extern u_short *ipf_nat_proto(fr_info_t *, nat_t *, u_int);
|
||||
extern void ipf_nat_rule_deref(ipf_main_softc_t *, ipnat_t **);
|
||||
extern void ipf_nat_setqueue(ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
nat_t *);
|
||||
extern void ipf_nat_setpending(ipf_main_softc_t *, nat_t *);
|
||||
extern nat_t *ipf_nat_tnlookup(fr_info_t *, int);
|
||||
extern void ipf_nat_update(fr_info_t *, nat_t *);
|
||||
extern int ipf_nat_rehash(ipf_main_softc_t *, ipftuneable_t *,
|
||||
ipftuneval_t *);
|
||||
extern int ipf_nat_rehash_rules(ipf_main_softc_t *, ipftuneable_t *,
|
||||
ipftuneval_t *);
|
||||
extern int ipf_nat_settimeout(struct ipf_main_softc_s *,
|
||||
ipftuneable_t *, ipftuneval_t *);
|
||||
extern void ipf_nat_sync(ipf_main_softc_t *, void *);
|
||||
|
||||
extern nat_t *ipf_nat_clone __P((fr_info_t *, nat_t *));
|
||||
extern void ipf_nat_delmap __P((ipf_nat_softc_t *, ipnat_t *));
|
||||
extern void ipf_nat_delrdr __P((ipf_nat_softc_t *, ipnat_t *));
|
||||
extern int ipf_nat_wildok __P((nat_t *, int, int, int, int));
|
||||
extern void ipf_nat_setlock __P((void *, int));
|
||||
extern void ipf_nat_load __P((void));
|
||||
extern void *ipf_nat_soft_create __P((ipf_main_softc_t *));
|
||||
extern int ipf_nat_soft_init __P((ipf_main_softc_t *, void *));
|
||||
extern void ipf_nat_soft_destroy __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_nat_soft_fini __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_nat_main_load __P((void));
|
||||
extern int ipf_nat_main_unload __P((void));
|
||||
extern ipftq_t *ipf_nat_add_tq __P((ipf_main_softc_t *, int));
|
||||
extern void ipf_nat_uncreate __P((fr_info_t *));
|
||||
extern nat_t *ipf_nat_clone(fr_info_t *, nat_t *);
|
||||
extern void ipf_nat_delmap(ipf_nat_softc_t *, ipnat_t *);
|
||||
extern void ipf_nat_delrdr(ipf_nat_softc_t *, ipnat_t *);
|
||||
extern int ipf_nat_wildok(nat_t *, int, int, int, int);
|
||||
extern void ipf_nat_setlock(void *, int);
|
||||
extern void ipf_nat_load(void);
|
||||
extern void *ipf_nat_soft_create(ipf_main_softc_t *);
|
||||
extern int ipf_nat_soft_init(ipf_main_softc_t *, void *);
|
||||
extern void ipf_nat_soft_destroy(ipf_main_softc_t *, void *);
|
||||
extern int ipf_nat_soft_fini(ipf_main_softc_t *, void *);
|
||||
extern int ipf_nat_main_load(void);
|
||||
extern int ipf_nat_main_unload(void);
|
||||
extern ipftq_t *ipf_nat_add_tq(ipf_main_softc_t *, int);
|
||||
extern void ipf_nat_uncreate(fr_info_t *);
|
||||
|
||||
#ifdef USE_INET6
|
||||
extern nat_t *ipf_nat6_add __P((fr_info_t *, ipnat_t *, nat_t **,
|
||||
u_int, int));
|
||||
extern void ipf_nat6_addrdr __P((ipf_nat_softc_t *, ipnat_t *));
|
||||
extern void ipf_nat6_addmap __P((ipf_nat_softc_t *, ipnat_t *));
|
||||
extern void ipf_nat6_addencap __P((ipf_nat_softc_t *, ipnat_t *));
|
||||
extern int ipf_nat6_checkout __P((fr_info_t *, u_32_t *));
|
||||
extern int ipf_nat6_checkin __P((fr_info_t *, u_32_t *));
|
||||
extern void ipf_nat6_delmap __P((ipf_nat_softc_t *, ipnat_t *));
|
||||
extern void ipf_nat6_delrdr __P((ipf_nat_softc_t *, ipnat_t *));
|
||||
extern int ipf_nat6_finalise __P((fr_info_t *, nat_t *));
|
||||
extern nat_t *ipf_nat6_icmperror __P((fr_info_t *, u_int *, int));
|
||||
extern nat_t *ipf_nat6_icmperrorlookup __P((fr_info_t *, int));
|
||||
extern nat_t *ipf_nat6_inlookup __P((fr_info_t *, u_int, u_int,
|
||||
struct in6_addr *, struct in6_addr *));
|
||||
extern u_32_t ipf_nat6_ip6subtract __P((i6addr_t *, i6addr_t *));
|
||||
extern frentry_t *ipf_nat6_ipfin __P((fr_info_t *, u_32_t *));
|
||||
extern frentry_t *ipf_nat6_ipfout __P((fr_info_t *, u_32_t *));
|
||||
extern nat_t *ipf_nat6_lookupredir __P((natlookup_t *));
|
||||
extern int ipf_nat6_newmap __P((fr_info_t *, nat_t *, natinfo_t *));
|
||||
extern int ipf_nat6_newrdr __P((fr_info_t *, nat_t *, natinfo_t *));
|
||||
extern nat_t *ipf_nat6_outlookup __P((fr_info_t *, u_int, u_int,
|
||||
struct in6_addr *, struct in6_addr *));
|
||||
extern int ipf_nat6_newrewrite __P((fr_info_t *, nat_t *, natinfo_t *));
|
||||
extern int ipf_nat6_newdivert __P((fr_info_t *, nat_t *, natinfo_t *));
|
||||
extern int ipf_nat6_ruleaddrinit __P((ipf_main_softc_t *, ipf_nat_softc_t *, ipnat_t *));
|
||||
extern nat_t *ipf_nat6_add(fr_info_t *, ipnat_t *, nat_t **,
|
||||
u_int, int);
|
||||
extern void ipf_nat6_addrdr(ipf_nat_softc_t *, ipnat_t *);
|
||||
extern void ipf_nat6_addmap(ipf_nat_softc_t *, ipnat_t *);
|
||||
extern void ipf_nat6_addencap(ipf_nat_softc_t *, ipnat_t *);
|
||||
extern int ipf_nat6_checkout(fr_info_t *, u_32_t *);
|
||||
extern int ipf_nat6_checkin(fr_info_t *, u_32_t *);
|
||||
extern void ipf_nat6_delmap(ipf_nat_softc_t *, ipnat_t *);
|
||||
extern void ipf_nat6_delrdr(ipf_nat_softc_t *, ipnat_t *);
|
||||
extern int ipf_nat6_finalise(fr_info_t *, nat_t *);
|
||||
extern nat_t *ipf_nat6_icmperror(fr_info_t *, u_int *, int);
|
||||
extern nat_t *ipf_nat6_icmperrorlookup(fr_info_t *, int);
|
||||
extern nat_t *ipf_nat6_inlookup(fr_info_t *, u_int, u_int,
|
||||
struct in6_addr *, struct in6_addr *);
|
||||
extern u_32_t ipf_nat6_ip6subtract(i6addr_t *, i6addr_t *);
|
||||
extern frentry_t *ipf_nat6_ipfin(fr_info_t *, u_32_t *);
|
||||
extern frentry_t *ipf_nat6_ipfout(fr_info_t *, u_32_t *);
|
||||
extern nat_t *ipf_nat6_lookupredir(natlookup_t *);
|
||||
extern int ipf_nat6_newmap(fr_info_t *, nat_t *, natinfo_t *);
|
||||
extern int ipf_nat6_newrdr(fr_info_t *, nat_t *, natinfo_t *);
|
||||
extern nat_t *ipf_nat6_outlookup(fr_info_t *, u_int, u_int,
|
||||
struct in6_addr *, struct in6_addr *);
|
||||
extern int ipf_nat6_newrewrite(fr_info_t *, nat_t *, natinfo_t *);
|
||||
extern int ipf_nat6_newdivert(fr_info_t *, nat_t *, natinfo_t *);
|
||||
extern int ipf_nat6_ruleaddrinit(ipf_main_softc_t *, ipf_nat_softc_t *, ipnat_t *);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -106,22 +106,22 @@ static const char rcsid[] = "@(#)$Id: ip_nat6.c,v 1.22.2.20 2012/07/22 08:04:23
|
||||
#endif
|
||||
|
||||
#ifdef USE_INET6
|
||||
static struct hostmap *ipf_nat6_hostmap __P((ipf_nat_softc_t *, ipnat_t *,
|
||||
static struct hostmap *ipf_nat6_hostmap(ipf_nat_softc_t *, ipnat_t *,
|
||||
i6addr_t *, i6addr_t *,
|
||||
i6addr_t *, u_32_t));
|
||||
static int ipf_nat6_match __P((fr_info_t *, ipnat_t *));
|
||||
static void ipf_nat6_tabmove __P((ipf_nat_softc_t *, nat_t *));
|
||||
static int ipf_nat6_decap __P((fr_info_t *, nat_t *));
|
||||
static int ipf_nat6_nextaddr __P((fr_info_t *, nat_addr_t *, i6addr_t *,
|
||||
i6addr_t *));
|
||||
static int ipf_nat6_icmpquerytype __P((int));
|
||||
static int ipf_nat6_out __P((fr_info_t *, nat_t *, int, u_32_t));
|
||||
static int ipf_nat6_in __P((fr_info_t *, nat_t *, int, u_32_t));
|
||||
static int ipf_nat6_builddivertmp __P((ipf_nat_softc_t *, ipnat_t *));
|
||||
static int ipf_nat6_nextaddrinit __P((ipf_main_softc_t *, char *,
|
||||
nat_addr_t *, int, void *));
|
||||
static int ipf_nat6_insert __P((ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
nat_t *));
|
||||
i6addr_t *, u_32_t);
|
||||
static int ipf_nat6_match(fr_info_t *, ipnat_t *);
|
||||
static void ipf_nat6_tabmove(ipf_nat_softc_t *, nat_t *);
|
||||
static int ipf_nat6_decap(fr_info_t *, nat_t *);
|
||||
static int ipf_nat6_nextaddr(fr_info_t *, nat_addr_t *, i6addr_t *,
|
||||
i6addr_t *);
|
||||
static int ipf_nat6_icmpquerytype(int);
|
||||
static int ipf_nat6_out(fr_info_t *, nat_t *, int, u_32_t);
|
||||
static int ipf_nat6_in(fr_info_t *, nat_t *, int, u_32_t);
|
||||
static int ipf_nat6_builddivertmp(ipf_nat_softc_t *, ipnat_t *);
|
||||
static int ipf_nat6_nextaddrinit(ipf_main_softc_t *, char *,
|
||||
nat_addr_t *, int, void *);
|
||||
static int ipf_nat6_insert(ipf_main_softc_t *, ipf_nat_softc_t *,
|
||||
nat_t *);
|
||||
|
||||
|
||||
#define NINCLSIDE6(y,x) ATOMIC_INCL(softn->ipf_nat_stats.ns_side6[y].x)
|
||||
|
@ -34,9 +34,9 @@
|
||||
|
||||
#define IPF_NETBIOS_PROXY
|
||||
|
||||
void ipf_p_netbios_main_load __P((void));
|
||||
void ipf_p_netbios_main_unload __P((void));
|
||||
int ipf_p_netbios_out __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
void ipf_p_netbios_main_load(void);
|
||||
void ipf_p_netbios_main_unload(void);
|
||||
int ipf_p_netbios_out(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
|
||||
static frentry_t netbiosfr;
|
||||
|
||||
|
@ -69,41 +69,41 @@ typedef struct ipf_pool_softc_s {
|
||||
} ipf_pool_softc_t;
|
||||
|
||||
|
||||
static void ipf_pool_clearnodes __P((ipf_main_softc_t *, ipf_pool_softc_t *,
|
||||
ip_pool_t *));
|
||||
static int ipf_pool_create __P((ipf_main_softc_t *, ipf_pool_softc_t *, iplookupop_t *));
|
||||
static int ipf_pool_deref __P((ipf_main_softc_t *, void *, void *));
|
||||
static int ipf_pool_destroy __P((ipf_main_softc_t *, ipf_pool_softc_t *, int, char *));
|
||||
static void *ipf_pool_exists __P((ipf_pool_softc_t *, int, char *));
|
||||
static void *ipf_pool_find __P((void *, int, char *));
|
||||
static ip_pool_node_t *ipf_pool_findeq __P((ipf_pool_softc_t *, ip_pool_t *,
|
||||
addrfamily_t *, addrfamily_t *));
|
||||
static void ipf_pool_free __P((ipf_main_softc_t *, ipf_pool_softc_t *,
|
||||
ip_pool_t *));
|
||||
static int ipf_pool_insert_node __P((ipf_main_softc_t *, ipf_pool_softc_t *,
|
||||
ip_pool_t *, struct ip_pool_node *));
|
||||
static int ipf_pool_iter_deref __P((ipf_main_softc_t *, void *, int, int, void *));
|
||||
static int ipf_pool_iter_next __P((ipf_main_softc_t *, void *, ipftoken_t *,
|
||||
ipflookupiter_t *));
|
||||
static size_t ipf_pool_flush __P((ipf_main_softc_t *, void *, iplookupflush_t *));
|
||||
static int ipf_pool_node_add __P((ipf_main_softc_t *, void *, iplookupop_t *,
|
||||
int));
|
||||
static int ipf_pool_node_del __P((ipf_main_softc_t *, void *, iplookupop_t *,
|
||||
int));
|
||||
static void ipf_pool_node_deref __P((ipf_pool_softc_t *, ip_pool_node_t *));
|
||||
static int ipf_pool_remove_node __P((ipf_main_softc_t *, ipf_pool_softc_t *,
|
||||
ip_pool_t *, ip_pool_node_t *));
|
||||
static int ipf_pool_search __P((ipf_main_softc_t *, void *, int,
|
||||
void *, u_int));
|
||||
static void *ipf_pool_soft_create __P((ipf_main_softc_t *));
|
||||
static void ipf_pool_soft_destroy __P((ipf_main_softc_t *, void *));
|
||||
static void ipf_pool_soft_fini __P((ipf_main_softc_t *, void *));
|
||||
static int ipf_pool_soft_init __P((ipf_main_softc_t *, void *));
|
||||
static int ipf_pool_stats_get __P((ipf_main_softc_t *, void *, iplookupop_t *));
|
||||
static int ipf_pool_table_add __P((ipf_main_softc_t *, void *, iplookupop_t *));
|
||||
static int ipf_pool_table_del __P((ipf_main_softc_t *, void *, iplookupop_t *));
|
||||
static void *ipf_pool_select_add_ref __P((void *, int, char *));
|
||||
static void ipf_pool_expire __P((ipf_main_softc_t *, void *));
|
||||
static void ipf_pool_clearnodes(ipf_main_softc_t *, ipf_pool_softc_t *,
|
||||
ip_pool_t *);
|
||||
static int ipf_pool_create(ipf_main_softc_t *, ipf_pool_softc_t *, iplookupop_t *);
|
||||
static int ipf_pool_deref(ipf_main_softc_t *, void *, void *);
|
||||
static int ipf_pool_destroy(ipf_main_softc_t *, ipf_pool_softc_t *, int, char *);
|
||||
static void *ipf_pool_exists(ipf_pool_softc_t *, int, char *);
|
||||
static void *ipf_pool_find(void *, int, char *);
|
||||
static ip_pool_node_t *ipf_pool_findeq(ipf_pool_softc_t *, ip_pool_t *,
|
||||
addrfamily_t *, addrfamily_t *);
|
||||
static void ipf_pool_free(ipf_main_softc_t *, ipf_pool_softc_t *,
|
||||
ip_pool_t *);
|
||||
static int ipf_pool_insert_node(ipf_main_softc_t *, ipf_pool_softc_t *,
|
||||
ip_pool_t *, struct ip_pool_node *);
|
||||
static int ipf_pool_iter_deref(ipf_main_softc_t *, void *, int, int, void *);
|
||||
static int ipf_pool_iter_next(ipf_main_softc_t *, void *, ipftoken_t *,
|
||||
ipflookupiter_t *);
|
||||
static size_t ipf_pool_flush(ipf_main_softc_t *, void *, iplookupflush_t *);
|
||||
static int ipf_pool_node_add(ipf_main_softc_t *, void *, iplookupop_t *,
|
||||
int);
|
||||
static int ipf_pool_node_del(ipf_main_softc_t *, void *, iplookupop_t *,
|
||||
int);
|
||||
static void ipf_pool_node_deref(ipf_pool_softc_t *, ip_pool_node_t *);
|
||||
static int ipf_pool_remove_node(ipf_main_softc_t *, ipf_pool_softc_t *,
|
||||
ip_pool_t *, ip_pool_node_t *);
|
||||
static int ipf_pool_search(ipf_main_softc_t *, void *, int,
|
||||
void *, u_int);
|
||||
static void *ipf_pool_soft_create(ipf_main_softc_t *);
|
||||
static void ipf_pool_soft_destroy(ipf_main_softc_t *, void *);
|
||||
static void ipf_pool_soft_fini(ipf_main_softc_t *, void *);
|
||||
static int ipf_pool_soft_init(ipf_main_softc_t *, void *);
|
||||
static int ipf_pool_stats_get(ipf_main_softc_t *, void *, iplookupop_t *);
|
||||
static int ipf_pool_table_add(ipf_main_softc_t *, void *, iplookupop_t *);
|
||||
static int ipf_pool_table_del(ipf_main_softc_t *, void *, iplookupop_t *);
|
||||
static void *ipf_pool_select_add_ref(void *, int, char *);
|
||||
static void ipf_pool_expire(ipf_main_softc_t *, void *);
|
||||
|
||||
ipf_lookup_t ipf_pool_backend = {
|
||||
IPLT_POOL,
|
||||
@ -130,7 +130,7 @@ ipf_lookup_t ipf_pool_backend = {
|
||||
|
||||
|
||||
#ifdef TEST_POOL
|
||||
void treeprint __P((ip_pool_t *));
|
||||
void treeprint(ip_pool_t *);
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
@ -732,7 +732,7 @@ ipf_pool_select_add_ref(arg, unit, name)
|
||||
/* */
|
||||
/* Searches for an exact match of an entry in the pool. */
|
||||
/* ------------------------------------------------------------------------ */
|
||||
extern void printhostmask __P((int, u_32_t *, u_32_t *));
|
||||
extern void printhostmask(int, u_32_t *, u_32_t *));
|
||||
static ip_pool_node_t *
|
||||
ipf_pool_findeq(softp, ipo, addr, mask)
|
||||
ipf_pool_softc_t *softp;
|
||||
|
@ -61,7 +61,7 @@ typedef struct ipf_pool_stat {
|
||||
extern ipf_lookup_t ipf_pool_backend;
|
||||
|
||||
#ifndef _KERNEL
|
||||
extern void ipf_pool_dump __P((ipf_main_softc_t *, void *));
|
||||
extern void ipf_pool_dump(ipf_main_softc_t *, void *);
|
||||
#endif
|
||||
|
||||
#endif /* __IP_POOL_H__ */
|
||||
|
@ -57,15 +57,15 @@ typedef struct pptp_hdr {
|
||||
#define PPTP_MTCTL_LINKINFO 15
|
||||
|
||||
|
||||
void ipf_p_pptp_main_load __P((void));
|
||||
void ipf_p_pptp_main_unload __P((void));
|
||||
int ipf_p_pptp_new __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
void ipf_p_pptp_del __P((ipf_main_softc_t *, ap_session_t *));
|
||||
int ipf_p_pptp_inout __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
void ipf_p_pptp_donatstate __P((fr_info_t *, nat_t *, pptp_pxy_t *));
|
||||
int ipf_p_pptp_message __P((fr_info_t *, nat_t *, pptp_pxy_t *, pptp_side_t *));
|
||||
int ipf_p_pptp_nextmessage __P((fr_info_t *, nat_t *, pptp_pxy_t *, int));
|
||||
int ipf_p_pptp_mctl __P((fr_info_t *, nat_t *, pptp_pxy_t *, pptp_side_t *));
|
||||
void ipf_p_pptp_main_load(void);
|
||||
void ipf_p_pptp_main_unload(void);
|
||||
int ipf_p_pptp_new(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
void ipf_p_pptp_del(ipf_main_softc_t *, ap_session_t *);
|
||||
int ipf_p_pptp_inout(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
void ipf_p_pptp_donatstate(fr_info_t *, nat_t *, pptp_pxy_t *);
|
||||
int ipf_p_pptp_message(fr_info_t *, nat_t *, pptp_pxy_t *, pptp_side_t *);
|
||||
int ipf_p_pptp_nextmessage(fr_info_t *, nat_t *, pptp_pxy_t *, int);
|
||||
int ipf_p_pptp_mctl(fr_info_t *, nat_t *, pptp_pxy_t *, pptp_side_t *);
|
||||
|
||||
static frentry_t pptpfr;
|
||||
|
||||
|
@ -104,8 +104,8 @@ static const char rcsid[] = "@(#)$Id$";
|
||||
|
||||
#define AP_SESS_SIZE 53
|
||||
|
||||
static int ipf_proxy_fixseqack __P((fr_info_t *, ip_t *, ap_session_t *, int ));
|
||||
static aproxy_t *ipf_proxy_create_clone __P((ipf_main_softc_t *, aproxy_t *));
|
||||
static int ipf_proxy_fixseqack(fr_info_t *, ip_t *, ap_session_t *, int );
|
||||
static aproxy_t *ipf_proxy_create_clone(ipf_main_softc_t *, aproxy_t *);
|
||||
|
||||
typedef struct ipf_proxy_softc_s {
|
||||
int ips_proxy_debug;
|
||||
|
@ -103,23 +103,23 @@ typedef struct aproxy {
|
||||
int apr_flags;
|
||||
int apr_ref;
|
||||
int apr_clones;
|
||||
void (* apr_load) __P((void));
|
||||
void (* apr_unload) __P((void));
|
||||
void *(* apr_create) __P((ipf_main_softc_t *));
|
||||
void (* apr_destroy) __P((ipf_main_softc_t *, void *));
|
||||
int (* apr_init) __P((ipf_main_softc_t *, void *));
|
||||
void (* apr_fini) __P((ipf_main_softc_t *, void *));
|
||||
int (* apr_new) __P((void *, fr_info_t *, ap_session_t *,
|
||||
struct nat *));
|
||||
void (* apr_del) __P((ipf_main_softc_t *, ap_session_t *));
|
||||
int (* apr_inpkt) __P((void *, fr_info_t *, ap_session_t *,
|
||||
struct nat *));
|
||||
int (* apr_outpkt) __P((void *, fr_info_t *, ap_session_t *,
|
||||
struct nat *));
|
||||
int (* apr_match) __P((fr_info_t *, ap_session_t *, struct nat *));
|
||||
int (* apr_ctl) __P((ipf_main_softc_t *, void *, ap_ctl_t *));
|
||||
int (* apr_clear) __P((struct aproxy *));
|
||||
int (* apr_flush) __P((struct aproxy *, int));
|
||||
void (* apr_load)(void);
|
||||
void (* apr_unload)(void);
|
||||
void *(* apr_create)(ipf_main_softc_t *);
|
||||
void (* apr_destroy)(ipf_main_softc_t *, void *);
|
||||
int (* apr_init)(ipf_main_softc_t *, void *);
|
||||
void (* apr_fini)(ipf_main_softc_t *, void *);
|
||||
int (* apr_new)(void *, fr_info_t *, ap_session_t *,
|
||||
struct nat *);
|
||||
void (* apr_del)(ipf_main_softc_t *, ap_session_t *);
|
||||
int (* apr_inpkt)(void *, fr_info_t *, ap_session_t *,
|
||||
struct nat *);
|
||||
int (* apr_outpkt)(void *, fr_info_t *, ap_session_t *,
|
||||
struct nat *);
|
||||
int (* apr_match)(fr_info_t *, ap_session_t *, struct nat *);
|
||||
int (* apr_ctl)(ipf_main_softc_t *, void *, ap_ctl_t *);
|
||||
int (* apr_clear)(struct aproxy *);
|
||||
int (* apr_flush)(struct aproxy *, int);
|
||||
void *apr_soft;
|
||||
} aproxy_t;
|
||||
|
||||
@ -438,26 +438,26 @@ typedef struct rpcb_session {
|
||||
*/
|
||||
#define XDRALIGN(x) ((((x) % 4) != 0) ? ((((x) + 3) / 4) * 4) : (x))
|
||||
|
||||
extern int ipf_proxy_add __P((void *, aproxy_t *));
|
||||
extern int ipf_proxy_check __P((fr_info_t *, struct nat *));
|
||||
extern int ipf_proxy_ctl __P((ipf_main_softc_t *, void *, ap_ctl_t *));
|
||||
extern int ipf_proxy_del __P((aproxy_t *));
|
||||
extern void ipf_proxy_deref __P((aproxy_t *));
|
||||
extern void ipf_proxy_flush __P((void *, int));
|
||||
extern int ipf_proxy_init __P((void));
|
||||
extern int ipf_proxy_ioctl __P((ipf_main_softc_t *, caddr_t, ioctlcmd_t, int, void *));
|
||||
extern aproxy_t *ipf_proxy_lookup __P((void *, u_int, char *));
|
||||
extern int ipf_proxy_match __P((fr_info_t *, struct nat *));
|
||||
extern int ipf_proxy_new __P((fr_info_t *, struct nat *));
|
||||
extern int ipf_proxy_ok __P((fr_info_t *, tcphdr_t *, struct ipnat *));
|
||||
extern void ipf_proxy_free __P((ipf_main_softc_t *, ap_session_t *));
|
||||
extern int ipf_proxy_main_load __P((void));
|
||||
extern int ipf_proxy_main_unload __P((void));
|
||||
extern ipnat_t *ipf_proxy_rule_fwd __P((nat_t *));
|
||||
extern ipnat_t *ipf_proxy_rule_rev __P((nat_t *));
|
||||
extern void *ipf_proxy_soft_create __P((ipf_main_softc_t *));
|
||||
extern void ipf_proxy_soft_destroy __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_proxy_soft_init __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_proxy_soft_fini __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_proxy_add(void *, aproxy_t *);
|
||||
extern int ipf_proxy_check(fr_info_t *, struct nat *);
|
||||
extern int ipf_proxy_ctl(ipf_main_softc_t *, void *, ap_ctl_t *);
|
||||
extern int ipf_proxy_del(aproxy_t *);
|
||||
extern void ipf_proxy_deref(aproxy_t *);
|
||||
extern void ipf_proxy_flush(void *, int);
|
||||
extern int ipf_proxy_init(void);
|
||||
extern int ipf_proxy_ioctl(ipf_main_softc_t *, caddr_t, ioctlcmd_t, int, void *);
|
||||
extern aproxy_t *ipf_proxy_lookup(void *, u_int, char *);
|
||||
extern int ipf_proxy_match(fr_info_t *, struct nat *);
|
||||
extern int ipf_proxy_new(fr_info_t *, struct nat *);
|
||||
extern int ipf_proxy_ok(fr_info_t *, tcphdr_t *, struct ipnat *);
|
||||
extern void ipf_proxy_free(ipf_main_softc_t *, ap_session_t *);
|
||||
extern int ipf_proxy_main_load(void);
|
||||
extern int ipf_proxy_main_unload(void);
|
||||
extern ipnat_t *ipf_proxy_rule_fwd(nat_t *);
|
||||
extern ipnat_t *ipf_proxy_rule_rev(nat_t *);
|
||||
extern void *ipf_proxy_soft_create(ipf_main_softc_t *);
|
||||
extern void ipf_proxy_soft_destroy(ipf_main_softc_t *, void *);
|
||||
extern int ipf_proxy_soft_init(ipf_main_softc_t *, void *);
|
||||
extern int ipf_proxy_soft_fini(ipf_main_softc_t *, void *);
|
||||
|
||||
#endif /* __IP_PROXY_H__ */
|
||||
|
@ -11,11 +11,11 @@
|
||||
#define IPF_RAUDIO_PROXY
|
||||
|
||||
|
||||
void ipf_p_raudio_main_load __P((void));
|
||||
void ipf_p_raudio_main_unload __P((void));
|
||||
int ipf_p_raudio_new __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ipf_p_raudio_in __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ipf_p_raudio_out __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
void ipf_p_raudio_main_load(void);
|
||||
void ipf_p_raudio_main_unload(void);
|
||||
int ipf_p_raudio_new(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ipf_p_raudio_in(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ipf_p_raudio_out(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
|
||||
static frentry_t raudiofr;
|
||||
|
||||
|
@ -20,17 +20,17 @@ typedef struct rcmdinfo {
|
||||
ipnat_t *rcmd_rule; /* Template rule for back connection */
|
||||
} rcmdinfo_t;
|
||||
|
||||
void ipf_p_rcmd_main_load __P((void));
|
||||
void ipf_p_rcmd_main_unload __P((void));
|
||||
void ipf_p_rcmd_main_load(void);
|
||||
void ipf_p_rcmd_main_unload(void);
|
||||
|
||||
int ipf_p_rcmd_init __P((void));
|
||||
void ipf_p_rcmd_fini __P((void));
|
||||
void ipf_p_rcmd_del __P((ipf_main_softc_t *, ap_session_t *));
|
||||
int ipf_p_rcmd_new __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ipf_p_rcmd_out __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ipf_p_rcmd_in __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
u_short ipf_rcmd_atoi __P((char *));
|
||||
int ipf_p_rcmd_portmsg __P((fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ipf_p_rcmd_init(void);
|
||||
void ipf_p_rcmd_fini(void);
|
||||
void ipf_p_rcmd_del(ipf_main_softc_t *, ap_session_t *);
|
||||
int ipf_p_rcmd_new(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ipf_p_rcmd_out(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ipf_p_rcmd_in(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
u_short ipf_rcmd_atoi(char *);
|
||||
int ipf_p_rcmd_portmsg(fr_info_t *, ap_session_t *, nat_t *);
|
||||
|
||||
static frentry_t rcmdfr;
|
||||
|
||||
|
@ -44,36 +44,36 @@
|
||||
/*
|
||||
* Function prototypes
|
||||
*/
|
||||
void ipf_p_rpcb_main_load __P((void));
|
||||
void ipf_p_rpcb_main_unload __P((void));
|
||||
int ipf_p_rpcb_new __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
void ipf_p_rpcb_del __P((ipf_main_softc_t *, ap_session_t *));
|
||||
int ipf_p_rpcb_in __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ipf_p_rpcb_out __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
void ipf_p_rpcb_main_load(void);
|
||||
void ipf_p_rpcb_main_unload(void);
|
||||
int ipf_p_rpcb_new(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
void ipf_p_rpcb_del(ipf_main_softc_t *, ap_session_t *);
|
||||
int ipf_p_rpcb_in(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ipf_p_rpcb_out(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
|
||||
static void ipf_p_rpcb_flush __P((rpcb_session_t *));
|
||||
static int ipf_p_rpcb_decodereq __P((fr_info_t *, nat_t *,
|
||||
rpcb_session_t *, rpc_msg_t *));
|
||||
static int ipf_p_rpcb_skipauth __P((rpc_msg_t *, xdr_auth_t *, u_32_t **));
|
||||
static int ipf_p_rpcb_insert __P((rpcb_session_t *, rpcb_xact_t *));
|
||||
static int ipf_p_rpcb_xdrrpcb __P((rpc_msg_t *, u_32_t *, rpcb_args_t *));
|
||||
static int ipf_p_rpcb_getuaddr __P((rpc_msg_t *, xdr_uaddr_t *,
|
||||
u_32_t **));
|
||||
static u_int ipf_p_rpcb_atoi __P((char *));
|
||||
static int ipf_p_rpcb_modreq __P((fr_info_t *, nat_t *, rpc_msg_t *,
|
||||
mb_t *, u_int));
|
||||
static int ipf_p_rpcb_decoderep __P((fr_info_t *, nat_t *,
|
||||
rpcb_session_t *, rpc_msg_t *, rpcb_xact_t **));
|
||||
static rpcb_xact_t * ipf_p_rpcb_lookup __P((rpcb_session_t *, u_32_t));
|
||||
static void ipf_p_rpcb_deref __P((rpcb_session_t *, rpcb_xact_t *));
|
||||
static int ipf_p_rpcb_getproto __P((rpc_msg_t *, xdr_proto_t *,
|
||||
u_32_t **));
|
||||
static int ipf_p_rpcb_getnat __P((fr_info_t *, nat_t *, u_int, u_int));
|
||||
static int ipf_p_rpcb_modv3 __P((fr_info_t *, nat_t *, rpc_msg_t *,
|
||||
mb_t *, u_int));
|
||||
static int ipf_p_rpcb_modv4 __P((fr_info_t *, nat_t *, rpc_msg_t *,
|
||||
mb_t *, u_int));
|
||||
static void ipf_p_rpcb_fixlen __P((fr_info_t *, int));
|
||||
static void ipf_p_rpcb_flush(rpcb_session_t *);
|
||||
static int ipf_p_rpcb_decodereq(fr_info_t *, nat_t *,
|
||||
rpcb_session_t *, rpc_msg_t *);
|
||||
static int ipf_p_rpcb_skipauth(rpc_msg_t *, xdr_auth_t *, u_32_t **);
|
||||
static int ipf_p_rpcb_insert(rpcb_session_t *, rpcb_xact_t *);
|
||||
static int ipf_p_rpcb_xdrrpcb(rpc_msg_t *, u_32_t *, rpcb_args_t *);
|
||||
static int ipf_p_rpcb_getuaddr(rpc_msg_t *, xdr_uaddr_t *,
|
||||
u_32_t **);
|
||||
static u_int ipf_p_rpcb_atoi(char *);
|
||||
static int ipf_p_rpcb_modreq(fr_info_t *, nat_t *, rpc_msg_t *,
|
||||
mb_t *, u_int);
|
||||
static int ipf_p_rpcb_decoderep(fr_info_t *, nat_t *,
|
||||
rpcb_session_t *, rpc_msg_t *, rpcb_xact_t **);
|
||||
static rpcb_xact_t * ipf_p_rpcb_lookup(rpcb_session_t *, u_32_t);
|
||||
static void ipf_p_rpcb_deref(rpcb_session_t *, rpcb_xact_t *);
|
||||
static int ipf_p_rpcb_getproto(rpc_msg_t *, xdr_proto_t *,
|
||||
u_32_t **);
|
||||
static int ipf_p_rpcb_getnat(fr_info_t *, nat_t *, u_int, u_int);
|
||||
static int ipf_p_rpcb_modv3(fr_info_t *, nat_t *, rpc_msg_t *,
|
||||
mb_t *, u_int);
|
||||
static int ipf_p_rpcb_modv4(fr_info_t *, nat_t *, rpc_msg_t *,
|
||||
mb_t *, u_int);
|
||||
static void ipf_p_rpcb_fixlen(fr_info_t *, int);
|
||||
|
||||
/*
|
||||
* Global variables
|
||||
|
@ -1,16 +1,16 @@
|
||||
/* $FreeBSD$ */
|
||||
|
||||
extern int ipfrule_add __P((void));
|
||||
extern int ipfrule_remove __P((void));
|
||||
extern int ipfrule_add(void);
|
||||
extern int ipfrule_remove(void);
|
||||
|
||||
extern frentry_t *ipfrule_match_out_ __P((fr_info_t *, u_32_t *));
|
||||
extern frentry_t *ipfrule_match_out_(fr_info_t *, u_32_t *);
|
||||
extern frentry_t *ipf_rules_out_[1];
|
||||
|
||||
extern int ipfrule_add_out_ __P((void));
|
||||
extern int ipfrule_remove_out_ __P((void));
|
||||
extern int ipfrule_add_out_(void);
|
||||
extern int ipfrule_remove_out_(void);
|
||||
|
||||
extern frentry_t *ipfrule_match_in_ __P((fr_info_t *, u_32_t *));
|
||||
extern frentry_t *ipfrule_match_in_(fr_info_t *, u_32_t *);
|
||||
extern frentry_t *ipf_rules_in_[1];
|
||||
|
||||
extern int ipfrule_add_in_ __P((void));
|
||||
extern int ipfrule_remove_in_ __P((void));
|
||||
extern int ipfrule_add_in_(void);
|
||||
extern int ipfrule_remove_in_(void);
|
||||
|
@ -69,12 +69,12 @@ ipfrwlock_t ipf_scan_rwlock;
|
||||
# endif
|
||||
|
||||
|
||||
int ipf_scan_add __P((caddr_t));
|
||||
int ipf_scan_remove __P((caddr_t));
|
||||
struct ipscan *ipf_scan_lookup __P((char *));
|
||||
int ipf_scan_matchstr __P((sinfo_t *, char *, int));
|
||||
int ipf_scan_matchisc __P((ipscan_t *, ipstate_t *, int, int, int *));
|
||||
int ipf_scan_match __P((ipstate_t *));
|
||||
int ipf_scan_add(caddr_t);
|
||||
int ipf_scan_remove(caddr_t);
|
||||
struct ipscan *ipf_scan_lookup(char *);
|
||||
int ipf_scan_matchstr(sinfo_t *, char *, int);
|
||||
int ipf_scan_matchisc(ipscan_t *, ipstate_t *, int, int, int *);
|
||||
int ipf_scan_match(ipstate_t *);
|
||||
|
||||
static int ipf_scan_inited = 0;
|
||||
|
||||
|
@ -88,13 +88,13 @@ typedef struct ipscanstat {
|
||||
} ipscanstat_t;
|
||||
|
||||
|
||||
extern int ipf_scan_ioctl __P((ipf_main_softc_t *, caddr_t, ioctlcmd_t, int, int, void *));
|
||||
extern int ipf_scan_init __P((void));
|
||||
extern int ipf_scan_attachis __P((struct ipstate *));
|
||||
extern int ipf_scan_attachfr __P((struct frentry *));
|
||||
extern int ipf_scan_detachis __P((struct ipstate *));
|
||||
extern int ipf_scan_detachfr __P((struct frentry *));
|
||||
extern int ipf_scan_packet __P((struct fr_info *, struct ipstate *));
|
||||
extern void ipf_scan_unload __P((ipf_main_softc_t *));
|
||||
extern int ipf_scan_ioctl(ipf_main_softc_t *, caddr_t, ioctlcmd_t, int, int, void *);
|
||||
extern int ipf_scan_init(void);
|
||||
extern int ipf_scan_attachis(struct ipstate *);
|
||||
extern int ipf_scan_attachfr(struct frentry *);
|
||||
extern int ipf_scan_detachis(struct ipstate *);
|
||||
extern int ipf_scan_detachfr(struct frentry *);
|
||||
extern int ipf_scan_packet(struct fr_info *, struct ipstate *);
|
||||
extern void ipf_scan_unload(ipf_main_softc_t *);
|
||||
|
||||
#endif /* __IP_SCAN_H__ */
|
||||
|
@ -143,43 +143,43 @@ static ipftuneable_t ipf_state_tuneables[] = {
|
||||
#define SBUMPDX(x, y, z)do { (softs->x.y)++; DT(z); } while (0)
|
||||
|
||||
#ifdef USE_INET6
|
||||
static ipstate_t *ipf_checkicmp6matchingstate __P((fr_info_t *));
|
||||
static ipstate_t *ipf_checkicmp6matchingstate(fr_info_t *);
|
||||
#endif
|
||||
static int ipf_allowstateicmp __P((fr_info_t *, ipstate_t *, i6addr_t *));
|
||||
static ipstate_t *ipf_matchsrcdst __P((fr_info_t *, ipstate_t *, i6addr_t *,
|
||||
i6addr_t *, tcphdr_t *, u_32_t));
|
||||
static ipstate_t *ipf_checkicmpmatchingstate __P((fr_info_t *));
|
||||
static int ipf_state_flush_entry __P((ipf_main_softc_t *, void *));
|
||||
static ips_stat_t *ipf_state_stats __P((ipf_main_softc_t *));
|
||||
static int ipf_state_del __P((ipf_main_softc_t *, ipstate_t *, int));
|
||||
static int ipf_state_remove __P((ipf_main_softc_t *, caddr_t));
|
||||
static int ipf_state_match __P((ipstate_t *is1, ipstate_t *is2));
|
||||
static int ipf_state_matchaddresses __P((ipstate_t *is1, ipstate_t *is2));
|
||||
static int ipf_state_matchipv4addrs __P((ipstate_t *is1, ipstate_t *is2));
|
||||
static int ipf_state_matchipv6addrs __P((ipstate_t *is1, ipstate_t *is2));
|
||||
static int ipf_state_matchisps __P((ipstate_t *is1, ipstate_t *is2));
|
||||
static int ipf_state_matchports __P((udpinfo_t *is1, udpinfo_t *is2));
|
||||
static int ipf_state_matcharray __P((ipstate_t *, int *, u_long));
|
||||
static void ipf_ipsmove __P((ipf_state_softc_t *, ipstate_t *, u_int));
|
||||
static int ipf_state_tcp __P((ipf_main_softc_t *, ipf_state_softc_t *,
|
||||
fr_info_t *, tcphdr_t *, ipstate_t *));
|
||||
static int ipf_tcpoptions __P((ipf_state_softc_t *, fr_info_t *,
|
||||
tcphdr_t *, tcpdata_t *));
|
||||
static ipstate_t *ipf_state_clone __P((fr_info_t *, tcphdr_t *, ipstate_t *));
|
||||
static void ipf_fixinisn __P((fr_info_t *, ipstate_t *));
|
||||
static void ipf_fixoutisn __P((fr_info_t *, ipstate_t *));
|
||||
static void ipf_checknewisn __P((fr_info_t *, ipstate_t *));
|
||||
static int ipf_state_iter __P((ipf_main_softc_t *, ipftoken_t *,
|
||||
ipfgeniter_t *, ipfobj_t *));
|
||||
static int ipf_state_gettable __P((ipf_main_softc_t *, ipf_state_softc_t *,
|
||||
char *));
|
||||
static int ipf_state_tcpinwindow __P((struct fr_info *, struct tcpdata *,
|
||||
struct tcpdata *, tcphdr_t *, int));
|
||||
static int ipf_allowstateicmp(fr_info_t *, ipstate_t *, i6addr_t *);
|
||||
static ipstate_t *ipf_matchsrcdst(fr_info_t *, ipstate_t *, i6addr_t *,
|
||||
i6addr_t *, tcphdr_t *, u_32_t);
|
||||
static ipstate_t *ipf_checkicmpmatchingstate(fr_info_t *);
|
||||
static int ipf_state_flush_entry(ipf_main_softc_t *, void *);
|
||||
static ips_stat_t *ipf_state_stats(ipf_main_softc_t *);
|
||||
static int ipf_state_del(ipf_main_softc_t *, ipstate_t *, int);
|
||||
static int ipf_state_remove(ipf_main_softc_t *, caddr_t);
|
||||
static int ipf_state_match(ipstate_t *is1, ipstate_t *is2);
|
||||
static int ipf_state_matchaddresses(ipstate_t *is1, ipstate_t *is2);
|
||||
static int ipf_state_matchipv4addrs(ipstate_t *is1, ipstate_t *is2);
|
||||
static int ipf_state_matchipv6addrs(ipstate_t *is1, ipstate_t *is2);
|
||||
static int ipf_state_matchisps(ipstate_t *is1, ipstate_t *is2);
|
||||
static int ipf_state_matchports(udpinfo_t *is1, udpinfo_t *is2);
|
||||
static int ipf_state_matcharray(ipstate_t *, int *, u_long);
|
||||
static void ipf_ipsmove(ipf_state_softc_t *, ipstate_t *, u_int);
|
||||
static int ipf_state_tcp(ipf_main_softc_t *, ipf_state_softc_t *,
|
||||
fr_info_t *, tcphdr_t *, ipstate_t *);
|
||||
static int ipf_tcpoptions(ipf_state_softc_t *, fr_info_t *,
|
||||
tcphdr_t *, tcpdata_t *);
|
||||
static ipstate_t *ipf_state_clone(fr_info_t *, tcphdr_t *, ipstate_t *);
|
||||
static void ipf_fixinisn(fr_info_t *, ipstate_t *);
|
||||
static void ipf_fixoutisn(fr_info_t *, ipstate_t *);
|
||||
static void ipf_checknewisn(fr_info_t *, ipstate_t *);
|
||||
static int ipf_state_iter(ipf_main_softc_t *, ipftoken_t *,
|
||||
ipfgeniter_t *, ipfobj_t *);
|
||||
static int ipf_state_gettable(ipf_main_softc_t *, ipf_state_softc_t *,
|
||||
char *);
|
||||
static int ipf_state_tcpinwindow(struct fr_info *, struct tcpdata *,
|
||||
struct tcpdata *, tcphdr_t *, int);
|
||||
|
||||
static int ipf_state_getent __P((ipf_main_softc_t *, ipf_state_softc_t *,
|
||||
caddr_t));
|
||||
static int ipf_state_putent __P((ipf_main_softc_t *, ipf_state_softc_t *,
|
||||
caddr_t));
|
||||
static int ipf_state_getent(ipf_main_softc_t *, ipf_state_softc_t *,
|
||||
caddr_t);
|
||||
static int ipf_state_putent(ipf_main_softc_t *, ipf_state_softc_t *,
|
||||
caddr_t);
|
||||
|
||||
#define ONE_DAY IPF_TTLVAL(1 * 86400) /* 1 day */
|
||||
#define FIVE_DAYS (5 * ONE_DAY)
|
||||
|
@ -293,41 +293,41 @@ typedef struct ipf_state_softc_s {
|
||||
|
||||
|
||||
#ifndef _KERNEL
|
||||
extern void ipf_state_dump __P((ipf_main_softc_t *, void *));
|
||||
extern void ipf_state_dump(ipf_main_softc_t *, void *);
|
||||
#endif
|
||||
extern int ipf_tcp_age __P((struct ipftqent *, struct fr_info *,
|
||||
struct ipftq *, int, int));
|
||||
extern int ipf_tcpinwindow __P((struct fr_info *, struct tcpdata *,
|
||||
struct tcpdata *, tcphdr_t *, int));
|
||||
extern int ipf_tcp_age(struct ipftqent *, struct fr_info *,
|
||||
struct ipftq *, int, int);
|
||||
extern int ipf_tcpinwindow(struct fr_info *, struct tcpdata *,
|
||||
struct tcpdata *, tcphdr_t *, int);
|
||||
|
||||
extern int ipf_state_add __P((ipf_main_softc_t *, fr_info_t *,
|
||||
ipstate_t **, u_int));
|
||||
extern frentry_t *ipf_state_check __P((struct fr_info *, u_32_t *));
|
||||
extern void ipf_state_deref __P((ipf_main_softc_t *, ipstate_t **));
|
||||
extern void ipf_state_expire __P((ipf_main_softc_t *));
|
||||
extern int ipf_state_flush __P((ipf_main_softc_t *, int, int));
|
||||
extern ipstate_t *ipf_state_lookup __P((fr_info_t *, tcphdr_t *, ipftq_t **));
|
||||
extern int ipf_state_init __P((void));
|
||||
extern int ipf_state_insert __P((ipf_main_softc_t *, struct ipstate *, int));
|
||||
extern int ipf_state_ioctl __P((ipf_main_softc_t *, caddr_t, ioctlcmd_t, int, int, void *));
|
||||
extern void ipf_state_log __P((ipf_main_softc_t *, struct ipstate *, u_int));
|
||||
extern int ipf_state_matchflush __P((ipf_main_softc_t *, caddr_t));
|
||||
extern int ipf_state_rehash __P((ipf_main_softc_t *, ipftuneable_t *, ipftuneval_t *));
|
||||
extern void ipf_state_setqueue __P((ipf_main_softc_t *, ipstate_t *, int));
|
||||
extern void ipf_state_setpending __P((ipf_main_softc_t *, ipstate_t *));
|
||||
extern int ipf_state_settimeout __P((struct ipf_main_softc_s *, ipftuneable_t *, ipftuneval_t *));
|
||||
extern void ipf_state_sync __P((ipf_main_softc_t *, void *));
|
||||
extern void ipf_state_update __P((fr_info_t *, ipstate_t *));
|
||||
extern int ipf_state_add(ipf_main_softc_t *, fr_info_t *,
|
||||
ipstate_t **, u_int);
|
||||
extern frentry_t *ipf_state_check(struct fr_info *, u_32_t *);
|
||||
extern void ipf_state_deref(ipf_main_softc_t *, ipstate_t **);
|
||||
extern void ipf_state_expire(ipf_main_softc_t *);
|
||||
extern int ipf_state_flush(ipf_main_softc_t *, int, int);
|
||||
extern ipstate_t *ipf_state_lookup(fr_info_t *, tcphdr_t *, ipftq_t **);
|
||||
extern int ipf_state_init(void);
|
||||
extern int ipf_state_insert(ipf_main_softc_t *, struct ipstate *, int);
|
||||
extern int ipf_state_ioctl(ipf_main_softc_t *, caddr_t, ioctlcmd_t, int, int, void *);
|
||||
extern void ipf_state_log(ipf_main_softc_t *, struct ipstate *, u_int);
|
||||
extern int ipf_state_matchflush(ipf_main_softc_t *, caddr_t);
|
||||
extern int ipf_state_rehash(ipf_main_softc_t *, ipftuneable_t *, ipftuneval_t *);
|
||||
extern void ipf_state_setqueue(ipf_main_softc_t *, ipstate_t *, int);
|
||||
extern void ipf_state_setpending(ipf_main_softc_t *, ipstate_t *);
|
||||
extern int ipf_state_settimeout(struct ipf_main_softc_s *, ipftuneable_t *, ipftuneval_t *);
|
||||
extern void ipf_state_sync(ipf_main_softc_t *, void *);
|
||||
extern void ipf_state_update(fr_info_t *, ipstate_t *);
|
||||
|
||||
extern void ipf_sttab_init __P((ipf_main_softc_t *, struct ipftq *));
|
||||
extern void ipf_sttab_destroy __P((struct ipftq *));
|
||||
extern void ipf_state_setlock __P((void *, int));
|
||||
extern int ipf_state_main_load __P((void));
|
||||
extern int ipf_state_main_unload __P((void));
|
||||
extern void *ipf_state_soft_create __P((ipf_main_softc_t *));
|
||||
extern void ipf_state_soft_destroy __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_state_soft_init __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_state_soft_fini __P((ipf_main_softc_t *, void *));
|
||||
extern ipftq_t *ipf_state_add_tq __P((ipf_main_softc_t *, int));
|
||||
extern void ipf_sttab_init(ipf_main_softc_t *, struct ipftq *);
|
||||
extern void ipf_sttab_destroy(struct ipftq *);
|
||||
extern void ipf_state_setlock(void *, int);
|
||||
extern int ipf_state_main_load(void);
|
||||
extern int ipf_state_main_unload(void);
|
||||
extern void *ipf_state_soft_create(ipf_main_softc_t *);
|
||||
extern void ipf_state_soft_destroy(ipf_main_softc_t *, void *);
|
||||
extern int ipf_state_soft_init(ipf_main_softc_t *, void *);
|
||||
extern int ipf_state_soft_fini(ipf_main_softc_t *, void *);
|
||||
extern ipftq_t *ipf_state_add_tq(ipf_main_softc_t *, int);
|
||||
|
||||
#endif /* __IP_STATE_H__ */
|
||||
|
@ -125,17 +125,17 @@ typedef struct ipf_sync_softc_s {
|
||||
int ipf_sync_inited;
|
||||
} ipf_sync_softc_t;
|
||||
|
||||
static int ipf_sync_flush_table __P((ipf_sync_softc_t *, int, synclist_t **));
|
||||
static void ipf_sync_wakeup __P((ipf_main_softc_t *));
|
||||
static void ipf_sync_del __P((ipf_sync_softc_t *, synclist_t *));
|
||||
static void ipf_sync_poll_wakeup __P((ipf_main_softc_t *));
|
||||
static int ipf_sync_nat __P((ipf_main_softc_t *, synchdr_t *, void *));
|
||||
static int ipf_sync_state __P((ipf_main_softc_t *, synchdr_t *, void *));
|
||||
static int ipf_sync_flush_table(ipf_sync_softc_t *, int, synclist_t **);
|
||||
static void ipf_sync_wakeup(ipf_main_softc_t *);
|
||||
static void ipf_sync_del(ipf_sync_softc_t *, synclist_t *);
|
||||
static void ipf_sync_poll_wakeup(ipf_main_softc_t *);
|
||||
static int ipf_sync_nat(ipf_main_softc_t *, synchdr_t *, void *);
|
||||
static int ipf_sync_state(ipf_main_softc_t *, synchdr_t *, void *);
|
||||
|
||||
# if !defined(sparc) && !defined(__hppa)
|
||||
void ipf_sync_tcporder __P((int, struct tcpdata *));
|
||||
void ipf_sync_natorder __P((int, struct nat *));
|
||||
void ipf_sync_storder __P((int, struct ipstate *));
|
||||
void ipf_sync_tcporder(int, struct tcpdata *);
|
||||
void ipf_sync_natorder(int, struct nat *);
|
||||
void ipf_sync_storder(int, struct ipstate *);
|
||||
# endif
|
||||
|
||||
|
||||
|
@ -100,22 +100,22 @@ typedef struct syncupdent { /* 28 or 32 bytes */
|
||||
struct synctcp_update sup_tcp;
|
||||
} syncupdent_t;
|
||||
|
||||
extern void *ipf_sync_create __P((ipf_main_softc_t *));
|
||||
extern int ipf_sync_soft_init __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_sync_soft_fini __P((ipf_main_softc_t *, void *));
|
||||
extern int ipf_sync_canread __P((void *));
|
||||
extern int ipf_sync_canwrite __P((void *));
|
||||
extern void ipf_sync_del_nat __P((void *, synclist_t *));
|
||||
extern void ipf_sync_del_state __P((void *, synclist_t *));
|
||||
extern int ipf_sync_init __P((void));
|
||||
extern int ipf_sync_ioctl __P((ipf_main_softc_t *, caddr_t, ioctlcmd_t, int, int, void *));
|
||||
extern synclist_t *ipf_sync_new __P((ipf_main_softc_t *, int, fr_info_t *, void *));
|
||||
extern int ipf_sync_read __P((ipf_main_softc_t *, struct uio *uio));
|
||||
extern int ipf_sync_write __P((ipf_main_softc_t *, struct uio *uio));
|
||||
extern int ipf_sync_main_unload __P((void));
|
||||
extern void ipf_sync_update __P((ipf_main_softc_t *, int, fr_info_t *, synclist_t *));
|
||||
extern void ipf_sync_expire __P((ipf_main_softc_t *));
|
||||
extern void ipf_sync_soft_destroy __P((ipf_main_softc_t *, void *));
|
||||
extern void *ipf_sync_soft_create __P((ipf_main_softc_t *));
|
||||
extern void *ipf_sync_create(ipf_main_softc_t *);
|
||||
extern int ipf_sync_soft_init(ipf_main_softc_t *, void *);
|
||||
extern int ipf_sync_soft_fini(ipf_main_softc_t *, void *);
|
||||
extern int ipf_sync_canread(void *);
|
||||
extern int ipf_sync_canwrite(void *);
|
||||
extern void ipf_sync_del_nat(void *, synclist_t *);
|
||||
extern void ipf_sync_del_state(void *, synclist_t *);
|
||||
extern int ipf_sync_init(void);
|
||||
extern int ipf_sync_ioctl(ipf_main_softc_t *, caddr_t, ioctlcmd_t, int, int, void *);
|
||||
extern synclist_t *ipf_sync_new(ipf_main_softc_t *, int, fr_info_t *, void *);
|
||||
extern int ipf_sync_read(ipf_main_softc_t *, struct uio *uio);
|
||||
extern int ipf_sync_write(ipf_main_softc_t *, struct uio *uio);
|
||||
extern int ipf_sync_main_unload(void);
|
||||
extern void ipf_sync_update(ipf_main_softc_t *, int, fr_info_t *, synclist_t *);
|
||||
extern void ipf_sync_expire(ipf_main_softc_t *);
|
||||
extern void ipf_sync_soft_destroy(ipf_main_softc_t *, void *);
|
||||
extern void *ipf_sync_soft_create(ipf_main_softc_t *);
|
||||
|
||||
#endif /* __IP_SYNC_H__ */
|
||||
|
@ -13,19 +13,19 @@ typedef struct ipf_tftp_softc_s {
|
||||
ipftuneable_t *ipf_p_tftp_tune;
|
||||
} ipf_tftp_softc_t;
|
||||
|
||||
int ipf_p_tftp_backchannel __P((fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ipf_p_tftp_client __P((ipf_tftp_softc_t *, fr_info_t *, ap_session_t *,
|
||||
nat_t *));
|
||||
int ipf_p_tftp_in __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
void ipf_p_tftp_main_load __P((void));
|
||||
void ipf_p_tftp_main_unload __P((void));
|
||||
int ipf_p_tftp_new __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
void ipf_p_tftp_del __P((ipf_main_softc_t *, ap_session_t *));
|
||||
int ipf_p_tftp_out __P((void *, fr_info_t *, ap_session_t *, nat_t *));
|
||||
int ipf_p_tftp_server __P((ipf_tftp_softc_t *, fr_info_t *, ap_session_t *,
|
||||
nat_t *));
|
||||
void *ipf_p_tftp_soft_create __P((ipf_main_softc_t *));
|
||||
void ipf_p_tftp_soft_destroy __P((ipf_main_softc_t *, void *));
|
||||
int ipf_p_tftp_backchannel(fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ipf_p_tftp_client(ipf_tftp_softc_t *, fr_info_t *, ap_session_t *,
|
||||
nat_t *);
|
||||
int ipf_p_tftp_in(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
void ipf_p_tftp_main_load(void);
|
||||
void ipf_p_tftp_main_unload(void);
|
||||
int ipf_p_tftp_new(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
void ipf_p_tftp_del(ipf_main_softc_t *, ap_session_t *);
|
||||
int ipf_p_tftp_out(void *, fr_info_t *, ap_session_t *, nat_t *);
|
||||
int ipf_p_tftp_server(ipf_tftp_softc_t *, fr_info_t *, ap_session_t *,
|
||||
nat_t *);
|
||||
void *ipf_p_tftp_soft_create(ipf_main_softc_t *);
|
||||
void ipf_p_tftp_soft_destroy(ipf_main_softc_t *, void *);
|
||||
|
||||
static frentry_t tftpfr;
|
||||
static int tftp_proxy_init = 0;
|
||||
|
@ -69,15 +69,15 @@ static int ipf_fbsd_sysctl_create(void);
|
||||
static int ipf_fbsd_sysctl_destroy(void);
|
||||
|
||||
#ifdef __FreeBSD_version
|
||||
static int ipfopen __P((struct cdev*, int, int, struct thread *));
|
||||
static int ipfclose __P((struct cdev*, int, int, struct thread *));
|
||||
static int ipfread __P((struct cdev*, struct uio *, int));
|
||||
static int ipfwrite __P((struct cdev*, struct uio *, int));
|
||||
static int ipfopen(struct cdev*, int, int, struct thread *);
|
||||
static int ipfclose(struct cdev*, int, int, struct thread *);
|
||||
static int ipfread(struct cdev*, struct uio *, int);
|
||||
static int ipfwrite(struct cdev*, struct uio *, int);
|
||||
#else
|
||||
static int ipfopen __P((dev_t, int, int, struct proc *));
|
||||
static int ipfclose __P((dev_t, int, int, struct proc *));
|
||||
static int ipfread __P((dev_t, struct uio *, int));
|
||||
static int ipfwrite __P((dev_t, struct uio *, int));
|
||||
static int ipfopen(dev_t, int, int, struct proc *);
|
||||
static int ipfclose(dev_t, int, int, struct proc *);
|
||||
static int ipfread(dev_t, struct uio *, int);
|
||||
static int ipfwrite(dev_t, struct uio *, int);
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -29,16 +29,16 @@
|
||||
#define ADF_OFF offsetof(addrfamily_t, adf_addr)
|
||||
#define ADF_OFF_BITS (ADF_OFF << 3)
|
||||
|
||||
static ipf_rdx_node_t *ipf_rx_insert __P((ipf_rdx_head_t *,
|
||||
ipf_rdx_node_t nodes[2], int *));
|
||||
static void ipf_rx_attach_mask __P((ipf_rdx_node_t *, ipf_rdx_mask_t *));
|
||||
static int count_mask_bits __P((addrfamily_t *, u_32_t **));
|
||||
static void buildnodes __P((addrfamily_t *, addrfamily_t *,
|
||||
ipf_rdx_node_t n[2]));
|
||||
static ipf_rdx_node_t *ipf_rx_find_addr __P((ipf_rdx_node_t *, u_32_t *));
|
||||
static ipf_rdx_node_t *ipf_rx_lookup __P((ipf_rdx_head_t *, addrfamily_t *,
|
||||
addrfamily_t *));
|
||||
static ipf_rdx_node_t *ipf_rx_match __P((ipf_rdx_head_t *, addrfamily_t *));
|
||||
static ipf_rdx_node_t *ipf_rx_insert(ipf_rdx_head_t *,
|
||||
ipf_rdx_node_t nodes[2], int *);
|
||||
static void ipf_rx_attach_mask(ipf_rdx_node_t *, ipf_rdx_mask_t *);
|
||||
static int count_mask_bits(addrfamily_t *, u_32_t **);
|
||||
static void buildnodes(addrfamily_t *, addrfamily_t *,
|
||||
ipf_rdx_node_t n[2]);
|
||||
static ipf_rdx_node_t *ipf_rx_find_addr(ipf_rdx_node_t *, u_32_t *);
|
||||
static ipf_rdx_node_t *ipf_rx_lookup(ipf_rdx_head_t *, addrfamily_t *,
|
||||
addrfamily_t *);
|
||||
static ipf_rdx_node_t *ipf_rx_match(ipf_rdx_head_t *, addrfamily_t *);
|
||||
|
||||
/*
|
||||
* Foreword.
|
||||
|
@ -79,17 +79,17 @@ typedef struct radix_softc {
|
||||
# define RADIX_NODE_HEAD_UNLOCK(x)
|
||||
#endif
|
||||
|
||||
extern void *ipf_rx_create __P((void));
|
||||
extern int ipf_rx_init __P((void *));
|
||||
extern void ipf_rx_destroy __P((void *));
|
||||
extern int ipf_rx_inithead __P((radix_softc_t *, ipf_rdx_head_t **));
|
||||
extern void ipf_rx_freehead __P((ipf_rdx_head_t *));
|
||||
extern ipf_rdx_node_t *ipf_rx_addroute __P((ipf_rdx_head_t *,
|
||||
extern void *ipf_rx_create(void);
|
||||
extern int ipf_rx_init(void *);
|
||||
extern void ipf_rx_destroy(void *);
|
||||
extern int ipf_rx_inithead(radix_softc_t *, ipf_rdx_head_t **);
|
||||
extern void ipf_rx_freehead(ipf_rdx_head_t *);
|
||||
extern ipf_rdx_node_t *ipf_rx_addroute(ipf_rdx_head_t *,
|
||||
addrfamily_t *, addrfamily_t *,
|
||||
ipf_rdx_node_t *));
|
||||
extern ipf_rdx_node_t *ipf_rx_delete __P((ipf_rdx_head_t *, addrfamily_t *,
|
||||
addrfamily_t *));
|
||||
extern void ipf_rx_walktree __P((ipf_rdx_head_t *, radix_walk_func_t,
|
||||
void *));
|
||||
ipf_rdx_node_t *);
|
||||
extern ipf_rdx_node_t *ipf_rx_delete(ipf_rdx_head_t *, addrfamily_t *,
|
||||
addrfamily_t *);
|
||||
extern void ipf_rx_walktree(ipf_rdx_head_t *, radix_walk_func_t,
|
||||
void *);
|
||||
|
||||
#endif /* __RADIX_IPF_H__ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user