summaryrefslogtreecommitdiff
path: root/security/pflkm/files
diff options
context:
space:
mode:
authorpeter <peter@pkgsrc.org>2004-11-05 15:05:30 +0000
committerpeter <peter@pkgsrc.org>2004-11-05 15:05:30 +0000
commit5028be68615ad9abcff34dc590a15b088675cedf (patch)
tree83a3707e860adf3fb56850f2b81d12a9f1c119d1 /security/pflkm/files
parent3bc1b57ed8d0c2888a8f65f29da337f3e3b423a1 (diff)
downloadpkgsrc-5028be68615ad9abcff34dc590a15b088675cedf.tar.gz
Initial import of pflkm-20041025 into the NetBSD Packages Collection.
Packet Filter (from here on referred to as PF) is OpenBSD's system for filtering TCP/IP traffic and doing Network Address Translation. PF is also capable of normalizing and conditioning TCP/IP traffic. PF was originally developed by Daniel Hartmeier and is now maintained and developed by Daniel and the rest of the OpenBSD team. This package includes a complete port (LKM and userland utilities) from OpenBSD 3.6 to NetBSD 2.0.
Diffstat (limited to 'security/pflkm/files')
-rw-r--r--security/pflkm/files/pf.sh54
-rw-r--r--security/pflkm/files/pflogd.sh18
2 files changed, 72 insertions, 0 deletions
diff --git a/security/pflkm/files/pf.sh b/security/pflkm/files/pf.sh
new file mode 100644
index 00000000000..c47750c0890
--- /dev/null
+++ b/security/pflkm/files/pf.sh
@@ -0,0 +1,54 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: pf.sh,v 1.1.1.1 2004/11/05 15:05:30 peter Exp $
+#
+# PROVIDE: pf
+# REQUIRE: DAEMON
+#
+
+. /etc/rc.subr
+
+name="pf"
+rcvar=$name
+pfctl="@PREFIX@/sbin/pfctl"
+config="@PKG_SYSCONFDIR@/pf.conf"
+start_cmd="pf_start"
+stop_cmd="pf_stop"
+reload_cmd="pf_reload"
+status_cmd="pf_status"
+extra_commands="reload status"
+
+pf_start()
+{
+ echo "Enabling pf firewall."
+ ${pfctl} -q -e
+ if [ -f ${config} ]; then
+ ${pfctl} -q -f ${config}
+ else
+ warn "pf.conf not found; no pf rules loaded."
+ fi
+}
+
+pf_stop()
+{
+ echo "Disabling pf firewall."
+ ${pfctl} -q -d
+}
+
+pf_reload()
+{
+ echo "Reloading pf rules."
+ if [ -f ${config} ]; then
+ ${pfctl} -q -f ${config}
+ else
+ warn "pf.conf not found; no pf rules loaded."
+ fi
+}
+
+pf_status()
+{
+ ${pfctl} -s info
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/security/pflkm/files/pflogd.sh b/security/pflkm/files/pflogd.sh
new file mode 100644
index 00000000000..a0692e44da8
--- /dev/null
+++ b/security/pflkm/files/pflogd.sh
@@ -0,0 +1,18 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: pflogd.sh,v 1.1.1.1 2004/11/05 15:05:30 peter Exp $
+#
+# PROVIDE: pflogd
+# REQUIRE: DAEMON
+#
+
+. /etc/rc.subr
+
+name="pflogd"
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+start_precmd="/sbin/ifconfig pflog0 up"
+pidfile="/var/run/${name}.pid"
+
+load_rc_config $name
+run_rc_command "$1"