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 14 name="npf" 15 rcvar=$name 16 17 start_cmd="npf_start" 18 stop_cmd="npf_stop" 19 20 reload_cmd="npf_reload" 21 status_cmd="npf_status" 22 extra_commands="reload status" 23 24 25 npf_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 36 npf_stop() 37 { 38 echo "Disabling NPF." 39 /sbin/npfctl stop 40 /sbin/npfctl flush 41 } 42 43 npf_reload() 44 { 45 echo "Reloading NPF ruleset $npf_rules" 46 /sbin/npfctl reload "$npf_rules" 47 } 48 49 npf_status() 50 { 51 : 52 } 53 54 load_rc_config $name 55 run_rc_command "$1" 56