• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_carp_interface_status函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: foreach

		</tr>
	</thead>
	<tbody>
<?php 
if (is_array($config['virtualip']['vip'])) {
    $carpint = 0;
    foreach ($config['virtualip']['vip'] as $carp) {
        if ($carp['mode'] != "carp") {
            continue;
        }
        $ipaddress = $carp['subnet'];
        $password = $carp['password'];
        $netmask = $carp['subnet_bits'];
        $vhid = $carp['vhid'];
        $advskew = $carp['advskew'];
        $status = get_carp_interface_status("_vip{$carp['uniqid']}");
        ?>
		<tr>
			<td>
				<a href="/system_hasync.php">
					<?php 
        echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($carp['interface']) . "@{$vhid}");
        ?>
				</a>
			</td>
<?php 
        if ($carp_enabled == false) {
            $icon = 'times-circle';
            $status = "DISABLED";
        } else {
            if ($status == "MASTER") {
开发者ID:LFCavalcanti,项目名称:pfsense,代码行数:31,代码来源:carp_status.widget.php


示例2: get_carp_status

$carp_enabled = get_carp_status();
?>
<table bgcolor="#990000" width="100%" border="0" cellspacing="0" cellpadding="0" summary="carp status">
<?php 
if (is_array($config['virtualip']['vip'])) {
    $carpint = 0;
    foreach ($config['virtualip']['vip'] as $carp) {
        if ($carp['mode'] != "carp") {
            continue;
        }
        $ipaddress = $carp['subnet'];
        $password = $carp['password'];
        $netmask = $carp['subnet_bits'];
        $vhid = $carp['vhid'];
        $advskew = $carp['advskew'];
        $status = get_carp_interface_status("{$carp['interface']}_vip{$vhid}");
        ?>
<tr>
	<td class="vncellt" width="35%">
		<img src="./themes/<?php 
        echo $g['theme'];
        ?>
/images/icons/icon_cablenic.gif" alt="cablenic" />&nbsp;
		<strong><a href="/system_hasync.php">
		<span style="color:#000000"><?php 
        echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($carp['interface']) . "@{$vhid}");
        ?>
</span></a></strong>
	</td>
	<td width="65%"  class="listr">
<?php 
开发者ID:mtisza,项目名称:pfsense,代码行数:31,代码来源:carp_status.widget.php


示例3: gettext

if ($carpcount == 0) {
    ?>
                <tr>
                  <td colspan="3"><?php 
    echo gettext("Could not locate any defined CARP interfaces.");
    ?>
</td>
                </tr>
<?php 
} else {
    foreach ($a_vip as $carp) {
        if ($carp['mode'] != "carp") {
            continue;
        }
        $icon = "";
        $intf_status = get_carp_interface_status("{$carp['interface']}_vip{$carp['vhid']}");
        if ($carpcount > 0 && $status) {
            $icon = "glyphicon glyphicon-remove text-danger";
            $intf_status = "DISABLED";
        } elseif ($intf_status == "MASTER") {
            $icon = "glyphicon glyphicon-play text-success";
        } elseif ($intf_status == "BACKUP") {
            $icon = "glyphicon glyphicon-play text-muted";
        } elseif ($intf_status == "INIT") {
            $icon = "glyphicon glyphicon-info-sign";
        }
        ?>
                <tr>
                  <td><?php 
        echo convert_friendly_interface_to_friendly_descr($carp['interface']) . "@{$carp['vhid']}";
        ?>
开发者ID:8191,项目名称:opnsense-core,代码行数:31,代码来源:carp_status.php


示例4: get_carp_stats

function get_carp_stats()
{
    global $g;
    global $config;
    if (is_array($config['virtualip']['vip'])) {
        $carpint = 0;
        $initcount = 0;
        $mastercount = 0;
        $backupcount = 0;
        foreach ($config['virtualip']['vip'] as $carp) {
            if ($carp['mode'] != "carp") {
                continue;
            }
            $ipaddress = $carp['subnet'];
            $password = $carp['password'];
            $netmask = $carp['subnet_bits'];
            $vhid = $carp['vhid'];
            $advskew = $carp['advskew'];
            $carp_int = find_carp_interface($ipaddress);
            $status = get_carp_interface_status($carp_int);
            switch ($status) {
                case "MASTER":
                    $mastercount++;
                    break;
                case "BACKUP":
                    $backupcount++;
                    break;
                case "INIT":
                    $initcount++;
                    break;
            }
        }
        $status = "M/B/I {$mastercount}/{$backupcount}/{$initcount}";
    } else {
        $status = "CARP Disabled";
    }
    return $status;
}
开发者ID:MarkVLK,项目名称:pfsense-packages,代码行数:38,代码来源:lcdproc_client.php


示例5: foreach

    echo "</body></html>";
    exit;
}
if (is_array($config['virtualip']['vip'])) {
    foreach ($config['virtualip']['vip'] as $carp) {
        if ($carp['mode'] != "carp") {
            continue;
        }
        $ipaddress = $carp['subnet'];
        $password = $carp['password'];
        $netmask = $carp['subnet_bits'];
        $vhid = $carp['vhid'];
        $advskew = $carp['advskew'];
        $advbase = $carp['advbase'];
        $carp_int = "{$carp['interface']}_vip{$vhid}";
        $status = get_carp_interface_status($carp_int);
        echo "<tr>";
        $align = "valign='middle'";
        if ($carp_enabled == false) {
            $icon = "<img {$align} src='/themes/" . $g['theme'] . "/images/icons/icon_block.gif'>";
            $status = "DISABLED";
        } else {
            if ($status == "MASTER") {
                $icon = "<img {$align} src='/themes/" . $g['theme'] . "/images/icons/icon_pass.gif'>";
            } else {
                if ($status == "BACKUP") {
                    $icon = "<img {$align} src='/themes/" . $g['theme'] . "/images/icons/icon_pass_d.gif'>";
                } else {
                    if ($status == "INIT") {
                        $icon = "<img {$align} src='/themes/" . $g['theme'] . "/images/icons/icon_log.gif'>";
                    }
开发者ID:rdmenezes,项目名称:pfsense,代码行数:31,代码来源:carp_status.php


示例6: outputled_carp

function outputled_carp()
{
    /* Returns the status of CARP for the box. 
    		Assumes ALL CARP status are the same for all the intefaces.
    			-1 = CARP Disabled
    			0  = CARP on Backup 
    			1  = CARP on Master */
    global $g;
    global $config;
    if (is_array($config['virtualip']['vip'])) {
        $carpint = 0;
        foreach ($config['virtualip']['vip'] as $carp) {
            if ($carp['mode'] != "carp") {
                continue;
            }
            $carp_int = find_carp_interface($carp['subnet']);
            $status = get_carp_interface_status($carp_int);
            switch ($status) {
                case "MASTER":
                    return 1;
                    break;
                case "BACKUP":
                    return 0;
                    break;
            }
        }
    } else {
        return -1;
    }
}
开发者ID:netceler,项目名称:pfsense-packages,代码行数:30,代码来源:lcdproc_client.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_carp_status函数代码示例发布时间:2022-05-15
下一篇:
PHP get_capability_string函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap