Changeset View
Changeset View
Standalone View
Standalone View
libexec/rc/rc.d/ipfw_netflow
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
ipfw_netflow_is_running() | ipfw_netflow_is_running() | ||||
{ | { | ||||
ngctl show netflow: > /dev/null 2>&1 && return 0 || return 1 | ngctl show netflow: > /dev/null 2>&1 && return 0 || return 1 | ||||
} | } | ||||
ipfw_netflow_status() | ipfw_netflow_status() | ||||
{ | { | ||||
ipfw_netflow_is_running && echo "ipfw_netflow is active" || echo "ipfw_netflow is not active" | ipfw_netflow_is_running && echo "ipfw_netflow is active" || ( echo "ipfw_netflow is not active" && exit 1 ) | ||||
} | } | ||||
ipfw_netflow_start() | ipfw_netflow_start() | ||||
{ | { | ||||
ipfw_netflow_is_running && err 1 "ipfw_netflow is already active" | ipfw_netflow_is_running && err 1 "ipfw_netflow is already active" | ||||
ipfw add ${ipfw_netflow_rule} ngtee ${ipfw_netflow_hook} ip from any to any ${ipfw_netflow_fib:+fib ${ipfw_netflow_fib}} | ipfw add ${ipfw_netflow_rule} ngtee ${ipfw_netflow_hook} ip from any to any ${ipfw_netflow_fib:+fib ${ipfw_netflow_fib}} | ||||
ngctl -f - <<-EOF | ngctl -f - <<-EOF | ||||
mkpeer ipfw: netflow ${ipfw_netflow_hook} iface0 | mkpeer ipfw: netflow ${ipfw_netflow_hook} iface0 | ||||
Show All 18 Lines |