From a306c902b8a24b04a2ecece767f48182fc31be1a Mon Sep 17 00:00:00 2001
From: Max Laier <mlaier@FreeBSD.org>
Date: Wed, 16 Jun 2004 22:59:06 +0000
Subject: [PATCH] Prepare for pf 3.5 import:  - Remove pflog and pfsync
 modules. Things will change in such a fashion    that there will be one
 module with pf+pflog that can be loaded into    GENERIC without problems
 (which is what most people want). pfsync is no    longer possible as a
 module.  - Add multicast address for in-kernel multicast pfsync protocol.
 Protocol    glue will follow once the import is done.  - Add one more mbuf
 tag

---
 sys/modules/Makefile        |  4 ----
 sys/modules/pflog/Makefile  | 29 -----------------------------
 sys/modules/pfsync/Makefile | 29 -----------------------------
 sys/netinet/in.h            |  2 ++
 sys/sys/mbuf.h              |  1 +
 5 files changed, 3 insertions(+), 62 deletions(-)
 delete mode 100644 sys/modules/pflog/Makefile
 delete mode 100644 sys/modules/pfsync/Makefile

diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 73153f706af5..8c4fd23ddfb1 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -159,8 +159,6 @@ SUBDIR=	${_3dfx} \
 	pcn \
 	${_pecoff} \
 	${_pf} \
-	${_pflog} \
-	${_pfsync} \
 	plip \
 	${_pmc} \
 	portalfs \
@@ -273,8 +271,6 @@ _ipfilter=	ipfilter
 
 .if !defined(NO_PF) || defined(ALL_MODULES)
 _pf=		pf
-_pflog=		pflog
-_pfsync=	pfsync
 .endif
 
 .if ${MACHINE_ARCH} == "i386"
diff --git a/sys/modules/pflog/Makefile b/sys/modules/pflog/Makefile
deleted file mode 100644
index 1eb46e976fe8..000000000000
--- a/sys/modules/pflog/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-# $FreeBSD$
-
-.PATH: ${.CURDIR}/../../contrib/pf/net
-
-KMOD=	pflog
-SRCS = 	if_pflog.c \
-	opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h
-
-CFLAGS+=  -Wall -I${.CURDIR}/../../contrib/pf
-
-opt_pf.h:
-	echo "#define DEV_PF 1" > opt_pf.h
-	echo "#define DEV_PFLOG 1" >> opt_pf.h
-	echo "#define DEV_PFSYNC 1" >> opt_pf.h
-
-opt_inet.h:
-	echo "#define INET 1" > opt_inet.h
-
-opt_inet6.h:
-.if defined(NOINET6)
-	echo > opt_inet6.h
-.else
-	echo "#define INET6 1" > opt_inet6.h
-.endif
-
-opt_bpf.h:
-	echo "#define DEV_BPF 1" > opt_bpf.h
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/pfsync/Makefile b/sys/modules/pfsync/Makefile
deleted file mode 100644
index 23f79e26c350..000000000000
--- a/sys/modules/pfsync/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-# $FreeBSD$
-
-.PATH: ${.CURDIR}/../../contrib/pf/net
-
-KMOD=	pfsync
-SRCS = 	if_pfsync.c \
-	opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h
-
-CFLAGS+=  -Wall -I${.CURDIR}/../../contrib/pf
-
-opt_pf.h:
-	echo "#define DEV_PF 1" > opt_pf.h
-	echo "#define DEV_PFLOG 1" >> opt_pf.h
-	echo "#define DEV_PFSYNC 1" >> opt_pf.h
-
-opt_inet.h:
-	echo "#define INET 1" > opt_inet.h
-
-opt_inet6.h:
-.if defined(NOINET6)
-	echo > opt_inet6.h
-.else
-	echo "#define INET6 1" > opt_inet6.h
-.endif
-
-opt_bpf.h:
-	echo "#define DEV_BPF 1" > opt_bpf.h
-
-.include <bsd.kmod.mk>
diff --git a/sys/netinet/in.h b/sys/netinet/in.h
index 95c2fa3462a9..5b659089ed85 100644
--- a/sys/netinet/in.h
+++ b/sys/netinet/in.h
@@ -231,6 +231,7 @@ __END_DECLS
 /* 101-254: Partly Unassigned */
 #define	IPPROTO_PIM		103		/* Protocol Independent Mcast */
 #define	IPPROTO_PGM		113		/* PGM */
+#define	IPPROTO_PFSYNC		240		/* PFSYNC */
 /* 255: Reserved */
 /* BSD Private, local use, namespace incursion, no longer used */
 #define	IPPROTO_OLD_DIVERT	254		/* OLD divert pseudo-proto */
@@ -350,6 +351,7 @@ __END_DECLS
 #define	INADDR_UNSPEC_GROUP	(u_int32_t)0xe0000000	/* 224.0.0.0 */
 #define	INADDR_ALLHOSTS_GROUP	(u_int32_t)0xe0000001	/* 224.0.0.1 */
 #define	INADDR_ALLRTRS_GROUP	(u_int32_t)0xe0000002	/* 224.0.0.2 */
+#define	INADDR_PFSYNC_GROUP	(u_int32_t)0xe00000f0	/* 224.0.0.240 */
 #define	INADDR_ALLMDNS_GROUP	(u_int32_t)0xe00000fb	/* 224.0.0.251 */
 #define	INADDR_MAX_LOCAL_GROUP	(u_int32_t)0xe00000ff	/* 224.0.0.255 */
 
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 81cf236cbf8d..e8b668208d7c 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -632,6 +632,7 @@ struct	mbuf	*m_uiotombuf(struct uio *, int, int);
 #define	PACKET_TAG_PF_QID			23 /* PF ALTQ queue id */
 #define	PACKET_TAG_PF_TAG			24 /* PF tagged */
 #define	PACKET_TAG_RTSOCKFAM			25 /* rtsock sa family */
+#define	PACKET_TAG_PF_TRANSLATE_LOCALHOST	26 /* PF translate localhost */
 
 /* Packet tag routines. */
 struct	m_tag	*m_tag_alloc(u_int32_t, int, int, int);