1#!/bin/sh
2#
3# $NetBSD: npf,v 1.8 2023/10/05 08:19:27 abs Exp $
4#
5# Public Domain.
6#
7
8# PROVIDE: npf
9# REQUIRE: root bootconf CRITLOCALMOUNTED tty network
10# BEFORE: NETWORKING
11
12$_rc_subr_loaded . /etc/rc.subr
13
14name="npf"
15rcvar=$name
16
17start_cmd="npf_start"
18stop_cmd="npf_stop"
19
20reload_cmd="npf_reload"
21status_cmd="npf_status"
22extra_commands="reload status"
23
24
25npf_start()
26{
27	echo "Enabling NPF $npf_rules"
28	/sbin/npfctl reload "$npf_rules"
29
30	# The npf_boot script has enabled npf already.
31	if [ "$autoboot" != "yes" ]; then
32		/sbin/npfctl start
33	fi
34}
35
36npf_stop()
37{
38	echo "Disabling NPF."
39	/sbin/npfctl stop
40	/sbin/npfctl flush
41}
42
43npf_reload()
44{
45	echo "Reloading NPF ruleset $npf_rules"
46	/sbin/npfctl reload "$npf_rules"
47}
48
49npf_status()
50{
51	:
52}
53
54load_rc_config $name
55run_rc_command "$1"
56