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


PHP address_to_pconfig函数代码示例

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


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

示例1: address_to_pconfig

 if (isset($a_filter[$id]['ipprotocol'])) {
     $pconfig['ipprotocol'] = $a_filter[$id]['ipprotocol'];
 }
 if (isset($a_filter[$id]['protocol'])) {
     $pconfig['proto'] = $a_filter[$id]['protocol'];
 } else {
     $pconfig['proto'] = "any";
 }
 if ($a_filter[$id]['protocol'] == "icmp") {
     $pconfig['icmptype'] = $a_filter[$id]['icmptype'];
 }
 address_to_pconfig($a_filter[$id]['source'], $pconfig['src'], $pconfig['srcmask'], $pconfig['srcnot'], $pconfig['srcbeginport'], $pconfig['srcendport']);
 if ($a_filter[$id]['os'] != "") {
     $pconfig['os'] = $a_filter[$id]['os'];
 }
 address_to_pconfig($a_filter[$id]['destination'], $pconfig['dst'], $pconfig['dstmask'], $pconfig['dstnot'], $pconfig['dstbeginport'], $pconfig['dstendport']);
 if ($a_filter[$id]['dscp'] != "") {
     $pconfig['dscp'] = $a_filter[$id]['dscp'];
 }
 $pconfig['disabled'] = isset($a_filter[$id]['disabled']);
 $pconfig['log'] = isset($a_filter[$id]['log']);
 $pconfig['descr'] = $a_filter[$id]['descr'];
 if (isset($a_filter[$id]['tcpflags_any'])) {
     $pconfig['tcpflags_any'] = true;
 } else {
     if (isset($a_filter[$id]['tcpflags1']) && $a_filter[$id]['tcpflags1'] != "") {
         $pconfig['tcpflags1'] = $a_filter[$id]['tcpflags1'];
     }
     if (isset($a_filter[$id]['tcpflags2']) && $a_filter[$id]['tcpflags2'] != "") {
         $pconfig['tcpflags2'] = $a_filter[$id]['tcpflags2'];
     }
开发者ID:rohankapoorcom,项目名称:pfsense,代码行数:31,代码来源:firewall_rules_edit.php

示例2: list

    $after = $_GET['dup'];
}
if (isset($id) && $a_out[$id]) {
    if (isset($a_out[$id]['created']) && is_array($a_out[$id]['created'])) {
        $pconfig['created'] = $a_out[$id]['created'];
    }
    if (isset($a_out[$id]['updated']) && is_array($a_out[$id]['updated'])) {
        $pconfig['updated'] = $a_out[$id]['updated'];
    }
    $pconfig['protocol'] = $a_out[$id]['protocol'];
    list($pconfig['source'], $pconfig['source_subnet']) = explode('/', $a_out[$id]['source']['network']);
    if (!is_numeric($pconfig['source_subnet'])) {
        $pconfig['source_subnet'] = 32;
    }
    $pconfig['sourceport'] = $a_out[$id]['sourceport'];
    address_to_pconfig($a_out[$id]['destination'], $pconfig['destination'], $pconfig['destination_subnet'], $pconfig['destination_not'], $none, $none);
    $pconfig['dstport'] = $a_out[$id]['dstport'];
    $pconfig['natport'] = $a_out[$id]['natport'];
    $pconfig['target'] = $a_out[$id]['target'];
    $pconfig['targetip'] = $a_out[$id]['targetip'];
    $pconfig['targetip_subnet'] = $a_out[$id]['targetip_subnet'];
    $pconfig['poolopts'] = $a_out[$id]['poolopts'];
    $pconfig['interface'] = $a_out[$id]['interface'];
    if (!$pconfig['interface']) {
        $pconfig['interface'] = "wan";
    }
    $pconfig['descr'] = $a_out[$id]['descr'];
    $pconfig['nonat'] = $a_out[$id]['nonat'];
    $pconfig['disabled'] = isset($a_out[$id]['disabled']);
    $pconfig['staticnatport'] = isset($a_out[$id]['staticnatport']);
    $pconfig['nosync'] = isset($a_out[$id]['nosync']);
开发者ID:curtiszimmerman,项目名称:pfsense,代码行数:31,代码来源:firewall_nat_out_edit.php

示例3: array

        $configId = $_GET['id'];
        $id = $configId;
    }
    $pconfig = array();
    // set defaults
    $pconfig['interface'] = "wan";
    if (isset($configId)) {
        // copy 1-to-1 attributes
        foreach (array('disabled', 'interface', 'descr') as $fieldname) {
            if (isset($a_npt[$configId][$fieldname])) {
                $pconfig[$fieldname] = $a_npt[$configId][$fieldname];
            }
        }
        // load attributes with some kind of logic
        address_to_pconfig($a_npt[$configId]['source'], $pconfig['src'], $pconfig['srcmask'], $pconfig['srcnot'], $pconfig['__unused__'], $pconfig['__unused__']);
        address_to_pconfig($a_npt[$configId]['destination'], $pconfig['dst'], $pconfig['dstmask'], $pconfig['dstnot'], $pconfig['__unused__'], $pconfig['__unused__']);
    }
    // initialize empty form values
    foreach (array('disabled', 'interface', 'descr', 'src', 'srcmask', 'dst', 'dstmask', 'srcnot', 'dstnot') as $fieldname) {
        if (!isset($pconfig[$fieldname])) {
            $pconfig[$fieldname] = null;
        }
    }
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $input_errors = array();
    $pconfig = $_POST;
    if (isset($pconfig['id']) && isset($a_npt[$pconfig['id']])) {
        $id = $pconfig['id'];
    }
    if (isset($pconfig['after']) && isset($a_npt[$pconfig['after']])) {
        // place record after provided sequence number
开发者ID:karawan,项目名称:core,代码行数:31,代码来源:firewall_nat_npt_edit.php

示例4: foreach

    // set defaults
    $pconfig['interface'] = "wan";
    $pconfig['src'] = 'lan';
    $pconfig['dst'] = 'any';
    if (isset($configId)) {
        // copy settings from config
        foreach (array('disabled', 'interface', 'external', 'descr', 'natreflection') as $fieldname) {
            if (isset($a_1to1[$id][$fieldname])) {
                $pconfig[$fieldname] = $a_1to1[$id][$fieldname];
            } else {
                $pconfig[$fieldname] = null;
            }
        }
        // read settings with some kind of logic
        address_to_pconfig($a_1to1[$id]['source'], $pconfig['src'], $pconfig['srcmask'], $pconfig['srcnot'], $pconfig['__unused__'], $pconfig['__unused__']);
        address_to_pconfig($a_1to1[$id]['destination'], $pconfig['dst'], $pconfig['dstmask'], $pconfig['dstnot'], $pconfig['__unused__'], $pconfig['__unused__']);
    } else {
        // init form data on new
        foreach (array('disabled', 'interface', 'external', 'descr', 'natreflection', 'src', 'srcmask', 'srcnot', 'dst', 'dstmask', 'dstnot') as $fieldname) {
            if (!isset($pconfig[$fieldname])) {
                $pconfig[$fieldname] = null;
            }
        }
    }
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $input_errors = array();
    $pconfig = $_POST;
    // input record id, if valid
    if (isset($_POST['id']) && isset($a_1to1[$_POST['id']])) {
        $id = $_POST['id'];
    }
开发者ID:nasaa0528,项目名称:core,代码行数:31,代码来源:firewall_nat_1to1_edit.php

示例5: array

 }
 if (isset($_GET['after']) && (is_numericint($_GET['after']) || $_GET['after'] == "-1")) {
     $after = $_GET['after'];
 }
 if (isset($configId) && isset($a_nat[$configId])) {
     $pconfig = array();
     if (isset($a_nat[$configId]['created']) && is_array($a_nat[$configId]['created'])) {
         $pconfig['created'] = $a_nat[$configId]['created'];
     }
     if (isset($a_nat[$configId]['updated']) && is_array($a_nat[$configId]['updated'])) {
         $pconfig['updated'] = $a_nat[$configId]['updated'];
     }
     $pconfig['disabled'] = isset($a_nat[$configId]['disabled']);
     $pconfig['nordr'] = isset($a_nat[$configId]['nordr']);
     address_to_pconfig($a_nat[$configId]['source'], $pconfig['src'], $pconfig['srcmask'], $pconfig['srcnot'], $pconfig['srcbeginport'], $pconfig['srcendport']);
     address_to_pconfig($a_nat[$configId]['destination'], $pconfig['dst'], $pconfig['dstmask'], $pconfig['dstnot'], $pconfig['dstbeginport'], $pconfig['dstendport']);
     $pconfig['proto'] = $a_nat[$configId]['protocol'];
     $pconfig['localip'] = $a_nat[$configId]['target'];
     $pconfig['localbeginport'] = $a_nat[$configId]['local-port'];
     $pconfig['descr'] = $a_nat[$configId]['descr'];
     $pconfig['interface'] = $a_nat[$configId]['interface'];
     $pconfig['associated-rule-id'] = $a_nat[$configId]['associated-rule-id'];
     $pconfig['nosync'] = isset($a_nat[$configId]['nosync']);
     $pconfig['natreflection'] = $a_nat[$configId]['natreflection'];
     if (!$pconfig['interface']) {
         $pconfig['interface'] = "wan";
     }
 } else {
     if (isset($_GET['template']) && $_GET['template'] == 'transparant_proxy') {
         // new rule for transparant proxy reflection, to use as sample
         $pconfig['interface'] = "lan";
开发者ID:Toudix,项目名称:core,代码行数:31,代码来源:firewall_nat_edit.php


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