sem_release($this->semres);
}
+ function deleteConfig($type)
+ {
+ global $MESSAGE_KEY, $LOCKING_KEY, $STORE_KEY, $CONF_STORE_SIZE;
+ $shm_space = shm_attach($STORE_KEY, $CONF_STORE_SIZE);
+
+ shm_remove_var($shm_space, $type);
+ }
// type = 0 for the fs config
// type = 1 for the boot hardware config
}
fclose($fp);
}
+ if(file_exists("/sys/class/net/$fname/mtu")) $this->config["hardware"]["netdev"][$fname]["mtu"] = file_get_contents("/sys/class/net/$fname/mtu");
if(file_exists("/sys/class/net/$fname/address")) $this->config["hardware"]["netdev"][$fname]["hwaddress"] = file_get_contents("/sys/class/net/$fname/address");
if(file_exists("/sys/class/net/$fname/bonding")) $this->config["hardware"]["netdev"][$fname]["bonding"] = true;
if(file_exists("/sys/class/net/$fname/bridge")) $this->config["hardware"]["netdev"][$fname]["bridge"] = true;
// 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) {
{
echo "Must remember this, gotta rules could apply to multiple zones not just one<br>";
echo "i.e.: add rule reject from object/host/hostname to address6/2003::123 in zones Zone/zonename/rulenum Zone/zonename/rulenum";
- $conf = new Config();
- $conf->loadConfig();
+
+ $comms = new Comms();
echo "<pre>";
- print_r($conf->getConfig());
+ print_r($comms->getConfig(0));
+ echo "\n\n\n";
+ print_r($comms->getConfig(1));
+ echo "\n\n\n";
+ print_r($comms->getConfig(2));
echo "\n\n\n";
- print_r($conf->getBootConfig());
+ print_r($comms->getConfig(3));
echo "</pre>";
}
--- /dev/null
+<?php
+$CMD_ROOT_FS = realpath(dirname(__FILE__));
+$AM_DAEMON = false;
+
+global $CMD_ROOT_FS;
+global $AM_DAEMON;
+
+// add libglcas as if it were a path in ../libglcas
+if(file_exists("../libcbfwr")) {
+ $path = realpath($CMD_ROOT_FS."/../");
+ error_log("added cbfwr path as $path");
+ set_include_path(get_include_path().PATH_SEPARATOR.$path);
+}
+
+// include the based library
+require_once("libcbfwr/lib.php");
+
+glcas_pluginLoader();
+
+$comms = new Comms();
+
+for($i=0; $i<10; $i++) $comms->deleteConfig($i);
+
+?>
\ No newline at end of file