$conf) { if ($index == 0) continue; if ($conf['interface'] == $_POST['interface']) $input_errors[] = "Interface {$_POST['interface']} is already configured."; } } if ($_POST['md5password'] && empty($_POST['password'])) $input_errors[] = "Please input a password."; } function ospfd_validate_input() { global $config, $g, $input_errors; if (!empty($_POST['routerid']) && !is_ipaddr($_POST['routerid'])) $input_errors[] = "Router ID must be an address."; if (!is_ipaddr($_POST['area'])) $input_errors[] = "Area needs to be a valid ip_address."; if ($_POST['spfholdtime'] <> "" && ($_POST['spfholdtime'] < 1 || $_POST['spfholdtime'] > 5)) $input_errors[] = "SPF holdtime needs to be between 1 and 5."; if ($_POST['spfdelay'] <> "" && ($_POST['spfdelay'] < 1 || $_POST['spfdelay'] > 10)) $input_errors[] = "SPF delay needs to be between 1 and 10."; if (!$config['installedpackages']['ospfdinterfaces']['config']) $input_errors[] = "Please select an interface to use for OSPFd."; } // get the raw ospfd confi file for manual inspection/editing function ospfd_get_raw_config() { return file_get_contents("/usr/local/etc/ospfd.conf"); } // serialize the raw ospfd confi file to config.xml function ospfd_put_raw_config($conffile) { global $config; if ($conffile == "") unset($config['installedpackages']['ospfd']['rawconfig']); else { $config['installedpackages']['ospfd']['rawconfig'] = array(); $config['installedpackages']['ospfd']['rawconfig']['item'] = explode("\n",$_POST['ospfd_raw']); $config['installedpackages']['ospfd']['rawconfig'] = $conffile; } } function is_ospfd_running() { $status = `ps awux | grep ospfd | grep "parent" | grep -v grep | wc -l | awk '{ print \$1 }'`; if(intval($status) > 0) return true; else return false; } ?>