X-Git-Url: http://git.pjr.cc/?p=CBFWR.git;a=blobdiff_plain;f=libcbfwr%2Ffwui.php;h=e19e9a4b11597c8456ba91f9dd5a2c9399817d58;hp=63c6613b7530d6b285f391d152a7ef9d93d2e439;hb=cb45585d92144a65ff25bc1109cde4cbf60913de;hpb=b571fcf2648a6d5a4893125cb97db4f3f73ee134
diff --git a/libcbfwr/fwui.php b/libcbfwr/fwui.php
index 63c6613..e19e9a4 100644
--- a/libcbfwr/fwui.php
+++ b/libcbfwr/fwui.php
@@ -192,163 +192,29 @@ function CBFWZonesPageDisplay()
}
-function CBFWInterfacesPage($urls)
+function CBFWRoutingPage($urls)
{
if(isset($urls[1])) {
switch($urls[1]) {
case "edit":
- CBFWpageBuilder(null, "CBFWInterfacesPageEdit", null, null, $urls[2]);
+ CBFWpageBuilder(null, "CBFWRoutingPageEdit", null, null, $urls[2]);
break;
case "change":
- CBFWInterfacesChange();
+ CBFWRoutingChange();
break;
default:
- CBFWpageBuilder(null, "CBFWInterfacesPageDisplay");
+ CBFWpageBuilder(null, "CBFWRoutingPageDisplay");
}
} else {
error_log("main interface page");
- CBFWpageBuilder(null, "CBFWInterfacesPageDisplay");
+ CBFWpageBuilder(null, "CBFWRoutingPageDisplay");
}
-}
-
-function CBFWInterfacesChange()
-{
- global $BASE_URL, $MENU_ITEMS;
- $comms = new Comms();
- $comms->sendMessage("interface eth0 changename poof");
- header("Location: $BASE_URL/interfaces");
-}
-
-function CBFWInterfacesPageEdit($urls)
-{
- global $BASE_URL, $MENU_ITEMS;
- $interface = $urls;
-
- echo "
Edit Interface $interface
";
- echo "";
}
-function CBFWInterfacesPageDisplay()
+function CBFWRoutingPageDisplay()
{
- global $BASE_URL, $MENU_ITEMS;
- $comms = new Comms();
-
- $config = $comms->getConfig(0);
- $boot_config = $comms->getConfig(1);
-
- // now build an interface table
- $table = array();
- foreach($boot_config["hardware"]["netdev"] as $key=>$val) {
- $ename = $key;
- $table[$key]["realname"] = $val["name"];
- $table[$key]["name"] = $val["name"];
-
-
- // driver
- if(isset($val["driver"])) $table[$key]["type"] = $val["driver"];
- else $table[$key]["type"] = "Unknown";
-
- // hw address
- if(isset($val["hwaddress"])) $table[$key]["hwaddress"] = $val["hwaddress"];
-
- // current mtu
- if(isset($val["mtu"])) $table[$key]["mtu"] = $val["mtu"];
- }
-
- foreach($config["hardware"]["netdev"] as $key=>$val) {
- $ename = $key;
- if(isset($config["interface"]["$key"]["name"])) $table[$key]["name"] = $config["interface"]["$key"]["name"];
- $table[$key]["address4"] = null;
- $table[$key]["address6"] = null;
-
- if(isset($config["interface"][$table[$key]["name"]]["address4"])) {
- $table[$key]["address4"] = $config["interface"][$table[$key]["name"]]["address4"];
- }
-
- if(isset($config["interface"][$table[$key]["name"]]["address6"])) {
- $table[$key]["address6"] = $config["interface"][$table[$key]["name"]]["address6"];
- }
-
- if(isset($config["interface"][$table[$key]["name"]]["mtu"])) {
- $table[$key]["mtu"] = $config["interface"][$table[$key]["name"]]["mtu"];
- } else {
- $table[$key]["mtu"] = "1500"; // TODO: this needs to actually come from somewhere
- }
-
- if(isset($config["interface"][$table[$key]["name"]]["speed"])) {
- $table[$key]["speed"] = $config["interface"][$table[$key]["name"]]["speed"];
- } else {
- $table[$key]["speed"] = null;
- }
-
- if(isset($config["interface"][$table[$key]["name"]]["duplex"])) {
- $table[$key]["duplex"] = $config["interface"][$table[$key]["name"]]["duplex"];
- } else {
- $table[$key]["duplex"] = null;
- }
-
- if(isset($config["interface"][$table[$key]["name"]]["zone"])) {
- $table[$key]["zone"] = $config["interface"][$table[$key]["name"]]["zone"];
- } else {
- $table[$key]["zone"] = null;
- }
- }
-
-
- echo "Device | Zone | Type | MAC Address | Address | MTU | Speed/Duplex | Control | ";
- foreach($table as $key =>$val) {
- if($val["realname"] == $val["name"]) $name = $val["name"];
- else $name = $val["name"]." (".$val["realname"].")";
-
- // zone
- if($val["zone"] == null) $zone = "-";
- else $zone = $val["zone"];
-
- // mtu
- $mtu = $val["mtu"];
-
- // driver type
- $type = $val["type"];
-
- // hardware address
- $mac = $val["hwaddress"];
-
- // speed and duplex
- if($val["duplex"] == null) $dup = "default";
- else $dup = $val["duplex"];
-
- if($val["speed"] == null) $spd = "default";
- else $spd = $val["speed"];
-
- $spanddu = "$spd/$dup";
-
- // network address
- if($val["address4"]!=null && $val["address6"]!=null) {
- $address = $val["address4"]."
".$val["address6"];
- } else if($val["address4"] != null) {
- $address = $val["address4"];
- } else if($val["address6"] != null) {
- $address = $val["address6"];
- } else {
- $address = "-";
- }
-
- echo "$name | $zone | $type | $mac | $address | $mtu | $spanddu | Edit |
";
- }
- echo "
";
+ echo "Routing
";
}
function CBFWObjectsPage($urls)
@@ -516,8 +382,8 @@ Description
Add Access