0 # # defaults to 1 MprCoverage 3 # Example plugin entry with parameters: EODA; if ($olsrd['enablehttpinfo'] == "on") { $olsr .= << "olsrd.sh", "start" => $olsrd_start, "stop" => $olsrd_stop ) ); if (is_service_running("olsrd")) { restart_service("olsrd"); } else { start_service("olsrd"); } } conf_mount_ro(); } function validate_form_olsrd($post, &$input_errors) { /* if ($post['iface_array'] == "") { $input_errors[] = 'You must select at least one interface for OSLRD.'; } */ if ($post['enablehttpinfo']) { if (!$post['port'] || !$post['allowedhttpinfohost'] || !$post['allowedhttpinfosubnet']) { $input_errors[] = "'HTTPInfo Port', 'Allowed Host(s) IP Address/Subnet' and 'Allowed Host(s) Netmask' must be filled in when HTTPInfo Plugin is enabled."; } if ($post['port'] && !is_port($post['port'])) { $input_errors[] = "Invalid port entered for 'HTTPInfo Port'."; } if ($post['allowedhttpinfohost'] && !is_ipaddrv4($post['allowedhttpinfohost'])) { $input_errors[] = "Invalid IPv4 address entered for 'Allowed Host(s) IP Address/Subnet'."; } if ($post['allowedhttpinfosubnet'] && !is_ipaddrv4($post['allowedhttpinfosubnet'])) { $input_errors[] = "Invalid IPv4 address entered for 'Allowed Host(s) Netmask'."; } if ($post['allowedhttpinfohost'] && is_ipaddrv4($post['allowedhttpinfohost']) && $post['allowedhttpinfosubnet'] && is_ipaddrv4($post['allowedhttpinfosubnet'])) { $cidr = 32 - log((ip2long($post['allowedhttpinfosubnet']) ^ ip2long('255.255.255.255')) + 1, 2); $acl = "{$post['allowedhttpinfohost']}/{$cidr}"; if (!is_subnetv4($acl)) { $input_errors[] = "'{$post['allowedhttpinfohost']}/{$post['allowedhttpinfosubnet']}' is not a valid IPv4 subnet."; } } } if ($post['enabledyngw']) { if (!$post['ping'] || !$post['polling']) { $input_errors[] = "'Ping IP Address' and 'Poll Interval' must be filled in when 'Enable Dynamic Gateway' is checked."; } if ($post['ping'] && !is_ipaddrv4($post['ping'])) { $input_errors[] = "Invalid IPv4 address entered for 'Ping IP Address'."; } if ($post['polling'] && (!is_numericint($post['polling']) || ($post['polling'] < 1))) { $input_errors[] = "'Poll Interval' must be numeric integer greater than 0."; } } } function php_deinstall_olsrd() { global $g; unlink_if_exists("{$g['varetc_path']}/olsr.conf"); unlink_if_exists("{$g['tmp_path']}/olsrkey.txt"); } ?>