コード例 #1
0
ファイル: index-basic.php プロジェクト: PerthCharles/wanem
        ?>
		<div align=center : style="color: #000000; background-color: #0070C0; border: thin solid #000000; width: 100%">
		<table border="0" width="100%">
		  <tr>
			<td width="100%">
			  <p align="center">WANem is not running<input type="submit" value="Start WANem" name="btnStartNetem">
			</td>
		  </tr>
		</table>
		</div>
<?php 
    }
}
//Get current values into arrays according to how many interfaces there are being shown.
//e.g. $del[1 - 2] lossCorrelation[1 - 2].
get_current_values($interfaces, &$del, &$delJitter, &$delCorrelation, &$delDistribution, &$loss, &$lossCorrelation, &$dup, &$dupCorrelation, &$reorder, &$reorderCorrelation, &$gap, &$bandwidth, &$corrupt, &$sym, &$disc, &$limit, &$msFound, &$src, &$srcSub, &$dest, &$destSub, &$port, &$advanced);
//Turn $advanced into a session variable to it can be read further back in the program on this page.
$_SESSION[ignoreInts] = $advanced;
//Display all interfaces that are currently in the $interfaces array so their netem settings
//can be edited
show_interfaces(1, $interfaces, $del, $delJitter, $delCorrelation, $delDistribution, $loss, $lossCorrelation, $dup, $dupCorrelation, $reorder, $reorderCorrelation, $gap, $bandwidth, $corrupt, $sym, $disc, $limit, $displayCmd, $src, $srcSub, $dest, $destSub, $port, $advanced, &$showButton);
?>
<!--	  <p align="left"><a href="index.php">&lt Return to index page</a> -->
<?php 
if ($showButton == true) {
    ?>
	  <p align="center"><input type="submit" value="Apply settings" name="btnApply">
	  <input type="submit" value="Reset settings" name="btnReset">
	  <input type="submit" value="Refresh settings" name="btnRefresh"></br>
<?php 
} else {
コード例 #2
0
ファイル: status.php プロジェクト: PerthCharles/wanem
    //if the next interface matches the previous interface then the next $ruleSet element value =
    // the previous $ruleSet element value + 1, otherwise it equals 1
    //Example arrays:
    //$interfaces[lo, eth0, eth0, eth1]
    //$ruleSet[1, 1, 2, 1]
    if ($interfaces[$n] == $tmpStr) {
        $ruleSet[$n] = $ruleSet[$n - 1] + 1;
    } else {
        $ruleSet[$n] = 1;
    }
    $tmpStr = $interfaces[$n];
}
for ($int = 0; $int < count($interfaces); $int++) {
    //Call function to get and display currently running netem commands for each interface
    if (strcmp($interfaces[$int], "lo") != 0 && strcmp($interfaces[$int], "") != 0) {
        get_current_values($interfaces, $int, &$noValuesFound, $ruleSet);
    }
}
?>
	<p><input type="submit" value="Refresh" name="B1"></p>
</form>

<?php 
//***************************************************************************************
//Function to find the netem rules which are currently running on a selected interface
//and display them on screen.
//***************************************************************************************
function get_current_values($interfaces, $int, $noValuesFound, $ruleSet)
{
    include "config.inc.php";
    global $tc_CMD;