if ($subaction == 'start') { $ret = $lv->set_network_active($name, true) ? "Network has been started successfully" : 'Error while starting network: ' . $lv->get_last_error(); } else { if ($subaction == 'stop') { $ret = $lv->set_network_active($name, false) ? "Network has been stopped successfully" : 'Error while stopping network: ' . $lv->get_last_error(); } else { if ($subaction == 'dumpxml' || $subaction == 'edit') { $xml = $lv->network_get_xml($name, false); if ($subaction == 'edit') { if (@$_POST['xmldesc']) { $ret = $lv->network_change_xml($name, $_POST['xmldesc']) ? "Network definition has been changed" : 'Error changing network definition: ' . $lv->get_last_error(); } else { $ret = 'Editing network XML description: <br /><br /><form method="POST"><table><tr><td>Network XML description: </td>' . '<td><textarea name="xmldesc" rows="25" cols="90%">' . $xml . '</textarea></td></tr><tr align="center"><td colspan="2">' . '<input type="submit" value=" Edit domain XML description "></tr></form>'; } } else { $ret = 'XML dump of network <i>' . $name . '</i>:<br /><br />' . htmlentities($lv->get_network_xml($name, false)); } } } } } echo "<h3>List of networks</h3>"; $tmp = $lv->get_networks(VIR_NETWORKS_ALL); echo "<table>\n\t\t\t<tr>\n\t\t\t <th>Network name {$spaces}</th>\n\t\t\t <th>{$spaces} Network state {$spaces}</th>\n\t\t\t <th>{$spaces} Gateway IP Address {$spaces}</th>\n\t\t\t <th>{$spaces} IP Address Range {$spaces}</th>\n\t\t\t <th>{$spaces} Forwarding {$spaces}</th>\n\t\t\t <th>{$spaces} DHCP Range {$spaces}</th>\n\t\t\t <th>{$spaces} Actions {$spaces}</th>\n\t\t\t</tr>"; for ($i = 0; $i < sizeof($tmp); $i++) { $tmp2 = $lv->get_network_information($tmp[$i]); if ($tmp2['forwarding'] != 'None') { $forward = $tmp2['forwarding'] . ' to ' . $tmp2['forward_dev']; } else { $forward = 'None'; }