svn commit: r240136 - projects/pf/head/sys/contrib/pf/net
Gleb Smirnoff
glebius at FreeBSD.org
Wed Sep 5 13:51:37 UTC 2012
Author: glebius
Date: Wed Sep 5 13:51:36 2012
New Revision: 240136
URL: http://svn.freebsd.org/changeset/base/240136
Log:
A poor attempt to cleanup includes in pf.
Modified:
projects/pf/head/sys/contrib/pf/net/if_pflog.c
projects/pf/head/sys/contrib/pf/net/if_pfsync.c
projects/pf/head/sys/contrib/pf/net/pf.c
projects/pf/head/sys/contrib/pf/net/pf_if.c
projects/pf/head/sys/contrib/pf/net/pf_ioctl.c
projects/pf/head/sys/contrib/pf/net/pf_lb.c
projects/pf/head/sys/contrib/pf/net/pf_norm.c
projects/pf/head/sys/contrib/pf/net/pf_osfp.c
projects/pf/head/sys/contrib/pf/net/pf_ruleset.c
projects/pf/head/sys/contrib/pf/net/pf_table.c
projects/pf/head/sys/contrib/pf/net/pfvar.h
Modified: projects/pf/head/sys/contrib/pf/net/if_pflog.c
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/if_pflog.c Wed Sep 5 13:18:51 2012 (r240135)
+++ projects/pf/head/sys/contrib/pf/net/if_pflog.c Wed Sep 5 13:51:36 2012 (r240136)
@@ -33,37 +33,34 @@
* PURPOSE.
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_bpf.h"
#include "opt_pf.h"
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
-#include <sys/systm.h>
+#include <sys/kernel.h>
#include <sys/mbuf.h>
+#include <sys/module.h>
#include <sys/proc.h>
#include <sys/socket.h>
-#include <sys/kernel.h>
-#include <sys/limits.h>
-#include <sys/malloc.h>
-#include <sys/module.h>
#include <sys/sockio.h>
+#include <net/bpf.h>
#include <net/if.h>
#include <net/if_clone.h>
+#include <net/if_pflog.h>
#include <net/if_types.h>
-#include <net/route.h>
-#include <net/bpf.h>
+#include <net/pfvar.h>
#if defined(INET) || defined(INET6)
#include <netinet/in.h>
#endif
#ifdef INET
#include <netinet/in_var.h>
-#include <netinet/in_systm.h>
#include <netinet/ip.h>
#endif
@@ -72,9 +69,6 @@ __FBSDID("$FreeBSD$");
#include <netinet6/nd6.h>
#endif /* INET6 */
-#include <net/pfvar.h>
-#include <net/if_pflog.h>
-
#ifdef INET
#include <machine/in_cksum.h>
#endif /* INET */
Modified: projects/pf/head/sys/contrib/pf/net/if_pfsync.c
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/if_pfsync.c Wed Sep 5 13:18:51 2012 (r240135)
+++ projects/pf/head/sys/contrib/pf/net/if_pfsync.c Wed Sep 5 13:51:36 2012 (r240136)
@@ -54,62 +54,44 @@
* 1.173 - correct expire time processing
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_pf.h"
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
-#include <sys/kernel.h>
#include <sys/bus.h>
+#include <sys/endian.h>
#include <sys/interrupt.h>
-#include <sys/priv.h>
-#include <sys/proc.h>
-#include <sys/systm.h>
-#include <sys/time.h>
+#include <sys/kernel.h>
+#include <sys/lock.h>
#include <sys/mbuf.h>
-#include <sys/socket.h>
-#include <sys/endian.h>
-#include <sys/malloc.h>
#include <sys/module.h>
-#include <sys/sockio.h>
-#include <sys/taskqueue.h>
-#include <sys/lock.h>
#include <sys/mutex.h>
+#include <sys/priv.h>
#include <sys/protosw.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
#include <sys/sysctl.h>
+#include <net/bpf.h>
#include <net/if.h>
#include <net/if_clone.h>
#include <net/if_types.h>
-#include <net/route.h>
-#include <net/bpf.h>
-#include <net/netisr.h>
-#include <net/vnet.h>
+#include <net/pfvar.h>
+#include <net/if_pfsync.h>
-#include <netinet/in.h>
#include <netinet/if_ether.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_seq.h>
-
-#ifdef INET
-#include <netinet/in_systm.h>
+#include <netinet/in.h>
#include <netinet/in_var.h>
#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#endif
-
-#ifdef INET6
-#include <netinet6/nd6.h>
-#endif /* INET6 */
-
#include <netinet/ip_carp.h>
-
-#include <net/pfvar.h>
-#include <net/if_pfsync.h>
-
+#include <netinet/ip_var.h>
+#include <netinet/tcp.h>
+#include <netinet/tcp_fsm.h>
+#include <netinet/tcp_seq.h>
#define PFSYNC_MINPKT ( \
sizeof(struct ip) + \
Modified: projects/pf/head/sys/contrib/pf/net/pf.c
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/pf.c Wed Sep 5 13:18:51 2012 (r240135)
+++ projects/pf/head/sys/contrib/pf/net/pf.c Wed Sep 5 13:51:36 2012 (r240136)
@@ -35,69 +35,61 @@
*
*/
-#include "opt_inet.h"
-#include "opt_inet6.h"
-
#include <sys/cdefs.h>
+
__FBSDID("$FreeBSD$");
+#include "opt_inet.h"
+#include "opt_inet6.h"
#include "opt_bpf.h"
#include "opt_pf.h"
#include <sys/param.h>
-#include <sys/systm.h>
#include <sys/bus.h>
-#include <sys/mbuf.h>
-#include <sys/interrupt.h>
-#include <sys/filio.h>
+#include <sys/endian.h>
#include <sys/hash.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
+#include <sys/interrupt.h>
#include <sys/kernel.h>
-#include <sys/time.h>
+#include <sys/kthread.h>
+#include <sys/limits.h>
+#include <sys/mbuf.h>
+#include <sys/md5.h>
#include <sys/random.h>
+#include <sys/refcount.h>
+#include <sys/socket.h>
#include <sys/sysctl.h>
-#include <sys/endian.h>
-#include <sys/proc.h>
-#include <sys/kthread.h>
-#include <sys/lock.h>
#include <sys/taskqueue.h>
-
-#include <sys/md5.h>
+#include <sys/ucred.h>
#include <net/if.h>
#include <net/if_types.h>
-#include <net/bpf.h>
#include <net/route.h>
-#ifdef RADIX_MPATH
#include <net/radix_mpath.h>
-#endif
+#include <net/vnet.h>
-#include <netinet/in.h>
+#include <net/pfvar.h>
+#include <net/pf_mtag.h>
+#include <net/if_pflog.h>
+#include <net/if_pfsync.h>
+
+#include <netinet/in_pcb.h>
#include <netinet/in_var.h>
-#include <netinet/in_systm.h>
#include <netinet/ip.h>
+#include <netinet/ip_fw.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/icmp_var.h>
#include <netinet/ip_var.h>
+#include <netinet/ipfw/ip_fw_private.h> /* XXX: only for DIR_IN/DIR_OUT */
#include <netinet/tcp.h>
+#include <netinet/tcp_fsm.h>
#include <netinet/tcp_seq.h>
-#include <netinet/udp.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/in_pcb.h>
#include <netinet/tcp_timer.h>
#include <netinet/tcp_var.h>
+#include <netinet/udp.h>
#include <netinet/udp_var.h>
-#include <netinet/icmp_var.h>
-#include <netinet/if_ether.h>
-#include <netinet/ip_fw.h>
-#include <netinet/ipfw/ip_fw_private.h> /* XXX: only for DIR_IN/DIR_OUT */
-
-#include <net/pfvar.h>
-#include <net/if_pflog.h>
-#include <net/if_pfsync.h>
#ifdef INET6
#include <netinet/ip6.h>
-#include <netinet/in_pcb.h>
#include <netinet/icmp6.h>
#include <netinet6/nd6.h>
#include <netinet6/ip6_var.h>
@@ -105,8 +97,6 @@ __FBSDID("$FreeBSD$");
#endif /* INET6 */
#include <machine/in_cksum.h>
-#include <sys/limits.h>
-#include <sys/ucred.h>
#include <security/mac/mac_framework.h>
#define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x
Modified: projects/pf/head/sys/contrib/pf/net/pf_if.c
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/pf_if.c Wed Sep 5 13:18:51 2012 (r240135)
+++ projects/pf/head/sys/contrib/pf/net/pf_if.c Wed Sep 5 13:51:36 2012 (r240136)
@@ -32,37 +32,20 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#include "opt_inet.h"
-#include "opt_inet6.h"
-
#include <sys/cdefs.h>
+
__FBSDID("$FreeBSD$");
+#include "opt_inet.h"
+#include "opt_inet6.h"
+
#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
-#include <sys/filio.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
#include <sys/kernel.h>
-#include <sys/time.h>
+#include <sys/socket.h>
#include <net/if.h>
-#include <net/if_types.h>
-#include <net/vnet.h>
-
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-
#include <net/pfvar.h>
-
-#ifdef INET6
-#include <netinet/ip6.h>
-#endif /* INET6 */
+#include <net/route.h>
VNET_DEFINE(struct pfi_kif *, pfi_all);
static VNET_DEFINE(long, pfi_update);
Modified: projects/pf/head/sys/contrib/pf/net/pf_ioctl.c
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/pf_ioctl.c Wed Sep 5 13:18:51 2012 (r240135)
+++ projects/pf/head/sys/contrib/pf/net/pf_ioctl.c Wed Sep 5 13:51:36 2012 (r240136)
@@ -44,60 +44,42 @@ __FBSDID("$FreeBSD$");
#include "opt_pf.h"
#include <sys/param.h>
-#include <sys/systm.h>
#include <sys/bus.h>
-#include <sys/mbuf.h>
+#include <sys/conf.h>
#include <sys/endian.h>
-#include <sys/filio.h>
#include <sys/fcntl.h>
+#include <sys/filio.h>
#include <sys/interrupt.h>
-#include <sys/socket.h>
-#include <sys/socketvar.h>
#include <sys/kernel.h>
-#include <sys/time.h>
-#include <sys/ucred.h>
-#include <sys/jail.h>
+#include <sys/kthread.h>
+#include <sys/mbuf.h>
#include <sys/module.h>
-#include <sys/conf.h>
-#include <sys/proc.h>
-#include <sys/sysctl.h>
#include <sys/proc.h>
-#include <sys/malloc.h>
-#include <sys/kthread.h>
#include <sys/smp.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+#include <sys/md5.h>
+#include <net/pfil.h>
#include <net/if.h>
-#include <net/if_types.h>
-#include <net/vnet.h>
#include <net/route.h>
+#include <net/pfvar.h>
+#include <net/if_pfsync.h>
+#include <net/if_pflog.h>
#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <netinet/ip_icmp.h>
-#include <sys/md5.h>
-#include <net/pfvar.h>
-
-#include <net/if_pfsync.h>
-#include <net/if_pflog.h>
-
#ifdef INET6
#include <netinet/ip6.h>
-#include <netinet/in_pcb.h>
#endif /* INET6 */
#ifdef ALTQ
#include <altq/altq.h>
#endif
-#include <sys/limits.h>
-#include <sys/lock.h>
-#include <sys/mutex.h>
-#include <net/pfil.h>
-
static int pfattach(void);
static struct pf_pool *pf_get_pool(char *, u_int32_t, u_int8_t, u_int32_t,
u_int8_t, u_int8_t, u_int8_t);
Modified: projects/pf/head/sys/contrib/pf/net/pf_lb.c
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/pf_lb.c Wed Sep 5 13:18:51 2012 (r240135)
+++ projects/pf/head/sys/contrib/pf/net/pf_lb.c Wed Sep 5 13:51:36 2012 (r240136)
@@ -35,61 +35,21 @@
*
*/
-#include "opt_inet.h"
-#include "opt_inet6.h"
-
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include "opt_pf.h"
+#include "opt_inet.h"
+#include "opt_inet6.h"
#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/mbuf.h>
-#include <sys/filio.h>
#include <sys/socket.h>
-#include <sys/socketvar.h>
-#include <sys/kernel.h>
-#include <sys/time.h>
#include <sys/sysctl.h>
-#include <sys/proc.h>
-#include <sys/kthread.h>
-#include <sys/lock.h>
-#include <sys/sx.h>
-
-#include <sys/md5.h>
#include <net/if.h>
-#include <net/if_types.h>
-#include <net/route.h>
-#include <net/radix_mpath.h>
-
-#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/ip_var.h>
-#include <netinet/tcp.h>
-#include <netinet/tcp_seq.h>
-#include <netinet/udp.h>
-#include <netinet/ip_icmp.h>
-#include <netinet/in_pcb.h>
-#include <netinet/tcp_timer.h>
-#include <netinet/tcp_var.h>
-#include <netinet/udp_var.h>
-#include <netinet/icmp_var.h>
-#include <netinet/if_ether.h>
-
#include <net/pfvar.h>
#include <net/if_pflog.h>
-
-#ifdef INET6
-#include <netinet/ip6.h>
-#include <netinet/in_pcb.h>
-#include <netinet/icmp6.h>
-#include <netinet6/nd6.h>
-#endif /* INET6 */
-
+#include <net/pf_mtag.h>
#define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x
Modified: projects/pf/head/sys/contrib/pf/net/pf_norm.c
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/pf_norm.c Wed Sep 5 13:18:51 2012 (r240135)
+++ projects/pf/head/sys/contrib/pf/net/pf_norm.c Wed Sep 5 13:51:36 2012 (r240136)
@@ -25,43 +25,38 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_pf.h"
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/param.h>
-#include <sys/systm.h>
+#include <sys/lock.h>
#include <sys/mbuf.h>
-#include <sys/filio.h>
-#include <sys/fcntl.h>
+#include <sys/mutex.h>
+#include <sys/refcount.h>
+#include <sys/rwlock.h>
#include <sys/socket.h>
-#include <sys/kernel.h>
-#include <sys/time.h>
+
#include <net/if.h>
-#include <net/if_types.h>
-#include <net/bpf.h>
-#include <net/route.h>
+#include <net/vnet.h>
+#include <net/pfvar.h>
+#include <net/pf_mtag.h>
#include <net/if_pflog.h>
#include <netinet/in.h>
-#include <netinet/in_var.h>
-#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <netinet/tcp.h>
+#include <netinet/tcp_fsm.h>
#include <netinet/tcp_seq.h>
-#include <netinet/udp.h>
-#include <netinet/ip_icmp.h>
#ifdef INET6
#include <netinet/ip6.h>
#endif /* INET6 */
-#include <net/pfvar.h>
-
struct pf_frent {
LIST_ENTRY(pf_frent) fr_next;
union {
Modified: projects/pf/head/sys/contrib/pf/net/pf_osfp.c
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/pf_osfp.c Wed Sep 5 13:18:51 2012 (r240135)
+++ projects/pf/head/sys/contrib/pf/net/pf_osfp.c Wed Sep 5 13:51:36 2012 (r240136)
@@ -21,14 +21,10 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
-#include <sys/socket.h>
-#include <sys/systm.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
#include <sys/kernel.h>
+#include <sys/socket.h>
#include <netinet/in.h>
-#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
Modified: projects/pf/head/sys/contrib/pf/net/pf_ruleset.c
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/pf_ruleset.c Wed Sep 5 13:18:51 2012 (r240135)
+++ projects/pf/head/sys/contrib/pf/net/pf_ruleset.c Wed Sep 5 13:51:36 2012 (r240136)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <sys/socket.h>
#ifdef _KERNEL
# include <sys/systm.h>
+# include <sys/refcount.h>
#endif /* _KERNEL */
#include <sys/mbuf.h>
Modified: projects/pf/head/sys/contrib/pf/net/pf_table.c
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/pf_table.c Wed Sep 5 13:18:51 2012 (r240135)
+++ projects/pf/head/sys/contrib/pf/net/pf_table.c Wed Sep 5 13:51:36 2012 (r240136)
@@ -30,22 +30,24 @@
*
*/
-#include "opt_inet.h"
-#include "opt_inet6.h"
-
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_inet.h"
+#include "opt_inet6.h"
+
#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/socket.h>
-#include <sys/mbuf.h>
#include <sys/kernel.h>
+#include <sys/lock.h>
#include <sys/malloc.h>
+#include <sys/mutex.h>
+#include <sys/refcount.h>
+#include <sys/rwlock.h>
+#include <sys/socket.h>
+#include <vm/uma.h>
#include <net/if.h>
-#include <net/route.h>
-#include <netinet/in.h>
+#include <net/vnet.h>
#include <net/pfvar.h>
#define ACCEPT_FLAGS(flags, oklist) \
Modified: projects/pf/head/sys/contrib/pf/net/pfvar.h
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/pfvar.h Wed Sep 5 13:18:51 2012 (r240135)
+++ projects/pf/head/sys/contrib/pf/net/pfvar.h Wed Sep 5 13:51:36 2012 (r240136)
@@ -34,23 +34,14 @@
#define _NET_PFVAR_H_
#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/refcount.h>
#include <sys/queue.h>
+#include <sys/refcount.h>
#include <sys/tree.h>
-#include <sys/lock.h>
#include <net/radix.h>
-#include <net/route.h>
-#include <net/if_clone.h>
-#include <net/pf_mtag.h>
-#include <vm/uma.h>
-
#include <netinet/in.h>
-#include <netinet/tcp_fsm.h>
-struct ip;
-struct ip6_hdr;
+#include <net/pf_mtag.h>
#define PF_TCPS_PROXY_SRC ((TCP_NSTATES)+0)
#define PF_TCPS_PROXY_DST ((TCP_NSTATES)+1)
More information about the svn-src-projects
mailing list