diff --git a/plist b/plist index b4c8cff17..c07b0028d 100644 --- a/plist +++ b/plist @@ -914,7 +914,6 @@ /usr/local/opnsense/scripts/filter/lib/alias/pf.py /usr/local/opnsense/scripts/filter/lib/alias/uri.py /usr/local/opnsense/scripts/filter/lib/states.py -/usr/local/opnsense/scripts/filter/list_counters.py /usr/local/opnsense/scripts/filter/list_osfp.py /usr/local/opnsense/scripts/filter/list_pfsync.py /usr/local/opnsense/scripts/filter/list_rule_ids.py @@ -1073,7 +1072,6 @@ /usr/local/opnsense/scripts/syslog/queryLog.py /usr/local/opnsense/scripts/system/activity.py /usr/local/opnsense/scripts/system/certctl.py -/usr/local/opnsense/scripts/system/list_interrupts.py /usr/local/opnsense/scripts/system/nameservers.php /usr/local/opnsense/scripts/system/remote_backup.php /usr/local/opnsense/scripts/system/rfc5246_cipher_suites.csv @@ -2045,7 +2043,6 @@ /usr/local/www/services_opendns.php /usr/local/www/services_router_advertisements.php /usr/local/www/status_habackup.php -/usr/local/www/status_interfaces.php /usr/local/www/status_ntpd.php /usr/local/www/status_wireless.php /usr/local/www/system_advanced_admin.php diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 2e781b75c..95b6553de 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -3927,220 +3927,6 @@ function interfaces_neighbors_configure($device = null, $ifconfig_details = null } } -function get_interfaces_info($include_unlinked = false) -{ - global $config; - - $all_intf_details = legacy_interfaces_details(); - $all_intf_stats = legacy_interface_stats(); - $gateways = new \OPNsense\Routing\Gateways(); - $ifup = legacy_interface_listget('up'); - $result = []; - $interfaces = legacy_config_get_interfaces(['virtual' => false]); - $known_interfaces = []; - foreach (array_keys($interfaces) as $ifdescr) { - $interfaces[$ifdescr]['if'] = get_real_interface($ifdescr); - if (!empty($interfaces[$ifdescr]['if'])) { - $known_interfaces[] = $interfaces[$ifdescr]['if']; - } - $interfaces[$ifdescr]['ifv6'] = get_real_interface($ifdescr, 'inet6'); - if (!empty($interfaces[$ifdescr]['ifv6'])) { - $known_interfaces[] = $interfaces[$ifdescr]['ifv6']; - } - } - - if ($include_unlinked) { - $unassigned_descr = gettext("Unassigned"); - foreach ($all_intf_details as $if => $ifdata) { - if (!in_array($if, $known_interfaces)) { - $interfaces[$if] = ["descr" => $unassigned_descr, "if" => $if, "ifv6" => $if, 'unassigned' => true]; - } - } - } - - foreach ($interfaces as $ifdescr => $ifinfo) { - $ifinfo['status'] = in_array($ifinfo['if'], $ifup) ? 'up' : 'down'; - $ifinfo['statusv6'] = in_array($ifinfo['ifv6'], $ifup) ? 'up' : 'down'; - - /* undesired side effect of legacy_config_get_interfaces() */ - $ifinfo['ipaddr'] = $ifinfo['ipaddrv6'] = null; - - if (!empty($all_intf_details[$ifinfo['if']])) { - if ( - isset($all_intf_details[$ifinfo['if']]['status']) && - in_array($all_intf_details[$ifinfo['if']]['status'], array('active', 'running')) - ) { - $all_intf_details[$ifinfo['if']]['status'] = $ifinfo['status']; - } - $ifinfo = array_merge($ifinfo, $all_intf_details[$ifinfo['if']]); - } - - if (!empty($ifinfo['ipv4'])) { - list ($primary4,, $bits4) = interfaces_primary_address($ifdescr, $all_intf_details); - if (!empty($primary4)) { - $ifinfo['ipaddr'] = $primary4; - $ifinfo['subnet'] = $bits4; - } else { - $ifinfo['ipaddr'] = $ifinfo['ipv4'][0]['ipaddr']; - $ifinfo['subnet'] = $ifinfo['ipv4'][0]['subnetbits']; - } - } - - if (!empty($all_intf_details[$ifinfo['ifv6']]['ipv6'])) { - /* rewrite always as it can be a different interface */ - $ifinfo['ipv6'] = $all_intf_details[$ifinfo['ifv6']]['ipv6']; - } elseif ($ifinfo['if'] != !$ifinfo['ifv6']) { - /* clear on a mismatch to avoid wrong data here */ - $ifinfo['ipv6'] = []; - } - - if (!empty($ifinfo['ipv6'])) { - list ($primary6,, $bits6) = interfaces_primary_address6($ifdescr, $all_intf_details); - if (!empty($primary6)) { - $ifinfo['ipaddrv6'] = $primary6; - $ifinfo['subnetv6'] = $bits6; - } - foreach ($ifinfo['ipv6'] as $ipv6addr) { - if (!empty($ipv6addr['link-local'])) { - $ifinfo['linklocal'] = $ipv6addr['ipaddr']; - } elseif (empty($ifinfo['ipaddrv6'])) { - $ifinfo['ipaddrv6'] = $ipv6addr['ipaddr']; - $ifinfo['subnetv6'] = $ipv6addr['subnetbits']; - } - } - - $aux = shell_safe('/usr/local/sbin/ifctl -6pi %s', $ifinfo['ifv6']); - if (!empty($aux)) { - $ifinfo['prefixv6'] = explode("\n", $aux); - } - } - - $ifinfotmp = $all_intf_stats[$ifinfo['if']]; - $ifinfo['inbytes'] = $ifinfotmp['bytes received']; - $ifinfo['outbytes'] = $ifinfotmp['bytes transmitted']; - $ifinfo['inpkts'] = $ifinfotmp['packets received']; - $ifinfo['outpkts'] = $ifinfotmp['packets transmitted']; - $ifinfo['inerrs'] = $ifinfotmp['input errors']; - $ifinfo['outerrs'] = $ifinfotmp['output errors']; - $ifinfo['collisions'] = $ifinfotmp['collisions']; - - $link_type = $config['interfaces'][$ifdescr]['ipaddr'] ?? 'none'; - switch ($link_type) { - case 'dhcp': - $ifinfo['dhcplink'] = isvalidpid("/var/run/dhclient.{$ifinfo['if']}.pid") ? 'up' : 'down'; - break; - /* PPPoE/PPTP/L2TP interface? -> get status from virtual interface */ - case 'pppoe': - case 'pptp': - case 'l2tp': - if ($ifinfo['status'] == "up") { - /* XXX get PPPoE link status for dial on demand */ - $ifinfo["{$link_type}link"] = "up"; - } else { - $ifinfo["{$link_type}link"] = "down"; - } - break; - /* PPP interface? -> get uptime for this session and cumulative uptime from the persistent log file in conf */ - case 'ppp': - if ($ifinfo['status'] == "up") { - $ifinfo['ppplink'] = "up"; - } else { - $ifinfo['ppplink'] = "down"; - } - - if (empty($ifinfo['status'])) { - $ifinfo['status'] = "down"; - } - - if (isset($config['ppps']['ppp'])) { - foreach ($config['ppps']['ppp'] as $pppid => $ppp) { - if ($config['interfaces'][$ifdescr]['if'] == $ppp['if']) { - break; - } - } - } - if ($config['interfaces'][$ifdescr]['if'] != $ppp['if'] || empty($ppp['ports'])) { - break; - } - if (!file_exists($ppp['ports'])) { - $ifinfo['nodevice'] = 1; - $ifinfo['pppinfo'] = $ppp['ports'] . " " . gettext("device not present! Is the modem attached to the system?"); - } - - // Calculate cumulative uptime for PPP link. Useful for connections that have per minute/hour contracts so you don't go over! - if (isset($ppp['uptime'])) { - $ifinfo['ppp_uptime_accumulated'] = "(" . get_ppp_uptime($ifinfo['if']) . ")"; - } - break; - default: - break; - } - - if (file_exists("/var/run/{$link_type}_{$ifdescr}.pid")) { - $sec = intval(shell_safe('/usr/local/opnsense/scripts/interfaces/ppp-uptime.sh %s', $ifinfo['if'])); - if ($sec) { - $ifinfo['ppp_uptime'] = convert_seconds_to_hms($sec); - } - } - - switch ($config['interfaces'][$ifdescr]['ipaddrv6'] ?? 'none') { - case 'dhcp6': - $ifinfo['dhcp6link'] = isvalidpid('/var/run/dhcp6c.pid') && file_exists("/var/etc/dhcp6c_{$ifdescr}.conf") ? 'up' : 'down'; - break; - /* XXX more to do here in the future */ - default: - break; - } - - if ($ifinfo['status'] == "up") { - $wifconfiginfo = array(); - if (isset($config['interfaces'][$ifdescr]['wireless'])) { - exec("/sbin/ifconfig {$ifinfo['if']} list sta", $wifconfiginfo); - array_shift($wifconfiginfo); - } - foreach ($wifconfiginfo as $ici) { - $elements = preg_split("/[ ]+/i", $ici); - if ($elements[0] != "") { - $ifinfo['bssid'] = $elements[0]; - } - if ($elements[3] != "") { - $ifinfo['rate'] = $elements[3]; - } - if ($elements[4] != "") { - $ifinfo['rssi'] = $elements[4]; - } - } - $gateway = $gateways->getInterfaceGateway($ifdescr, 'inet'); - if (!empty($gateway)) { - $ifinfo['gateway'] = $gateway; - } - $gatewayv6 = $gateways->getInterfaceGateway($ifdescr, 'inet6'); - if (!empty($gatewayv6)) { - $ifinfo['gatewayv6'] = $gatewayv6; - } - } - - $bridge = link_interface_to_bridge($ifdescr); - if ($bridge) { - $bridge_text = shell_safe('/sbin/ifconfig %s', $bridge); - if (stristr($bridge_text, 'blocking') != false) { - $ifinfo['bridge'] = "" . gettext("blocking") . " - " . gettext("check for ethernet loops"); - $ifinfo['bridgeint'] = $bridge; - } elseif (stristr($bridge_text, 'learning') != false) { - $ifinfo['bridge'] = gettext("learning"); - $ifinfo['bridgeint'] = $bridge; - } elseif (stristr($bridge_text, 'forwarding') != false) { - $ifinfo['bridge'] = gettext("forwarding"); - $ifinfo['bridgeint'] = $bridge; - } - } - - $result[$ifdescr] = $ifinfo; - } - - return $result; -} - function convert_seconds_to_hms($sec) { $min = $hrs = 0; @@ -4165,126 +3951,6 @@ function convert_seconds_to_hms($sec) return $result; } -function huawei_rssi_to_string($rssi) -{ - $dbm = array(); - $i = 0; - $dbstart = -113; - while ($i < 32) { - $dbm[$i] = $dbstart + ($i * 2); - $i++; - } - $percent = round(($rssi / 31) * 100); - $string = "rssi:{$rssi} level:{$dbm[$rssi]}dBm percent:{$percent}%"; - return $string; -} - -function huawei_mode_to_string($mode, $submode) -{ - $modes[0] = "None"; - $modes[1] = "AMPS"; - $modes[2] = "CDMA"; - $modes[3] = "GSM/GPRS"; - $modes[4] = "HDR"; - $modes[5] = "WCDMA"; - $modes[6] = "GPS"; - - $submodes[0] = "No Service"; - $submodes[1] = "GSM"; - $submodes[2] = "GPRS"; - $submodes[3] = "EDGE"; - $submodes[4] = "WCDMA"; - $submodes[5] = "HSDPA"; - $submodes[6] = "HSUPA"; - $submodes[7] = "HSDPA+HSUPA"; - $submodes[8] = "TD-SCDMA"; - $submodes[9] = "HSPA+"; - $string = "{$modes[$mode]}, {$submodes[$submode]} Mode"; - return $string; -} - -function huawei_service_to_string($state) -{ - $modes[0] = "No"; - $modes[1] = "Restricted"; - $modes[2] = "Valid"; - $modes[3] = "Restricted Regional"; - $modes[4] = "Powersaving"; - $string = "{$modes[$state]} Service"; - return $string; -} - -function huawei_simstate_to_string($state) -{ - $modes[0] = "Invalid SIM/locked"; - $modes[1] = "Valid SIM"; - $modes[2] = "Invalid SIM CS"; - $modes[3] = "Invalid SIM PS"; - $modes[4] = "Invalid SIM CS/PS"; - $modes[255] = "Missing SIM"; - $string = "{$modes[$state]} State"; - return $string; -} - -function zte_rssi_to_string($rssi) -{ - return huawei_rssi_to_string($rssi); -} - -function zte_mode_to_string($mode, $submode) -{ - $modes[0] = "No Service"; - $modes[1] = "Limited Service"; - $modes[2] = "GPRS"; - $modes[3] = "GSM"; - $modes[4] = "UMTS"; - $modes[5] = "EDGE"; - $modes[6] = "HSDPA"; - - $submodes[0] = "CS_ONLY"; - $submodes[1] = "PS_ONLY"; - $submodes[2] = "CS_PS"; - $submodes[3] = "CAMPED"; - $string = "{$modes[$mode]}, {$submodes[$submode]} Mode"; - return $string; -} - -function zte_service_to_string($state) -{ - $modes[0] = "Initializing"; - $modes[1] = "Network Lock error"; - $modes[2] = "Network Locked"; - $modes[3] = "Unlocked or correct MCC/MNC"; - $string = "{$modes[$state]} Service"; - return $string; -} - -function zte_simstate_to_string($state) -{ - $modes[0] = "No action"; - $modes[1] = "Network lock"; - $modes[2] = "(U)SIM card lock"; - $modes[3] = "Network Lock and (U)SIM card Lock"; - $string = "{$modes[$state]} State"; - return $string; -} - -/* Compute the total uptime from the ppp uptime log file in the conf directory */ -function get_ppp_uptime($port) -{ - if (file_exists("/conf/{$port}.log")) { - $saved_time = file_get_contents("/conf/{$port}.log"); - $uptime_data = explode("\n", $saved_time); - $sec = 0; - foreach ($uptime_data as $upt) { - $sec += intval(substr($upt, 1 + strpos($upt, ' '))); - } - return convert_seconds_to_hms($sec); - } - - return gettext('No history data found!'); -} - /****f* legacy/is_ipaddr_configured * NAME * is_ipaddr_configured diff --git a/src/opnsense/mvc/app/models/OPNsense/Core/ACL/ACL.xml b/src/opnsense/mvc/app/models/OPNsense/Core/ACL/ACL.xml index 0b810d6a3..8a2fefad4 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Core/ACL/ACL.xml +++ b/src/opnsense/mvc/app/models/OPNsense/Core/ACL/ACL.xml @@ -497,7 +497,8 @@ Status: Interfaces - status_interfaces.php* + ui/interfaces/overview + api/interfaces/overview/* diff --git a/src/opnsense/mvc/app/models/OPNsense/Core/Menu/Menu.xml b/src/opnsense/mvc/app/models/OPNsense/Core/Menu/Menu.xml index 752822aca..cea8acaaa 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Core/Menu/Menu.xml +++ b/src/opnsense/mvc/app/models/OPNsense/Core/Menu/Menu.xml @@ -98,8 +98,7 @@ - - + diff --git a/src/opnsense/scripts/filter/list_counters.py b/src/opnsense/scripts/filter/list_counters.py deleted file mode 100755 index a2ba38015..000000000 --- a/src/opnsense/scripts/filter/list_counters.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/local/bin/python3 - -""" - Copyright (c) 2017-2019 Ad Schellevis - 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. - - -------------------------------------------------------------------------------------- - list pf byte/packet counter -""" -import tempfile -import subprocess -import os -import sys -import ujson - -if __name__ == '__main__': - result = dict() - sp = subprocess.run(['/sbin/pfctl', '-vvsI'], capture_output=True, text=True) - intf = None - for line in sp.stdout.strip().split('\n'): - if line.find('[') == -1 and len(line) > 0 and line[0] not in (' ', '\t'): - intf = line.strip() - result[intf] = {'inbytespass': 0, 'outbytespass': 0, 'inpktspass': 0, 'outpktspass': 0, - 'inbytesblock': 0, 'outbytesblock': 0, 'inpktsblock': 0, 'outpktsblock': 0, - 'inpkts':0, 'inbytes': 0, 'outpkts': 0, 'outbytes': 0} - if intf is not None and line.find('[') > -1: - packets = int(line.split(' Packets:')[-1].strip().split()[0]) - bytes = int(line.split(' Bytes:')[-1].strip().split()[0]) - if line.find('In4/Pass:') > -1 or line.find('In6/Pass:') > -1: - result[intf]['inpktspass'] += packets - result[intf]['inbytespass'] += bytes - result[intf]['inpkts'] += packets - result[intf]['inbytes'] += bytes - elif line.find('In4/Block:') > -1 or line.find('In6/Block:') > -1: - result[intf]['inbytesblock'] += packets - result[intf]['inpktsblock'] += bytes - result[intf]['inpkts'] += packets - result[intf]['inbytes'] += bytes - elif line.find('Out4/Pass:') > -1 or line.find('Out6/Pass:') > -1: - result[intf]['outpktspass'] += packets - result[intf]['outbytespass'] += bytes - result[intf]['outpkts'] += packets - result[intf]['outbytes'] += bytes - elif line.find('Out4/Block:') > -1 or line.find('Out6/Block:') > -1: - result[intf]['outpktsblock'] += packets - result[intf]['outbytesblock'] += bytes - result[intf]['outpkts'] += packets - result[intf]['outbytes'] += bytes - - # handle command line argument (type selection) - if len(sys.argv) > 1 and sys.argv[1] == 'json': - print(ujson.dumps(result)) - else: - # output plain - print('------------------------- COUNTERS -------------------------') - for intf in result: - print('[%s] %s' % (intf, result[intf])) diff --git a/src/opnsense/scripts/system/list_interrupts.py b/src/opnsense/scripts/system/list_interrupts.py deleted file mode 100755 index e5f770da7..000000000 --- a/src/opnsense/scripts/system/list_interrupts.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/local/bin/python3 - -""" - Copyright (c) 2017-2019 Ad Schellevis - 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. - - -------------------------------------------------------------------------------------- - list device interrupts stats -""" -import subprocess -import sys -import ujson - -if __name__ == '__main__': - result = dict() - sp = subprocess.run(['/usr/bin/vmstat', '-i'], capture_output=True, text=True) - intf = None - interrupts = dict() - interrupt_map = dict() - for line in sp.stdout.split("\n"): - if line.find(':') > -1: - intrp = line.split(':')[0].strip() - parts = ':'.join(line.split(':')[1:]).split() - interrupts[intrp] = {'devices': [], 'total': None, 'rate': None} - for part in parts: - if not part.isdigit(): - interrupts[intrp]['devices'].append(part) - devnm = part.split(':')[0] - if devnm not in interrupt_map: - interrupt_map[devnm] = list() - interrupt_map[devnm].append(intrp) - elif interrupts[intrp]['total'] is None: - interrupts[intrp]['total'] = int(part) - else: - interrupts[intrp]['rate'] = int(part) - result['interrupts'] = interrupts # interrupts as reported by vmstat - result['interrupt_map'] = interrupt_map # link device to interrupt - - # handle command line argument (type selection) - if len(sys.argv) > 1 and sys.argv[1] == 'json': - print(ujson.dumps(result)) - else: - # output plain - if 'interrupts' in result: - for intr in result['interrupts']: - print ('%-10s [%-20s] %-10d %d' % (intr, - ','.join(result['interrupts'][intr]['devices']), - result['interrupts'][intr]['total'], - result['interrupts'][intr]['rate'] - )) diff --git a/src/opnsense/service/conf/actions.d/actions_filter.conf b/src/opnsense/service/conf/actions.d/actions_filter.conf index 199b65938..abaa1fd68 100644 --- a/src/opnsense/service/conf/actions.d/actions_filter.conf +++ b/src/opnsense/service/conf/actions.d/actions_filter.conf @@ -53,12 +53,6 @@ parameters: %s type:script_output message:request pfsync info -[list.counters] -command:/usr/local/opnsense/scripts/filter/list_counters.py -parameters: %s -type:script_output -message:request pfctl byte/packet counters - [read.log] command:/usr/local/opnsense/scripts/filter/read_log.py parameters: /limit %s /digest %s diff --git a/src/opnsense/service/conf/actions.d/actions_system.conf b/src/opnsense/service/conf/actions.d/actions_system.conf index 36d49782e..b9f91fb6f 100644 --- a/src/opnsense/service/conf/actions.d/actions_system.conf +++ b/src/opnsense/service/conf/actions.d/actions_system.conf @@ -22,12 +22,6 @@ parameters:-m%s -f%s type:script message:clear log (%s %s) -[list.interrupts] -command:/usr/local/opnsense/scripts/system/list_interrupts.py -parameters:%s -type:script_output -message:Request vmstat interrupt counters - [sysctl] command:/usr/local/opnsense/scripts/system/sysctl.py parameters: diff --git a/src/www/status_interfaces.php b/src/www/status_interfaces.php deleted file mode 100644 index 99cfd2f40..000000000 --- a/src/www/status_interfaces.php +++ /dev/null @@ -1,521 +0,0 @@ - - * Copyright (C) 2003-2005 Manuel Kasper - * 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_once("guiconfig.inc"); -require_once("system.inc"); -require_once("interfaces.inc"); - -if ($_SERVER['REQUEST_METHOD'] === 'POST') { - if (!empty($_POST['if']) && !empty($_POST['submit'])) { - $interface = $_POST['if']; - if ($_POST['submit'] == 'remote') { - configdp_run('interface reconfigure', array($interface)); - } elseif (!empty($_POST['status']) && $_POST['status'] == 'up') { - interface_suspend($interface); - } else { - interface_configure(false, $interface, true); - } - header(url_safe('Location: /status_interfaces.php')); - exit; - } -} - -include("head.inc"); -?> - - - - - - - -
-
-
-
- $ifinfo): - if ($ifinfo['if'] == 'pfsync0') { - continue; - } - $ifpfcounters = $pfctl_counters[$ifinfo['if']]; - legacy_html_escape_form_data($ifinfo); - $ifdescr = htmlspecialchars($ifdescr); - $ifname = htmlspecialchars($ifinfo['descr']); -?> -
-
- - - - - - - - - -
- - - - (, ) - - () - - "> -
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - " data-toggle="tooltip"> - -
-
- - " /> - -    - - -    - - - -
-
-
- - -    - - -
-
-
- - -    - - -
-
-
- - -    - - -
-
-
- - - - - - - - - -
-
- " . $mac . " - " . htmlspecialchars($mac_man[$mac_hi]); print ""; } - else {print htmlspecialchars($mac);} - ?> -
- -
- - / -
- -
:
/64 -
- - / -
- -
', $ifinfo['prefixv6']) ?>
:
', $dnsall) ?>
- =
- - =
- - : - -
: - -
- :
- :
- $laggport_info): ?> - - =<> - =<> -
- -
/ - ( / ) -
/ - ( / ) -
/ - ( / ) -
- -
- - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-
- - - - -
- -
-
-
-
-
-
-
- -