本文整理汇总了PHP中interface_wireless_clone函数的典型用法代码示例。如果您正苦于以下问题:PHP interface_wireless_clone函数的具体用法?PHP interface_wireless_clone怎么用?PHP interface_wireless_clone使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了interface_wireless_clone函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
}
} while ($clone_exists);
}
if (isset($id) && $a_clones[$id]) {
if (clone_inuse($id)) {
if ($clone['if'] != $a_clones[$id]['if']) {
$input_errors[] = gettext("This wireless clone cannot be modified because it is still assigned as an interface.");
} else {
if ($clone['mode'] != $a_clones[$id]['mode']) {
$input_errors[] = gettext("Use the configuration page for the assigned interface to change the mode.");
}
}
}
}
if (!$input_errors) {
if (!interface_wireless_clone($clone['cloneif'], $clone)) {
$input_errors[] = sprintf(gettext('Error creating interface with mode %1$s. The %2$s interface may not support creating more clones with the selected mode.'), $wlan_modes[$clone['mode']], $clone['if']);
} else {
if (isset($id) && $a_clones[$id]) {
if ($clone['if'] != $a_clones[$id]['if']) {
mwexec("/sbin/ifconfig " . $a_clones[$id]['cloneif'] . " destroy");
}
$input_errors[] = sprintf(gettext("Created with id %s"), $id);
$a_clones[$id] = $clone;
} else {
$input_errors[] = gettext("Created without id");
$a_clones[] = $clone;
}
usort($a_clones, "clone_compare");
write_config();
header("Location: interfaces_wireless.php");
示例2: 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;
}
}
示例3: foreach
$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'];
if (!interface_wireless_clone("{$wlanif}_", $a_interfaces[$if])) {
$input_errors[] = sprintf(gettext("Unable to change mode to %s. You may already have the maximum number of wireless clones supported in this mode."), $wlan_modes[$a_interfaces[$if]['wireless']['mode']]);
} else {
mwexec("/sbin/ifconfig " . escapeshellarg($wlanif) . "_ destroy");
}
}
}
/* loop through keys and enforce size */
for ($i = 1; $i <= 4; $i++) {
if ($pconfig['key' . $i]) {
if (strlen($pconfig['key' . $i]) == 5) {
/* 64 bit */
continue;
} elseif (strlen($pconfig['key' . $i]) == 10) {
/* hex key */
if (stristr($pconfig['key' . $i], "0x") == false) {