* Copyright (c) 2004-2005 Jonathan Watt * All rights reserved. * * originally part of m0n0wall (http://m0n0.ch/wall) * Copyright (c) 2003-2004 Manuel Kasper . * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ $nocsrf = true; require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); require_once("functions.inc"); require_once("/usr/local/www/widgets/include/interface_statistics.inc"); // Compose the table contents and pass it back to the ajax caller if ($_REQUEST && $_REQUEST['ajax']) { $rows = array( 'inpkts' => gettext('Packets In'), 'outpkts' => gettext('Packets Out'), 'inbytes' => gettext('Bytes In'), 'outbytes' => gettext('Bytes Out'), 'inerrs' => gettext('Errors In'), 'outerrs' => gettext('Errors Out'), 'collisions' => gettext('Collisions'), ); $ifdescrs = get_configured_interface_with_descr(); print(""); print( ""); print( ""); foreach ($ifdescrs as $ifname) { print( "" . $ifname . ""); } print( ""); print( ""); print( ""); foreach ($rows as $key => $name) { print(""); print( "" . $name . ""); foreach ($ifdescrs as $ifdescr => $ifname) { $ifinfo = get_interface_info($ifdescr); if ($ifinfo['status'] == "down") { continue; } $ifinfo['inbytes'] = format_bytes($ifinfo['inbytes']); $ifinfo['outbytes'] = format_bytes($ifinfo['outbytes']); print("" . (isset($ifinfo[$key]) ? htmlspecialchars($ifinfo[$key]) : 'n/a') . ""); } print( ""); print( ""); } print( ""); exit; } $widgetperiod = isset($config['widgets']['period']) ? $config['widgets']['period'] * 1000 : 10000; ?>