コード例 #1
0
function get_ipsec_stats()
{
    global $g, $config, $sad;
    $sad = array();
    $sad = get_ipsec_tunnel_sad();
    $activecounter = 0;
    $inactivecounter = 0;
    if ($config['ipsec']['tunnel']) {
        foreach ($config['ipsec']['tunnel'] as $tunnel) {
            $ipsecstatus = false;
            $tun_disabled = "false";
            $foundsrc = false;
            $founddst = false;
            if (isset($tunnel['disabled'])) {
                $tun_disabled = "true";
                continue;
            }
            if (output_ipsec_tunnel_status($tunnel)) {
                /* tunnel is up */
                $iconfn = "true";
                $activecounter++;
            } else {
                /* tunnel is down */
                $iconfn = "false";
                $inactivecounter++;
            }
        }
    }
    if (is_array($config['ipsec']['tunnel'])) {
        $status = "Up/Down {$activecounter}/{$inactivecounter}";
    } else {
        $status = "IPSEC Disabled";
    }
    return $status;
}
コード例 #2
0
		
		</td>
		<td class="listr"><?php 
            echo htmlspecialchars($ipsec['remote-gateway']);
            ?>
		<br/>
		<?php 
            echo $ipsec['remote-subnet'];
            ?>
		</td>
		<td class="listr"><?php 
            echo htmlspecialchars($ipsec['descr']);
            ?>
</td>
		<td class="listr"><?php 
            echo output_ipsec_tunnel_status($ipsec);
            ?>
</td>
	</tr>
<?php 
        }
    }
} else {
    ?>
  <tr>
    <td>
      <p>
        <strong>IPsec güvenlik tanımlanması yapılmadı.</strong>
      </p>
    </td>
  </tr>