event_emit firewall-reload
}
-# XXX dunno what this does.
function event_interface_up() {
local iface=${1}
event_emit network-interface-up IFACE=${iface}
}
-# XXX dunno what this does.
function event_interface_down() {
local iface=${1}
#connection --down --zone=${zone}
}
+function ppp_common_ip_pre_up() {
+ local zone=${1}
+ shift
+
+ if ! zone_exists ${zone}; then
+ error "Zone '${zone}' does not exist."
+ return ${EXIT_ERROR}
+ fi
+
+ # Request firewall reload
+ event_firewall_reload
+
+ return ${EXIT_OK}
+}
+
+function ppp_common_ip_up() {
+ local zone=${1}
+ shift
+
+ if ! zone_exists ${zone}; then
+ error "Zone '${zone}' does not exist."
+ return ${EXIT_ERROR}
+ fi
+
+ # Emit interface-up event
+ event_interface_up ${zone}
+
+ return ${EXIT_OK}
+}
+
+function ppp_common_ip_down() {
+ local zone=${1}
+ shift
+
+ if ! zone_exists ${zone}; then
+ error "Zone '${zone}' does not exist."
+ return ${EXIT_ERROR}
+ fi
+
+ # Emit interface-up event
+ event_interface_down ${zone}
+
+ return ${EXIT_OK}
+}
+
function ppp_secret() {
local USER=${1}
local SECRET=${2}
_notimplemented _config_show
}
-# These tree functions exit silently
function _ppp-ip-pre-up() {
- exit ${EXIT_OK}
+ local zone=${1}
+ shift
+
+ if ! zone_exists ${zone}; then
+ error "Zone '${zone}' does not exist."
+ exit ${EXIT_ERROR}
+ fi
+
+ ppp_common_ip_pre_up ${zone} $@
+
+ exit $?
}
function _ppp-ip-up() {
- exit ${EXIT_OK}
+ local zone=${1}
+ shift
+
+ if ! zone_exists ${zone}; then
+ error "Zone '${zone}' does not exist."
+ exit ${EXIT_ERROR}
+ fi
+
+ ppp_common_ip_up ${zone} $@
+
+ exit $?
}
function _ppp-ip-down() {
- exit ${EXIT_OK}
+ local zone=${1}
+ shift
+
+ if ! zone_exists ${zone}; then
+ error "Zone '${zone}' does not exist."
+ exit ${EXIT_ERROR}
+ fi
+
+ ppp_common_ip_down ${zone} $@
+
+ exit $?
}
function run() {