summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-06-28 15:21:56 -0400
committerjim-p <jimp@pfsense.org>2011-06-28 15:21:56 -0400
commit38a481adc8179b1df06faf0e7fcc08a51a6de53e (patch)
tree540bb146e16d5fc346310208201a3fef79dbbe56
parent3062d6f7e454a261858cfc8934ad1cd9b45d7870 (diff)
downloadpfsense-38a481adc8179b1df06faf0e7fcc08a51a6de53e.zip
pfsense-38a481adc8179b1df06faf0e7fcc08a51a6de53e.tar.gz
Add he.net tunnelbroker update dyndns type
-rw-r--r--etc/inc/dyndns.class40
-rwxr-xr-xusr/local/www/services_dyndns.php4
-rw-r--r--usr/local/www/services_dyndns_edit.php7
3 files changed, 46 insertions, 5 deletions
diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class
index 340fbc1..ebe300a 100644
--- a/etc/inc/dyndns.class
+++ b/etc/inc/dyndns.class
@@ -19,6 +19,7 @@
* - OpenDNS (opendns.com)
* - Namecheap (namecheap.com)
* - HE.net (dns.he.net)
+ * - HE.net Tunnelbroker IP update (ipv4.tunnelbroker.net)
* +----------------------------------------------------+
* Requirements:
* - PHP version 4.0.2 or higher with CURL Library
@@ -51,6 +52,7 @@
* OpenDNS - Last Tested: 4 August 2008
* Namecheap - Last Tested: 31 August 2010
* HE.net - Last Tested: NEVER
+ * HE.net Tunnel - Last Tested: 28 June 2011
* +====================================================+
*
* @author E.Kristensen
@@ -160,6 +162,9 @@
case 'he-net':
$this->_update();
break;
+ case 'he-net-tunnelbroker':
+ $this->_update();
+ break;
default:
$this->_error(6);
break;
@@ -394,6 +399,14 @@
curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsHost . ':' . $this->_dnsPass);
curl_setopt($ch, CURLOPT_URL, $server . 'hostname=' . $this->_dnsHost);
break;
+ case 'he-net-tunnelbroker':
+ $needsIP = FALSE;
+ log_error("HE.net Tunnelbroker: DNS update() starting.");
+ $server = "https://ipv4.tunnelbroker.net/ipv4_end.php?";
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
+ curl_setopt($ch, CURLOPT_USERPWD, $this->_dnsUser . ':' . $this->_dnsPass);
+ curl_setopt($ch, CURLOPT_URL, $server . 'tid=' . $this->_dnsHost);
+ break;
default:
break;
}
@@ -745,6 +758,33 @@
$this->_debug($data);
}
break;
+ case 'he-net-tunnelbroker':
+ /*
+ -ERROR: Missing parameter(s).
+ -ERROR: Invalid API key or password
+ -ERROR: Tunnel not found
+ -ERROR: Another tunnel exists for this IP.
+ -ERROR: This tunnel is already associated with this IP address
+ +OK: Tunnel endpoint updated to: x.x.x.x
+ */
+ if (preg_match("/Missing parameter/i", $data)) {
+ $status = "phpDynDNS: (Error) Bad Request - Missing/Invalid Parameters.";
+ } else if (preg_match('/Tunnel not found/i', $data)) {
+ $status = "phpDynDNS: (Error) Bad Request - Invalid Tunnel ID.";
+ } else if (preg_match('/Invalid API key or password/i', $data)) {
+ $status = "phpDynDNS: (Error) Invalid username or password.";
+ } else if (preg_match('/OK:/i', $data)) {
+ $status = "phpDynDNS: (Success) IP Address Updated Successfully!";
+ $successful_update = true;
+ } else if (preg_match('/This tunnel is already associated with this IP address/i', $data)) {
+ $status = "phpDynDNS: (Success) No Change In IP Address.";
+ $successful_update = true;
+ } else {
+ $status = "phpDynDNS: (Unknown Response)";
+ log_error("phpDynDNS: PAYLOAD: {$data}");
+ $this->_debug($data);
+ }
+ break;
}
if($successful_update == true) {
diff --git a/usr/local/www/services_dyndns.php b/usr/local/www/services_dyndns.php
index 263a669..13664a0 100755
--- a/usr/local/www/services_dyndns.php
+++ b/usr/local/www/services_dyndns.php
@@ -114,8 +114,8 @@ include("head.inc");
</td>
<td class="listlr">
<?php
- $types = explode(",", "DNS-O-Matic, DynDNS (dynamic),DynDNS (static),DynDNS (custom),DHS,DyNS,easyDNS,No-IP,ODS.org,ZoneEdit,Loopia,freeDNS, DNSexit, OpenDNS, Namecheap, HE.net");
- $vals = explode(" ", "dnsomatic dyndns dyndns-static dyndns-custom dhs dyns easydns noip ods zoneedit loopia freedns dnsexit opendns namecheap he-net");
+ $types = explode(",", "DNS-O-Matic, DynDNS (dynamic),DynDNS (static),DynDNS (custom),DHS,DyNS,easyDNS,No-IP,ODS.org,ZoneEdit,Loopia,freeDNS, DNSexit, OpenDNS, Namecheap, HE.net, HE.net Tunnelbroker");
+ $vals = explode(" ", "dnsomatic dyndns dyndns-static dyndns-custom dhs dyns easydns noip ods zoneedit loopia freedns dnsexit opendns namecheap he-net he-net-tunnelbroker");
$j = 0; for ($j = 0; $j < count($vals); $j++)
if ($vals[$j] == $dyndns['type']) {
echo htmlspecialchars($types[$j]);
diff --git a/usr/local/www/services_dyndns_edit.php b/usr/local/www/services_dyndns_edit.php
index e382deb..93ffbf7 100644
--- a/usr/local/www/services_dyndns_edit.php
+++ b/usr/local/www/services_dyndns_edit.php
@@ -159,8 +159,8 @@ include("head.inc");
<td width="78%" class="vtable">
<select name="type" class="formselect" id="type">
<?php
- $types = explode(",", "DNS-O-Matic, DynDNS (dynamic),DynDNS (static),DynDNS (custom),DHS,DyNS,easyDNS,No-IP,ODS.org,ZoneEdit,Loopia,freeDNS, DNSexit, OpenDNS, Namecheap, HE.net");
- $vals = explode(" ", "dnsomatic dyndns dyndns-static dyndns-custom dhs dyns easydns noip ods zoneedit loopia freedns dnsexit opendns namecheap he-net");
+ $types = explode(",", "DNS-O-Matic, DynDNS (dynamic),DynDNS (static),DynDNS (custom),DHS,DyNS,easyDNS,No-IP,ODS.org,ZoneEdit,Loopia,freeDNS, DNSexit, OpenDNS, Namecheap, HE.net, HE.net Tunnelbroker");
+ $vals = explode(" ", "dnsomatic dyndns dyndns-static dyndns-custom dhs dyns easydns noip ods zoneedit loopia freedns dnsexit opendns namecheap he-net he-net-tunnelbroker");
$j = 0; for ($j = 0; $j < count($vals); $j++): ?>
<option value="<?=$vals[$j];?>" <?php if ($vals[$j] == $pconfig['type']) echo "selected";?>>
<?=htmlspecialchars($types[$j]);?>
@@ -188,7 +188,8 @@ include("head.inc");
<span class="vexpl">
<span class="red"><strong><?=gettext("Note:");?><br></strong>
</span>
- <?=gettext("Enter the complete host/domain name. example: myhost.dyndns.org");?>
+ <?=gettext("Enter the complete host/domain name. example: myhost.dyndns.org");?><br/>
+ <?=gettext("For he.net tunnelbroker, enter your tunnel ID");?>
</span>
</td>
</tr>
OpenPOWER on IntegriCloud