[ previous ] [ next ] [ threads ]
 
 From:  "Fabien P." <liste at pecquet dot net>
 To:  m0n0wall dash dev at lists dot m0n0 dot ch
 Subject:  view: ipnat ipf and shaper rules
 Date:  Sun, 08 Feb 2004 11:22:39 +0100
here a very simple page that I did for viewing ipnat ipf and shaper rules.
It's little bit more easy to read than status.php

to try it :

1) Upload it from https://X.X.X.X/exec.php
2) execute: cp /tmp/status_rules.php /usr/local/www/status_rules.php
3) execute: chmod 755 /usr/local/www/status_rules.php
4) goto > https://X.X.X.X/status_rules.php

code:

#!/usr/local/bin/php
<?php
/*
    status_rules.php
    for m0n0wall (http://m0n0.ch/wall)
    
    Copyright (C) 2004 Fabien Pecquet
    
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions 
are met:
    
    1. Redistributions of source code must retain the above copyright 
notice,
       this list of conditions and the following disclaimer.
    
    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.
    
    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 
WARRANTIES,
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
SHALL THE
    AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
EXEMPLARY,
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
OF THE
    POSSIBILITY OF SUCH DAMAGE.
*/

require("guiconfig.inc");
require_once("functions.inc");
$ipnatrules = nl2br(filter_nat_rules_generate());
$ipfrules = nl2br(filter_rules_generate());
$shaperrules = nl2br(shaper_rules_generate());
$pageTitle = "m0n0wall: status_rules";
exec("/bin/date", $dateOutput, $dateStatus);
$currentDate = $dateOutput[0];

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><?=$pageTitle;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="gui.css" rel="stylesheet" type="text/css">
</head>

<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<p><span class="pgtitle"><?=$pageTitle;?></span><br>
<strong><?=$currentDate;?></strong>
<p><tt>
<hr><b>ipnat rules</b><br/><br/>
<?=$ipnatrules;?>
<hr><b>ipf rules</b><br/>
<?=$ipfrules;?>
<hr><b>shaper rules</b><br/>
<?=$shaperrules;?>
</tt>

</body>
</html>