aboutsummaryrefslogtreecommitdiffstats
path: root/packages/carp_sync_client.php
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-03-31 01:49:32 +0000
committerColin Smith <colin@pfsense.org>2005-03-31 01:49:32 +0000
commit4e577ec6d4207ff6da1d55070dab24aefd3f1c07 (patch)
treeb525d30240d81dac77a9d17f5e5e6d7deb37a4f3 /packages/carp_sync_client.php
parent49324c2b92cad64679ba51ca0e46dc18f21750df (diff)
downloadpfsense-packages-4e577ec6d4207ff6da1d55070dab24aefd3f1c07.tar.gz
pfsense-packages-4e577ec6d4207ff6da1d55070dab24aefd3f1c07.tar.bz2
pfsense-packages-4e577ec6d4207ff6da1d55070dab24aefd3f1c07.zip
* Clean up carp_settings.xml.
* Rewrite CARP syncing code to use XMLRPC.
Diffstat (limited to 'packages/carp_sync_client.php')
-rw-r--r--packages/carp_sync_client.php23
1 files changed, 14 insertions, 9 deletions
diff --git a/packages/carp_sync_client.php b/packages/carp_sync_client.php
index e5bd1cdf..b2da24ba 100644
--- a/packages/carp_sync_client.php
+++ b/packages/carp_sync_client.php
@@ -2,7 +2,7 @@
/*
carp_sync.php
part of pfSense (www.pfSense.com)
- Copyright (C) 2004 Scott Ullrich (sullrich@gmail.com)
+ Copyright (C) 2005 Scott Ullrich (sullrich@gmail.com) and Colin Smith (ethethlay@gmail.com)
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -25,25 +25,30 @@
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
+
+ TODO:
+ * SSL support!
+
*/
+require_once("xmlrpc_client.inc"); // Include client classes from our XMLRPC implementation.
+require_once("xmlparse_pkg.inc"); // Include pfSense helper functions.
+require_once("config.inc");
+require_once("functions.inc");
+
+function carp_sync_xml($url, $password, $section, $section_xml) {
+ $params = array(new XML_R
+
if($already_processed != 1)
if($config['installedpackages']['carpsettings']['config'] <> "" and
is_array($config['installedpackages']['carpsettings']['config'])) {
$already_processed = 1;
foreach($config['installedpackages']['carpsettings']['config'] as $carp) {
if($carp['synchronizetoip'] <> "" ) {
- /* lets sync! */
$synchronizetoip = $carp['synchronizetoip'];
- $files_to_copy = "";
if($carp['synchronizerules'] <> "" and is_array($config['filter'])) {
$current_rules_section = backup_config_section("filter");
- $current_rules_section = str_replace("<?xml version=\"1.0\"?>", "", $current_rules_section);
- /* generate firewall rules xml */
- $fout = fopen("{$g['tmp_path']}/filter_section.txt","w");
- fwrite($fout, $current_rules_section);
- fclose($fout);
- $files_to_copy .= "{$g['tmp_path']}/filter_section.txt";
+ //$current_rules_section = str_replace("<?xml version=\"1.0\"?>", "", $current_rules_section);
}
if($carp['synchronizenat'] <> "" and is_array($config['nat'])) {
$current_nat_section = backup_config_section("nat");