• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_configured_interface_list函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_configured_interface_list函数的典型用法代码示例。如果您正苦于以下问题:PHP get_configured_interface_list函数的具体用法?PHP get_configured_interface_list怎么用?PHP get_configured_interface_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_configured_interface_list函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: available_interfaces

/**
 * list available interfaces for lagg
 * @param null $selected_id selected item index
 * @return array
 */
function available_interfaces($selected_id = null)
{
    global $config;
    // configured interfaces
    $configured_interfaces = array();
    foreach (get_configured_interface_list(false, true) as $intf) {
        $configured_interfaces[] = get_real_interface($intf);
    }
    // lagg members from other lagg interfaces
    $lagg_member_interfaces = array();
    foreach ($config['laggs']['lagg'] as $lagg_idx => $lagg) {
        if ($lagg_idx == $selected_id) {
            continue;
        }
        foreach (explode(",", $lagg['members']) as $lagg_member) {
            $lagg_member_interfaces[] = get_real_interface($lagg_member);
        }
    }
    $interfaces = array();
    foreach (get_interface_list() as $intf => $intf_info) {
        if (strpos($intf, '_vlan')) {
            // skip vlans
            continue;
        } elseif (in_array($intf, $lagg_member_interfaces)) {
            // skip members of other lagg interfaces
            continue;
        } elseif (in_array($intf, $configured_interfaces)) {
            // skip configured interfaces
            continue;
        }
        $interfaces[$intf] = $intf_info;
    }
    return $interfaces;
}
开发者ID:8191,项目名称:opnsense-core,代码行数:39,代码来源:interfaces_lagg_edit.php


示例2: find_ip_interface

function find_ip_interface($ip, $bits = null)
{
    if (!is_ipaddr($ip)) {
        return false;
    }
    $isv6ip = is_ipaddrv6($ip);
    /* if list */
    $ifdescrs = get_configured_interface_list();
    foreach ($ifdescrs as $ifdescr => $ifname) {
        $ifip = $isv6ip ? get_interface_ipv6($ifname) : get_interface_ip($ifname);
        if (is_null($ifip)) {
            continue;
        }
        if (is_null($bits)) {
            if ($ip == $ifip) {
                $int = get_real_interface($ifname);
                return $int;
            }
        } else {
            if (ip_in_subnet($ifip, $ip . "/" . $bits)) {
                $int = get_real_interface($ifname);
                return $int;
            }
        }
    }
    return false;
}
开发者ID:noikiy,项目名称:core-2,代码行数:27,代码来源:wizard.php


示例3: qinq_inuse

function qinq_inuse($num)
{
    global $config, $a_qinqs;
    $iflist = get_configured_interface_list(false, true);
    foreach ($iflist as $if) {
        if ($config['interfaces'][$if]['if'] == $a_qinqs[$num]['qinqif']) {
            return true;
        }
    }
    return false;
}
开发者ID:heper,项目名称:pfsense,代码行数:11,代码来源:interfaces_qinq.php


示例4: clone_inuse

function clone_inuse($cloneif)
{
    global $config;
    $iflist = get_configured_interface_list(false, true);
    foreach ($iflist as $if) {
        if ($config['interfaces'][$if]['if'] == $cloneif) {
            return true;
        }
    }
    return false;
}
开发者ID:8191,项目名称:opnsense-core,代码行数:11,代码来源:interfaces_wireless.php


示例5: ppp_inuse

function ppp_inuse($num)
{
    global $config, $g;
    $iflist = get_configured_interface_list(false, true);
    if (!is_array($config['ppps']['ppp'])) {
        return false;
    }
    foreach ($iflist as $if) {
        if ($config['interfaces'][$if]['if'] == $config['ppps']['ppp'][$num]['if']) {
            return true;
        }
    }
    return false;
}
开发者ID:hexaclock,项目名称:pfsense,代码行数:14,代码来源:interfaces_ppps.php


示例6: lagg_inuse

function lagg_inuse($num)
{
    global $config, $a_laggs;
    $iflist = get_configured_interface_list(false, true);
    foreach ($iflist as $if) {
        if ($config['interfaces'][$if]['if'] == $a_laggs[$num]['laggif']) {
            return true;
        }
    }
    if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) {
        foreach ($config['vlans']['vlan'] as $vlan) {
            if ($vlan['if'] == $a_laggs[$num]['laggif']) {
                return true;
            }
        }
    }
    return false;
}
开发者ID:mtisza,项目名称:pfsense,代码行数:18,代码来源:interfaces_lagg.php


示例7: lagg_inuse

function lagg_inuse($lagg_intf)
{
    global $config;
    $iflist = get_configured_interface_list(false, true);
    foreach ($iflist as $if) {
        if ($config['interfaces'][$if]['if'] == $lagg_intf) {
            return true;
        }
    }
    if (isset($config['vlans']['vlan'])) {
        foreach ($config['vlans']['vlan'] as $vlan) {
            if ($vlan['if'] == $lagg_intf) {
                return true;
            }
        }
    }
    return false;
}
开发者ID:8191,项目名称:opnsense-core,代码行数:18,代码来源:interfaces_lagg.php


示例8: gettext

}
if (!$pconfig['timeservers']) {
    $pconfig['timeservers'] = "pool.ntp.org";
}
$changedesc = gettext("System") . ": ";
$changecount = 0;
function is_timezone($elt)
{
    return !preg_match("/\\/\$/", $elt);
}
if ($pconfig['timezone'] != $_POST['timezone']) {
    filter_pflog_start(true);
}
$timezonelist = system_get_timezone_list();
$multiwan = false;
$interfaces = get_configured_interface_list();
foreach ($interfaces as $interface) {
    if (interface_has_gateway($interface)) {
        $multiwan = true;
    }
}
if ($_POST) {
    $changecount++;
    unset($input_errors);
    $pconfig = $_POST;
    /* input validation */
    $reqdfields = explode(" ", "hostname domain");
    $reqdfieldsn = array(gettext("Hostname"), gettext("Domain"));
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
    if ($_POST['webguicss']) {
        $config['system']['webgui']['webguicss'] = $_POST['webguicss'];
开发者ID:LFCavalcanti,项目名称:pfsense,代码行数:31,代码来源:system.php


示例9: restore_rrddata

 if ($config['rrddata']) {
     restore_rrddata();
     unset($config['rrddata']);
     unlink_if_exists("{$g['tmp_path']}/config.cache");
     write_config();
     add_base_packages_menu_items();
     convert_config();
     conf_mount_ro();
 }
 if ($m0n0wall_upgrade == true) {
     if ($config['system']['gateway'] != "") {
         $config['interfaces']['wan']['gateway'] = $config['system']['gateway'];
     }
     unset($config['shaper']);
     /* optional if list */
     $ifdescrs = get_configured_interface_list(true, true);
     /* remove special characters from interface descriptions */
     if (is_array($ifdescrs)) {
         foreach ($ifdescrs as $iface) {
             $config['interfaces'][$iface]['descr'] = remove_bad_chars($config['interfaces'][$iface]['descr']);
         }
     }
     /* check for interface names with an alias */
     if (is_array($ifdescrs)) {
         foreach ($ifdescrs as $iface) {
             if (is_alias($config['interfaces'][$iface]['descr'])) {
                 // Firewall rules
                 $origname = $config['interfaces'][$iface]['descr'];
                 $newname = $config['interfaces'][$iface]['descr'] . "Alias";
                 update_alias_names_upon_change(array('filter', 'rule'), array('source', 'address'), $newname, $origname);
                 update_alias_names_upon_change(array('filter', 'rule'), array('destination', 'address'), $newname, $origname);
开发者ID:jdillard,项目名称:pfsense,代码行数:31,代码来源:diag_backup.php


示例10: array

require_once "shaper.inc";
$pgtitle = array(gettext("Firewall"), gettext("Aliases"), gettext("Edit"));
if (isset($_POST['referer'])) {
    $referer = $_POST['referer'];
} else {
    $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/firewall_aliases.php';
}
// Keywords not allowed in names
$reserved_keywords = array("all", "pass", "block", "out", "queue", "max", "min", "pptp", "pppoe", "L2TP", "OpenVPN", "IPsec");
// Add all Load balance names to reserved_keywords
if (is_array($config['load_balancer']['lbpool'])) {
    foreach ($config['load_balancer']['lbpool'] as $lbpool) {
        $reserved_keywords[] = $lbpool['name'];
    }
}
$reserved_ifs = get_configured_interface_list(false, true);
$reserved_keywords = array_merge($reserved_keywords, $reserved_ifs, $reserved_table_names);
$max_alias_addresses = 5000;
if (!is_array($config['aliases']['alias'])) {
    $config['aliases']['alias'] = array();
}
$a_aliases =& $config['aliases']['alias'];
$tab = $_REQUEST['tab'];
if ($_POST) {
    $origname = $_POST['origname'];
}
// Debugging
if ($debug) {
    unlink_if_exists("{$g['tmp_path']}/alias_rename_log.txt");
}
function alias_same_type($name, $type)
开发者ID:jefersonJim,项目名称:pfsense,代码行数:31,代码来源:firewall_aliases_edit.php


示例11: get_interfacestats

function get_interfacestats()
{
    global $config;
    //build interface list for widget use
    $ifdescrs = get_configured_interface_list();
    $array_in_packets = array();
    $array_out_packets = array();
    $array_in_bytes = array();
    $array_out_bytes = array();
    $array_in_errors = array();
    $array_out_errors = array();
    $array_collisions = array();
    $array_interrupt = array();
    $new_data = "";
    //build data arrays
    foreach ($ifdescrs as $ifdescr => $ifname) {
        $ifinfo = get_interface_info($ifdescr);
        $new_data .= "{$ifinfo['inpkts']},";
        $new_data .= "{$ifinfo['outpkts']},";
        $new_data .= format_bytes($ifinfo['inbytes']) . ",";
        $new_data .= format_bytes($ifinfo['outbytes']) . ",";
        if (isset($ifinfo['inerrs'])) {
            $new_data .= "{$ifinfo['inerrs']},";
            $new_data .= "{$ifinfo['outerrs']},";
        } else {
            $new_data .= "0,";
            $new_data .= "0,";
        }
        if (isset($ifinfo['collisions'])) {
            $new_data .= htmlspecialchars($ifinfo['collisions']) . ",";
        } else {
            $new_data .= "0,";
        }
    }
    //end for
    return $new_data;
}
开发者ID:OptimWIFI,项目名称:pfsense,代码行数:37,代码来源:functions.inc.php


示例12: strftime

    $graphcmd .= "GPRINT:\"{$curif}-out6_bits_block:MAX:%7.2lf %sb/s\" ";
    $graphcmd .= "GPRINT:\"{$curif}-out6_bits_block:AVERAGE:%7.2lf %Sb/s\" ";
    $graphcmd .= "GPRINT:\"{$curif}-out6_bits_block:LAST:%7.2lf %Sb/s\" ";
    $graphcmd .= "GPRINT:\"{$curif}-bytes_out6_t_block:AVERAGE:%7.2lf %sB o\" ";
    $graphcmd .= "COMMENT:\"\\n\" ";
    $graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t" . strftime('%b %d %H\\:%M\\:%S %Y') . "\" ";
} elseif (strstr($curdatabase, "-throughput.rrd")) {
    /* define graphcmd for throughput stats */
    /* this gathers all interface statistics, the database does not actually exist */
    $graphcmd = "{$rrdtool} graph " . escapeshellarg("{$rrdtmppath}{$curdatabase}-{$curgraph}.png") . " ";
    $graphcmd .= "--start {$start} --end {$end} --step {$step} ";
    $graphcmd .= "--vertical-label \"bits/sec\" ";
    $graphcmd .= "--color SHADEA#eeeeee --color SHADEB#eeeeee ";
    $graphcmd .= "--title \"" . php_uname('n') . " - {$prettydb} - {$hperiod} - {$havg} average\" ";
    $graphcmd .= "--height 200 --width 620 ";
    $iflist = get_configured_interface_list();
    $g = 0;
    $operand = "";
    $comma = "";
    $graphtputbip = "";
    $graphtputbop = "";
    $graphtputbtp = "";
    $graphtputbib = "";
    $graphtputbob = "";
    $graphtputbtb = "";
    $graphtputbyip = "";
    $graphtputbyop = "";
    $graphtputbytp = "";
    $graphtputbyib = "";
    $graphtputbyob = "";
    $graphtputbytb = "";
开发者ID:nwholloway,项目名称:pfsense,代码行数:31,代码来源:status_rrd_graph_img.php


示例13: get_interface_list

$portlist = get_interface_list();
$laggprotos = array("none", "lacp", "failover", "fec", "loadbalance", "roundrobin");
$laggprotosuc = array(gettext("NONE"), gettext("LACP"), gettext("FAILOVER"), gettext("FEC"), gettext("LOADBALANCE"), gettext("ROUNDROBIN"));
$protohelp = '<ul>' . '<li>' . '<strong>' . $laggprotosuc[0] . '</strong><br />' . gettext('This protocol is intended to do nothing: it disables any ' . 'traffic without disabling the lagg interface itself.') . '</li>' . '<li>' . '<strong>' . $laggprotosuc[1] . '</strong><br />' . gettext('Supports the IEEE 802.3ad Link Aggregation Control Protocol ' . '(LACP) and the Marker Protocol.	LACP will negotiate a set ' . 'of aggregable links with the peer in to one or more Link ' . 'Aggregated Groups.  Each LAG is composed of ports of the ' . 'same speed, set to full-duplex operation.  The traffic will ' . 'be balanced across the ports in the LAG with the greatest ' . 'total speed, in most cases there will only be one LAG which ' . 'contains all ports.	In the event of changes in physical ' . 'connectivity, Link Aggregation will quickly converge to a ' . 'new configuration.') . '</li>' . '<li>' . '<strong>' . $laggprotosuc[2] . '</strong><br />' . gettext('Sends and receives traffic only through the master port.  If ' . 'the master port becomes unavailable, the next active port is ' . 'used.	The first interface added is the master port; any ' . 'interfaces added after that are used as failover devices.') . '</li>' . '<li>' . '<strong>' . $laggprotosuc[3] . '</strong><br />' . gettext('Supports Cisco EtherChannel.  This is a static setup and ' . 'does not negotiate aggregation with the peer or exchange ' . 'frames to monitor the link.') . '</li>' . '<li>' . '<strong>' . $laggprotosuc[4] . '</strong><br />' . gettext('Balances outgoing traffic across the active ports based on ' . 'hashed protocol header information and accepts incoming ' . 'traffic from any active port.	 This is a static setup and ' . 'does not negotiate aggregation with the peer or exchange ' . 'frames to monitor the link.  The hash includes the Ethernet ' . 'source and destination address, and, if available, the VLAN ' . 'tag, and the IP source and destination address.') . '</li>' . '<li>' . '<strong>' . $laggprotosuc[5] . '</strong><br />' . gettext('Distributes outgoing traffic using a round-robin scheduler ' . 'through all active ports and accepts incoming traffic from ' . 'any active port.') . '</li>' . '</ul>';
$realifchecklist = array();
/* add LAGG interfaces */
if (is_array($config['laggs']['lagg']) && count($config['laggs']['lagg'])) {
    foreach ($config['laggs']['lagg'] as $lagg) {
        unset($portlist[$lagg['laggif']]);
        $laggiflist = explode(",", $lagg['members']);
        foreach ($laggiflist as $tmpif) {
            $realifchecklist[get_real_interface($tmpif)] = $tmpif;
        }
    }
}
$checklist = get_configured_interface_list(false, true);
foreach ($checklist as $tmpif) {
    $realifchecklist[get_real_interface($tmpif)] = $tmpif;
}
if (is_numericint($_GET['id'])) {
    $id = $_GET['id'];
}
if (isset($_POST['id']) && is_numericint($_POST['id'])) {
    $id = $_POST['id'];
}
if (isset($id) && $a_laggs[$id]) {
    $pconfig['laggif'] = $a_laggs[$id]['laggif'];
    $pconfig['members'] = $a_laggs[$id]['members'];
    $laggiflist = explode(",", $a_laggs[$id]['members']);
    foreach ($laggiflist as $tmpif) {
        unset($realifchecklist[get_real_interface($tmpif)]);
开发者ID:KyleJohnstonNet,项目名称:pfsense,代码行数:31,代码来源:interfaces_lagg_edit.php


示例14: gettext

    $pconfig['name'] = "dnsmasq";
    $pconfig['description'] = gettext("DNS Forwarder");
    $services[] = $pconfig;
}
$pconfig = array();
$pconfig['name'] = "ntpd";
$pconfig['description'] = gettext("NTP clock sync");
$services[] = $pconfig;
if (isset($config['captiveportal']['enable'])) {
    $pconfig = array();
    $pconfig['name'] = "captiveportal";
    $pconfig['description'] = gettext("Captive Portal");
    $services[] = $pconfig;
}
$iflist = array();
$ifdescrs = get_configured_interface_list();
foreach ($ifdescrs as $if) {
    $oc = $config['interfaces'][$if];
    if ($oc['if'] && !link_interface_to_bridge($if)) {
        $iflist[$if] = $if;
    }
}
$show_dhcprelay = false;
foreach ($iflist as $if) {
    if (isset($config['dhcrelay'][$if]['enable'])) {
        $show_dhcprelay = true;
    }
}
if ($show_dhcprelay == true) {
    $pconfig = array();
    $pconfig['name'] = "dhcrelay";
开发者ID:rdmenezes,项目名称:pfsense,代码行数:31,代码来源:status_services.php



注:本文中的get_configured_interface_list函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_configured_interface_with_descr函数代码示例发布时间:2022-05-15
下一篇:
PHP get_configured_carp_interface_list函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap