Deleted Added
full compact
ip_fw_private.h (200580) ip_fw_private.h (200590)
1/*-
2 * Copyright (c) 2002-2009 Luigi Rizzo, Universita` di Pisa
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 8 unchanged lines hidden (view full) ---

17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 *
1/*-
2 * Copyright (c) 2002-2009 Luigi Rizzo, Universita` di Pisa
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 8 unchanged lines hidden (view full) ---

17 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 *
25 * $FreeBSD: head/sys/netinet/ipfw/ip_fw_private.h 200580 2009-12-15 16:15:14Z luigi $
25 * $FreeBSD: head/sys/netinet/ipfw/ip_fw_private.h 200590 2009-12-15 21:24:12Z luigi $
26 */
27
28#ifndef _IPFW2_PRIVATE_H
29#define _IPFW2_PRIVATE_H
30
31/*
32 * Internal constants and data structures used by ipfw components
33 * and not meant to be exported outside the kernel.

--- 63 unchanged lines hidden (view full) ---

97 * Function definitions.
98 */
99
100/* Firewall hooks */
101
102int ipfw_check_in(void *, struct mbuf **, struct ifnet *, int, struct inpcb *inp);
103int ipfw_check_out(void *, struct mbuf **, struct ifnet *, int, struct inpcb *inp);
104
26 */
27
28#ifndef _IPFW2_PRIVATE_H
29#define _IPFW2_PRIVATE_H
30
31/*
32 * Internal constants and data structures used by ipfw components
33 * and not meant to be exported outside the kernel.

--- 63 unchanged lines hidden (view full) ---

97 * Function definitions.
98 */
99
100/* Firewall hooks */
101
102int ipfw_check_in(void *, struct mbuf **, struct ifnet *, int, struct inpcb *inp);
103int ipfw_check_out(void *, struct mbuf **, struct ifnet *, int, struct inpcb *inp);
104
105int ipfw_chk(struct ip_fw_args *);
106
107int ipfw_hook(void);
108int ipfw6_hook(void);
109int ipfw_unhook(void);
110int ipfw6_unhook(void);
111#ifdef NOTYET
112void ipfw_nat_destroy(void);
113#endif

--- 42 unchanged lines hidden (view full) ---

156void ipfw_dyn_uninit(int); /* per-vnet deinitialization */
157int ipfw_dyn_len(void);
158
159/* common variables */
160VNET_DECLARE(int, fw_one_pass);
161VNET_DECLARE(int, fw_enable);
162VNET_DECLARE(int, fw_verbose);
163VNET_DECLARE(struct ip_fw_chain, layer3_chain);
105
106int ipfw_hook(void);
107int ipfw6_hook(void);
108int ipfw_unhook(void);
109int ipfw6_unhook(void);
110#ifdef NOTYET
111void ipfw_nat_destroy(void);
112#endif

--- 42 unchanged lines hidden (view full) ---

155void ipfw_dyn_uninit(int); /* per-vnet deinitialization */
156int ipfw_dyn_len(void);
157
158/* common variables */
159VNET_DECLARE(int, fw_one_pass);
160VNET_DECLARE(int, fw_enable);
161VNET_DECLARE(int, fw_verbose);
162VNET_DECLARE(struct ip_fw_chain, layer3_chain);
163VNET_DECLARE(u_int32_t, set_disable);
164
165#define V_fw_one_pass VNET(fw_one_pass)
166#define V_fw_enable VNET(fw_enable)
167#define V_fw_verbose VNET(fw_enable)
168#define V_layer3_chain VNET(layer3_chain)
164
165#define V_fw_one_pass VNET(fw_one_pass)
166#define V_fw_enable VNET(fw_enable)
167#define V_fw_verbose VNET(fw_enable)
168#define V_layer3_chain VNET(layer3_chain)
169#define V_set_disable VNET(set_disable)
169
170#ifdef INET6
171VNET_DECLARE(int, fw6_enable);
172#define V_fw6_enable VNET(fw6_enable)
173#endif
174
175struct ip_fw_chain {
176 struct ip_fw *rules; /* list of rules */

--- 16 unchanged lines hidden (view full) ---

193#define IPFW_LOCK_DESTROY(_chain) rw_destroy(&(_chain)->rwmtx)
194#define IPFW_WLOCK_ASSERT(_chain) rw_assert(&(_chain)->rwmtx, RA_WLOCKED)
195
196#define IPFW_RLOCK(p) rw_rlock(&(p)->rwmtx)
197#define IPFW_RUNLOCK(p) rw_runlock(&(p)->rwmtx)
198#define IPFW_WLOCK(p) rw_wlock(&(p)->rwmtx)
199#define IPFW_WUNLOCK(p) rw_wunlock(&(p)->rwmtx)
200
170
171#ifdef INET6
172VNET_DECLARE(int, fw6_enable);
173#define V_fw6_enable VNET(fw6_enable)
174#endif
175
176struct ip_fw_chain {
177 struct ip_fw *rules; /* list of rules */

--- 16 unchanged lines hidden (view full) ---

194#define IPFW_LOCK_DESTROY(_chain) rw_destroy(&(_chain)->rwmtx)
195#define IPFW_WLOCK_ASSERT(_chain) rw_assert(&(_chain)->rwmtx, RA_WLOCKED)
196
197#define IPFW_RLOCK(p) rw_rlock(&(p)->rwmtx)
198#define IPFW_RUNLOCK(p) rw_runlock(&(p)->rwmtx)
199#define IPFW_WLOCK(p) rw_wlock(&(p)->rwmtx)
200#define IPFW_WUNLOCK(p) rw_wunlock(&(p)->rwmtx)
201
202/* In ip_fw_sockopt.c */
203int ipfw_add_rule(struct ip_fw_chain *chain, struct ip_fw *input_rule);
204int ipfw_ctl(struct sockopt *sopt);
205int ipfw_chk(struct ip_fw_args *args);
206void ipfw_reap_rules(struct ip_fw *head);
207void ipfw_free_chain(struct ip_fw_chain *chain, int kill_default);
208
209/* In ip_fw_table.c */
210struct radix_node;
211int ipfw_lookup_table(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr,
212 uint32_t *val);
213int ipfw_init_tables(struct ip_fw_chain *ch);
214int ipfw_flush_table(struct ip_fw_chain *ch, uint16_t tbl);
215void ipfw_flush_tables(struct ip_fw_chain *ch);
216int ipfw_add_table_entry(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr,
217 uint8_t mlen, uint32_t value);
218int ipfw_dump_table_entry(struct radix_node *rn, void *arg);
219int ipfw_del_table_entry(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr,
220 uint8_t mlen);
221int ipfw_count_table(struct ip_fw_chain *ch, uint32_t tbl, uint32_t *cnt);
222int ipfw_dump_table(struct ip_fw_chain *ch, ipfw_table *tbl);
223
201/* In ip_fw_nat.c */
224/* In ip_fw_nat.c */
225
202extern struct cfg_nat *(*lookup_nat_ptr)(struct nat_list *, int);
203
204typedef int ipfw_nat_t(struct ip_fw_args *, struct cfg_nat *, struct mbuf *);
205typedef int ipfw_nat_cfg_t(struct sockopt *);
206
226extern struct cfg_nat *(*lookup_nat_ptr)(struct nat_list *, int);
227
228typedef int ipfw_nat_t(struct ip_fw_args *, struct cfg_nat *, struct mbuf *);
229typedef int ipfw_nat_cfg_t(struct sockopt *);
230
231extern ipfw_nat_t *ipfw_nat_ptr;
232#define IPFW_NAT_LOADED (ipfw_nat_ptr != NULL)
233
234extern ipfw_nat_cfg_t *ipfw_nat_cfg_ptr;
235extern ipfw_nat_cfg_t *ipfw_nat_del_ptr;
236extern ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr;
237extern ipfw_nat_cfg_t *ipfw_nat_get_log_ptr;
238
239
207#endif /* _KERNEL */
208#endif /* _IPFW2_PRIVATE_H */
240#endif /* _KERNEL */
241#endif /* _IPFW2_PRIVATE_H */