本文整理汇总了PHP中gen_subnetv6_max函数的典型用法代码示例。如果您正苦于以下问题:PHP gen_subnetv6_max函数的具体用法?PHP gen_subnetv6_max怎么用?PHP gen_subnetv6_max使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了gen_subnetv6_max函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_configured_interface_with_descr
}
$natiflist = get_configured_interface_with_descr();
foreach ($natiflist as $natif => $natdescr) {
if ($_POST['interface'] == $natif && (empty($config['interfaces'][$natif]['ipaddr']) && empty($config['interfaces'][$natif]['ipaddrv6']))) {
$input_errors[] = gettext("The interface chosen for the VIP has no IPv4 or IPv6 address configured so it cannot be used as a parent for the VIP.");
}
}
/* ipalias and carp should not use network or broadcast address */
if ($_POST['mode'] == "ipalias" || $_POST['mode'] == "carp") {
if (is_ipaddrv4($_POST['subnet']) && $_POST['subnet_bits'] != "32") {
$network_addr = gen_subnet($_POST['subnet'], $_POST['subnet_bits']);
$broadcast_addr = gen_subnet_max($_POST['subnet'], $_POST['subnet_bits']);
} else {
if (is_ipaddrv6($_POST['subnet']) && $_POST['subnet_bits'] != "128") {
$network_addr = gen_subnetv6($_POST['subnet'], $_POST['subnet_bits']);
$broadcast_addr = gen_subnetv6_max($_POST['subnet'], $_POST['subnet_bits']);
}
}
if (isset($network_addr) && $_POST['subnet'] == $network_addr) {
$input_errors[] = gettext("You cannot use the network address for this VIP");
} else {
if (isset($broadcast_addr) && $_POST['subnet'] == $broadcast_addr) {
$input_errors[] = gettext("You cannot use the broadcast address for this VIP");
}
}
}
/* make sure new ip is within the subnet of a valid ip
* on one of our interfaces (wan, lan optX)
*/
switch ($_POST['mode']) {
case 'carp':
开发者ID:toshisam,项目名称:pfsense,代码行数:31,代码来源:firewall_virtual_ip_edit.php
示例2: print_info_box
print_info_box(gettext("The DHCPv6 Server can only be enabled on interfaces configured with a static IPv6 address. This system has none."), 'danger');
include "foot.inc";
exit;
}
$tab_array = array();
$tab_array[] = array(gettext("DHCPv6 Server"), true, "services_dhcpv6.php?if={$if}");
$tab_array[] = array(gettext("Router Advertisements"), false, "services_router_advertisements.php?if={$if}");
display_top_tabs($tab_array);
require_once 'classes/Form.class.php';
$form = new Form(new Form_Button('Submit', 'Save'));
$section = new Form_Section('DHCPv6 Options');
$section->addInput(new Form_Checkbox('enable', 'DHCPv6 Server', 'Enable DHCPv6 server on interface ' . $iflist[$if], $pconfig['enable']))->toggles('.form-group:not(:first-child)');
if (is_ipaddrv6($ifcfgip)) {
$section->addInput(new Form_StaticText('Subnet', gen_subnetv6($ifcfgip, $ifcfgsn)));
$section->addInput(new Form_StaticText('Subnet Mask', $ifcfgsn . ' bits'));
$section->addInput(new Form_StaticText('Available Range', $range_from = gen_subnetv6($ifcfgip, $ifcfgsn) . ' to ' . gen_subnetv6_max($ifcfgip, $ifcfgsn)));
}
if ($is_olsr_enabled) {
$section->addInput(new Form_Select('netmask', 'Subnetmask', $pconfig['netmask'], array_combine(range(128, 1, -1), range(128, 1, -1))));
}
$f1 = new Form_Input('range_from', null, 'text', $pconfig['range_from']);
$f1->setHelp('To');
$f2 = new Form_Input('range_to', null, 'text', $pconfig['range_to']);
$f2->setHelp('From');
$group = new Form_Group('Range');
$group->add($f1);
$group->add($f2);
$section->add($group);
$f1 = new Form_Input('prefix_from', null, 'text', $pconfig['prefix_from']);
$f1->setHelp('To');
$f2 = new Form_Input('prefix_to', null, 'text', $pconfig['prefix_to']);
开发者ID:dariomas,项目名称:pfsense,代码行数:31,代码来源:services_dhcpv6.php
示例3: get_configured_interface_with_descr
}
$natiflist = get_configured_interface_with_descr();
foreach ($natiflist as $natif => $natdescr) {
if ($pconfig['interface'] == $natif && (empty($config['interfaces'][$natif]['ipaddr']) && empty($config['interfaces'][$natif]['ipaddrv6']))) {
$input_errors[] = gettext("The interface chosen for the VIP has no IPv4 or IPv6 address configured so it cannot be used as a parent for the VIP.");
}
}
/* ipalias and carp should not use network or broadcast address */
if ($pconfig['mode'] == "ipalias" || $pconfig['mode'] == "carp") {
if (is_ipaddrv4($pconfig['subnet']) && $pconfig['subnet_bits'] != "32") {
$network_addr = gen_subnet($pconfig['subnet'], $pconfig['subnet_bits']);
$broadcast_addr = gen_subnet_max($pconfig['subnet'], $pconfig['subnet_bits']);
} else {
if (is_ipaddrv6($pconfig['subnet']) && $_POST['subnet_bits'] != "128") {
$network_addr = gen_subnetv6($pconfig['subnet'], $pconfig['subnet_bits']);
$broadcast_addr = gen_subnetv6_max($pconfig['subnet'], $pconfig['subnet_bits']);
}
}
if (isset($network_addr) && $pconfig['subnet'] == $network_addr) {
$input_errors[] = gettext("You cannot use the network address for this VIP");
} else {
if (isset($broadcast_addr) && $pconfig['subnet'] == $broadcast_addr) {
$input_errors[] = gettext("You cannot use the broadcast address for this VIP");
}
}
}
/* make sure new ip is within the subnet of a valid ip
* on one of our interfaces (wan, lan optX)
*/
if ($pconfig['mode'] == 'carp') {
/* verify against reusage of vhids */
开发者ID:8191,项目名称:opnsense-core,代码行数:31,代码来源:firewall_virtual_ip_edit.php
示例4: gettext
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq"><?php
echo gettext("Available range");
?>
</td>
<td width="78%" class="vtable">
<?php
$range_from = gen_subnetv6($ifcfgip, $ifcfgsn);
$range_from++;
echo $range_from;
?>
-
<?php
$range_to = gen_subnetv6_max($ifcfgip, $ifcfgsn);
echo $range_to;
?>
</td>
</tr>
<?php
}
?>
<?php
if ($is_olsr_enabled) {
?>
<tr>
<td width="22%" valign="top" class="vncellreq"><?php
echo gettext("Subnet Mask");
?>
开发者ID:paudam,项目名称:opnsense-core,代码行数:31,代码来源:services_dhcpv6.php
示例5: Form
if ($dhcrelay_enabled) {
include "foot.inc";
exit;
}
$form = new Form();
$section = new Form_Section('DHCPv6 Options');
$section->addInput(new Form_Checkbox('enable', 'DHCPv6 Server', 'Enable DHCPv6 server on interface ' . $iflist[$if], $pconfig['enable']));
if (is_ipaddrv6($ifcfgip)) {
if ($ifcfgip == "::") {
$sntext = "Prefix Delegation";
} else {
$sntext = gen_subnetv6($ifcfgip, $ifcfgsn);
}
$section->addInput(new Form_StaticText('Subnet', $sntext));
$section->addInput(new Form_StaticText('Subnet Mask', $ifcfgsn . ' bits'));
$section->addInput(new Form_StaticText('Available Range', $range_from = gen_subnetv6($ifcfgip, $ifcfgsn) . ' to ' . gen_subnetv6_max($ifcfgip, $ifcfgsn)))->setHelp($trackifname ? 'Prefix Delegation subnet will be appended to the beginning of the defined range' : '');
}
if ($is_olsr_enabled) {
$section->addInput(new Form_Select('netmask', 'Subnet Mask', $pconfig['netmask'], array_combine(range(128, 1, -1), range(128, 1, -1))));
}
$f1 = new Form_Input('range_from', null, 'text', $pconfig['range_from']);
$f1->setHelp('From');
$f2 = new Form_Input('range_to', null, 'text', $pconfig['range_to']);
$f2->setHelp('To');
$group = new Form_Group('Range');
$group->add($f1);
$group->add($f2);
$section->add($group);
$f1 = new Form_Input('prefixrange_from', null, 'text', $pconfig['prefixrange_from']);
$f1->setHelp('From');
$f2 = new Form_Input('prefixrange_to', null, 'text', $pconfig['prefixrange_to']);
开发者ID:NewEraCracker,项目名称:pfsense,代码行数:31,代码来源:services_dhcpv6.php
注:本文中的gen_subnetv6_max函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论