aboutsummaryrefslogtreecommitdiffstats
path: root/packages/miniupnpd/status_upnp.php
diff options
context:
space:
mode:
Diffstat (limited to 'packages/miniupnpd/status_upnp.php')
-rw-r--r--packages/miniupnpd/status_upnp.php88
1 files changed, 88 insertions, 0 deletions
diff --git a/packages/miniupnpd/status_upnp.php b/packages/miniupnpd/status_upnp.php
new file mode 100644
index 00000000..dae86878
--- /dev/null
+++ b/packages/miniupnpd/status_upnp.php
@@ -0,0 +1,88 @@
+<?php
+/* $Id$ */
+/*
+ status_upnp.php
+ part of pfSense (http://www.pfsense.com/)
+
+ Copyright (C) 2006 Seth Mos <seth.mos@xs4all.nl>.
+ All rights reserved.
+
+ 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");
+
+$rdr_entries = array();
+exec("/sbin/pfctl -aminiupnpd -sn", $rdr_entries, $pf_ret);
+
+$now = time();
+$year = date("Y");
+
+$pgtitle = array(gettext("Status"),gettext("UPnP Status"));
+include("head.inc");
+/* put your custom HTML head content here */
+/* using some of the $pfSenseHead function calls */
+$pfSenseHead->addMeta("<meta http-equiv=\"refresh\" content=\"120;url={$_SERVER['SCRIPT_NAME']}\" />");
+echo $pfSenseHead->getHTML();
+
+?>
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td width="10%" class="listhdrr"><?=gettext("Port")?></td>
+ <td width="10%" class="listhdrr"><?=gettext("Protocol")?></td>
+ <td width="20%" class="listhdrr"><?=gettext("Internal IP")?></td>
+ <td width="60%" class="listhdr"><?=gettext("Description")?></td>
+ </tr>
+ <?php $i = 0; foreach ($rdr_entries as $rdr_entry) {
+ $rdr_label = split("\"", $rdr_entry);
+ $rdr_ip = split(" ", $rdr_label[2]);
+ $rdr_port = split(" ", $rdr_label[2]);
+ $rdr_proto = split(" ", $rdr_label[0]);
+ ?>
+ <tr>
+ <td class="listlr">
+ <?php print $rdr_port[4];?>
+ </td>
+ <td class="listlr">
+ <?php print $rdr_proto[5];?>
+ </td>
+ <td class="listlr">
+ <?php print $rdr_ip[2];?>
+ </td>
+ <td class="listlr">
+ <?php print $rdr_label[1];?>
+ </td>
+ </tr>
+ <?php $i++; }?>
+ </table>
+ </div>
+ </table>
+
+<?php include("fend.inc"); ?>
+</body>
+</html>