当前位置: 首页>>代码示例>>PHP>>正文


PHP interface_get_wireless_clone函数代码示例

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


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

示例1: check_wireless_mode

function check_wireless_mode()
{
    global $_POST, $config, $g, $wlan_modes, $wancfg, $if, $wlanif, $wlanbaseif, $old_wireless_mode, $input_errors;
    if ($wancfg['wireless']['mode'] == $_POST['mode']) {
        return;
    }
    if (does_interface_exist(interface_get_wireless_clone($wlanbaseif))) {
        $clone_count = 1;
    } else {
        $clone_count = 0;
    }
    if (isset($config['wireless']['clone']) && is_array($config['wireless']['clone'])) {
        foreach ($config['wireless']['clone'] as $clone) {
            if ($clone['if'] == $wlanbaseif) {
                $clone_count++;
            }
        }
    }
    if ($clone_count > 1) {
        $old_wireless_mode = $wancfg['wireless']['mode'];
        $wancfg['wireless']['mode'] = $_POST['mode'];
        if (!interface_wireless_clone("{$wlanif}_", $wancfg)) {
            $input_errors[] = sprintf(gettext("Unable to change mode to %s.\t You may already have the maximum number of wireless clones supported in this mode."), $wlan_modes[$wancfg['wireless']['mode']]);
        } else {
            mwexec("/sbin/ifconfig " . escapeshellarg($wlanif) . "_ destroy");
        }
        $wancfg['wireless']['mode'] = $old_wireless_mode;
    }
}
开发者ID:simudream,项目名称:pfsense,代码行数:29,代码来源:interfaces.php

示例2: array

 }
 /*
   Wireless interface
 */
 if (isset($a_interfaces[$if]['wireless'])) {
     $reqdfields = array("mode");
     $reqdfieldsn = array(gettext("Mode"));
     if ($pconfig['mode'] == 'hostap') {
         $reqdfields[] = "ssid";
         $reqdfieldsn[] = gettext("SSID");
     }
     do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors);
     // check_wireless_mode (more wireless weirness)
     // validations shouldn't perform actual actions, needs serious fixing at some point
     if ($a_interfaces[$if]['wireless']['mode'] != $pconfig['mode']) {
         if (does_interface_exist(interface_get_wireless_clone($wlanbaseif))) {
             $clone_count = 1;
         } else {
             $clone_count = 0;
         }
         if (isset($config['wireless']['clone']) && is_array($config['wireless']['clone'])) {
             foreach ($config['wireless']['clone'] as $clone) {
                 if ($clone['if'] == $wlanbaseif) {
                     $clone_count++;
                 }
             }
         }
         if ($clone_count > 1) {
             $wlanif = get_real_interface($if);
             $old_wireless_mode = $a_interfaces[$if]['wireless']['mode'];
             $a_interfaces[$if]['wireless']['mode'] = $pconfig['mode'];
开发者ID:paudam,项目名称:opnsense-core,代码行数:31,代码来源:interfaces.php


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