summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-11-03 09:22:37 -0200
committerRenato Botelho <renato@netgate.com>2015-11-03 09:22:37 -0200
commit7fcd5ea8bb2e7c9c94e1f38008fc3da440eb14e8 (patch)
treef0b82f6f5eaffaf794711f68a49088d8b5feef86 /src
parentbe7990b9fb9a0681abec1e30697ac1f9a0146e5d (diff)
downloadpfsense-7fcd5ea8bb2e7c9c94e1f38008fc3da440eb14e8.zip
pfsense-7fcd5ea8bb2e7c9c94e1f38008fc3da440eb14e8.tar.gz
Retire ipsec_smp_dump_status()
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/ipsec.inc101
1 files changed, 0 insertions, 101 deletions
diff --git a/src/etc/inc/ipsec.inc b/src/etc/inc/ipsec.inc
index 6654166..911f0f4 100644
--- a/src/etc/inc/ipsec.inc
+++ b/src/etc/inc/ipsec.inc
@@ -426,107 +426,6 @@ function ipsec_phase2_status(&$ipsec_status, &$phase2) {
return false;
}
-function ipsec_smp_dump_status() {
- global $config, $g, $custom_listtags;
-
- if (isset($config['ipsec']['enable'])) {
- if (!file_exists("{$g['varrun_path']}/charon.xml")) {
- log_error("IPsec daemon not running or has a problem!");
- return;
- }
- } else {
- return;
- }
-
- $fd = @fsockopen("unix://{$g['varrun_path']}/charon.xml");
- if (!$fd) {
- log_error("Could not read status from IPsec");
- return;
- }
- $query = '<?xml version="1.0"?><message xmlns="http://www.strongswan.org/smp/1.0" type="request" id="1">';
- $query .= '<query><ikesalist/></query></message>';
-
- @fwrite($fd, $query);
- $response = "";
- while (!strstr($sread, "</message>")) {
- $sread = fgets($fd);
- if ($sread === false) {
- break;
- }
- $response .= $sread;
- }
- fclose($fd);
-
- if ($sread === false) {
- log_error("Error during reading of status from IPsec");
- return;
- }
-
- @file_put_contents("{$g['tmp_path']}/smp_status.xml", $response);
- unset($response, $sread);
-
- $custom_listtags = array('ikesa', 'childsa', 'network', 'auth');
- $response = parse_xml_config("{$g['tmp_path']}/smp_status.xml", "message");
- @unlink("{$g['tmp_path']}/smp_status.xml");
- unset($custom_listtags);
-
- return $response;
-}
-
-/*
- * Return dump of SPD table
- */
-function ipsec_dump_spd() {
- $fd = @popen("/sbin/setkey -DP", "r");
- $spd = array();
- if ($fd) {
- while (!feof($fd)) {
- $line = chop(fgets($fd));
- if (!$line) {
- continue;
- }
- if ($line == "No SPD entries.") {
- break;
- }
- if ($line[0] != "\t") {
- if (is_array($cursp)) {
- $spd[] = $cursp;
- }
- $cursp = array();
- $linea = explode(" ", $line);
- $cursp['srcid'] = substr($linea[0], 0, strpos($linea[0], "["));
- $cursp['dstid'] = substr($linea[1], 0, strpos($linea[1], "["));
- $i = 0;
- } else if (is_array($cursp)) {
- $line = trim($line, "\t\r\n ");
- $linea = explode(" ", $line);
- switch ($i) {
- case 1:
- if ($linea[1] == "none") /* don't show default anti-lockout rule */ {
- unset($cursp);
- } else {
- $cursp['dir'] = $linea[0];
- }
- break;
- case 2:
- $upperspec = explode("/", $linea[0]);
- $cursp['proto'] = $upperspec[0];
- list($cursp['src'], $cursp['dst']) = explode("-", $upperspec[2]);
- $cursp['reqid'] = substr($upperspec[3], strpos($upperspec[3], "#")+1);
- break;
- }
- }
- $i++;
- }
- if (is_array($cursp) && count($cursp)) {
- $spd[] = $cursp;
- }
- pclose($fd);
- }
-
- return $spd;
-}
-
/*
* Return dump of SAD table
*/
OpenPOWER on IntegriCloud