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


PHP pfSense_ipfw_getTablestats函数代码示例

本文整理汇总了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";
开发者ID:OptimWIFI,项目名称:pfsense,代码行数:31,代码来源:services_captiveportal_ip.php

示例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;
    }
开发者ID:sjourdois,项目名称:pfsense,代码行数:31,代码来源:services_captiveportal_hostname.php

示例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");
开发者ID:OptimWIFI,项目名称:pfsense,代码行数:31,代码来源:services_captiveportal_ip_edit.php


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