summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@world.inf.org>2013-02-24 12:42:19 +0545
committerPhil Davis <phil.davis@world.inf.org>2013-02-24 12:42:19 +0545
commit0e3aeb6bbbf4f88e49b06efdda4f909c3c8af17d (patch)
tree2d7149f775a699123486673e75d6830c9f325ed3
parentcfa845a9ce54de1cd6ed67c191b7c0e2fe1c5a7f (diff)
downloadpfsense-0e3aeb6bbbf4f88e49b06efdda4f909c3c8af17d.zip
pfsense-0e3aeb6bbbf4f88e49b06efdda4f909c3c8af17d.tar.gz
Add common DynDNS constants and code
to system.inc to remove code duplication
-rw-r--r--etc/inc/services.inc21
1 files changed, 21 insertions, 0 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index abe18b7..002d4d7 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -39,6 +39,9 @@
pfSense_MODULE: utils
*/
+define('DYNDNS_PROVIDER_VALUES', 'dnsomatic dyndns dyndns-static dyndns-custom dhs dyns easydns noip ods zoneedit loopia freedns dnsexit opendns namecheap he-net he-net-tunnelbroker selfhost route53 custom');
+define('DYNDNS_PROVIDER_DESCRIPTIONS', '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, SelfHost, Route 53, Custom');
+
/* implement ipv6 route advertising deamon */
function services_radvd_configure() {
global $config, $g;
@@ -1499,6 +1502,24 @@ function services_dyndns_configure($int = "") {
return 0;
}
+function dyndnsCheckIP($int) {
+ $ip_address = get_interface_ip($int);
+ if (is_private_ip($ip_address)) {
+ $hosttocheck = "checkip.dyndns.org";
+ $checkip = gethostbyname($hosttocheck);
+ $ip_ch = curl_init("http://{$checkip}");
+ curl_setopt($ip_ch, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($ip_ch, CURLOPT_SSL_VERIFYPEER, FALSE);
+ curl_setopt($ip_ch, CURLOPT_INTERFACE, $ip_address);
+ $ip_result_page = curl_exec($ip_ch);
+ curl_close($ip_ch);
+ $ip_result_decoded = urldecode($ip_result_page);
+ preg_match('=Current IP Address: (.*)</body>=siU', $ip_result_decoded, $matches);
+ $ip_address = trim($matches[1]);
+ }
+ return $ip_address;
+}
+
function services_dnsmasq_configure() {
global $config, $g;
$return = 0;
OpenPOWER on IntegriCloud