本文整理汇总了PHP中pfSense_ipfw_getTablestats函数的典型用法代码示例。如果您正苦于以下问题:PHP pfSense_ipfw_getTablestats函数的具体用法?PHP pfSense_ipfw_getTablestats怎么用?PHP pfSense_ipfw_getTablestats使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pfSense_ipfw_getTablestats函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
header("Location: services_captiveportal_zones.php");
exit;
}
if (!is_array($config['captiveportal'])) {
$config['captiveportal'] = array();
}
$a_cp =& $config['captiveportal'];
$pgtitle = array(gettext("Services"), gettext("Captive portal"), $a_cp[$cpzone]['zone']);
$shortcut_section = "captiveportal";
if ($_GET['act'] == "del") {
$a_allowedips =& $config['captiveportal'][$cpzone]['allowedip'];
if ($a_allowedips[$_GET['id']]) {
$ipent = $a_allowedips[$_GET['id']];
if (isset($config['captiveportal'][$cpzone]['enable'])) {
$mask = !empty($ipent['sn']) ? $ipent['sn'] : 32;
$ipfw = pfSense_ipfw_getTablestats($cpzone, 3, $ipent['ip'], $mask);
pfSense_ipfw_Tableaction($cpzone, IP_FW_TABLE_XDEL, 3, $ipent['ip'], $mask);
pfSense_ipfw_Tableaction($cpzone, IP_FW_TABLE_XDEL, 4, $ipent['ip'], $mask);
if (is_array($ipfw)) {
captiveportal_free_dn_ruleno($ipfw['dnpipe']);
pfSense_pipe_action("pipe delete {$ipfw['dnpipe']}");
pfSense_pipe_action("pipe delete " . ($ipfw['dnpipe'] + 1));
}
}
unset($a_allowedips[$_GET['id']]);
write_config();
header("Location: services_captiveportal_ip.php?zone={$cpzone}");
exit;
}
}
include "head.inc";
示例2: array
}
$pgtitle = array(gettext("Services"), gettext("Captive Portal"), "Zone " . $a_cp[$cpzone]['zone'], gettext("Allowed Hostnames"));
$shortcut_section = "captiveportal";
if ($_GET['act'] == "del" && !empty($cpzone) && isset($cpzoneid)) {
$a_allowedhostnames =& $a_cp[$cpzone]['allowedhostname'];
if ($a_allowedhostnames[$_GET['id']]) {
$ipent = $a_allowedhostnames[$_GET['id']];
if (isset($a_cp[$cpzone]['enable'])) {
if (is_ipaddr($ipent['hostname'])) {
$ip = $ipent['hostname'];
} else {
$ip = gethostbyname($ipent['hostname']);
}
$sn = is_ipaddrv6($ip) ? 128 : 32;
if (is_ipaddr($ip)) {
$ipfw = pfSense_ipfw_getTablestats($cpzoneid, IP_FW_TABLE_XLISTENTRY, 3, $ip);
if (is_array($ipfw)) {
captiveportal_free_dn_ruleno($ipfw['dnpipe']);
pfSense_pipe_action("pipe delete {$ipfw['dnpipe']}");
pfSense_pipe_action("pipe delete " . ($ipfw['dnpipe'] + 1));
}
pfSense_ipfw_Tableaction($cpzoneid, IP_FW_TABLE_XDEL, 3, $ip, $sn);
pfSense_ipfw_Tableaction($cpzoneid, IP_FW_TABLE_XDEL, 4, $ip, $sn);
}
}
unset($a_allowedhostnames[$_GET['id']]);
write_config();
captiveportal_allowedhostname_configure();
header("Location: services_captiveportal_hostname.php?zone={$cpzone}");
exit;
}
示例3: allowedips_sort
$oldmask = $a_allowedips[$id]['sn'];
} else {
$oldmask = 32;
}
$a_allowedips[$id] = $ip;
} else {
$a_allowedips[] = $ip;
}
allowedips_sort();
write_config();
if (isset($a_cp[$cpzone]['enable']) && is_module_loaded("ipfw.ko")) {
$rules = "";
$cpzoneid = $a_cp[$cpzone]['zoneid'];
unset($ipfw);
if (isset($oldip) && isset($oldmask)) {
$ipfw = pfSense_ipfw_getTablestats($cpzoneid, 3, $oldip, $oldmask);
$rules .= "table 3 delete {$oldip}/{$oldmask}\n";
$rules .= "table 4 delete {$oldip}/{$oldmask}\n";
if (is_array($ipfw)) {
$rules .= "pipe delete {$ipfw['dnpipe']}\n";
$rules .= "pipe delete " . ($ipfw['dnpipe'] + 1 . "\n");
}
}
$rules .= captiveportal_allowedip_configure_entry($ip);
if (is_array($ipfw)) {
captiveportal_free_dn_ruleno($ipfw['dnpipe']);
}
$uniqid = uniqid("{$cpzone}_allowed");
@file_put_contents("{$g['tmp_path']}/{$uniqid}_tmp", $rules);
mwexec("/sbin/ipfw -x {$cpzoneid} -q {$g['tmp_path']}/{$uniqid}_tmp");
@unlink("{$g['tmp_path']}/{$uniqid}_tmp");