log_error("Dynamic DNS ({$this->_dnsHost}) There was an error trying to determine the public IP for interface - {$dnsIf}({$this->_if}). Probably interface is not a WAN interface.");
$status="Dynamic DNS ({$this->_dnsHost}): (Success) IP address is current, no update performed.";
$successful_update=true;
break;
case1:
$status="Dynamic DNS ({$this->_dnsHost}): (Success) DNS hostname update successful.";
$successful_update=true;
break;
case2:
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Hostname supplied does not exist.";
break;
case3:
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Invalid Username.";
break;
case4:
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Invalid Password.";
break;
case5:
$status="Dynamic DNS ({$this->_dnsHost}): (Error) To many updates sent.";
break;
case6:
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Account disabled due to violation of No-IP terms of service.";
break;
case7:
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Invalid IP. IP Address submitted is improperly formatted or is a private IP address or is on a blacklist.";
break;
case8:
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Disabled / Locked Hostname.";
break;
case9:
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Host updated is configured as a web redirect and no update was performed.";
break;
case10:
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Group supplied does not exist.";
break;
case11:
$status="Dynamic DNS ({$this->_dnsHost}): (Success) DNS group update is successful.";
$successful_update=true;
break;
case12:
$status="Dynamic DNS ({$this->_dnsHost}): (Success) DNS group is current, no update performed.";
$successful_update=true;
break;
case13:
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Update client support not available for supplied hostname or group.";
break;
case14:
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Hostname supplied does not have offline settings configured.";
break;
case99:
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Client disabled. Client should exit and not perform any more updates without user intervention.";
break;
case100:
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Client disabled. Client should exit and not perform any more updates without user intervention.";
break;
default:
$status="Dynamic DNS ({$this->_dnsHost}): (Unknown Response)";
$this->_debug("Unknown Response: ".$data);
break;
}
break;
case'easydns':
if(preg_match('/NOACCESS/i',$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Authentication Failed: Username and/or Password was Incorrect.";
}elseif(preg_match('/NOSERVICE/i',$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Error) No Service: Dynamic DNS Service has been disabled for this domain.";
}elseif(preg_match('/ILLEGAL INPUT/i',$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Illegal Input: Self-Explanatory";
}elseif(preg_match('/TOOSOON/i',$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Too Soon: Not Enough Time Has Elapsed Since Last Update";
}elseif(preg_match('/NOERROR/i',$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Success) IP Updated Successfully!";
$successful_update=true;
}else{
$status="Dynamic DNS ({$this->_dnsHost}): (Unknown Response)";
log_error("Dynamic DNS ({$this->_dnsHost}): PAYLOAD: {$data}");
$this->_debug($data);
}
break;
case'hn':
/* FIXME: add checks */
break;
case'zoneedit':
if(preg_match('/799/i',$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Error 799) Update Failed!";
}elseif(preg_match('/700/i',$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Error 700) Update Failed!";
}elseif(preg_match('/200/i',$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Success) IP Address Updated Successfully!";
$successful_update=true;
}elseif(preg_match('/201/i',$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Success) IP Address Updated Successfully!";
$successful_update=true;
}else{
$status="Dynamic DNS ({$this->_dnsHost}): (Unknown Response)";
log_error("Dynamic DNS ({$this->_dnsHost}): PAYLOAD: {$data}");
$this->_debug($data);
}
break;
case'dyns':
if(preg_match("/400/i",$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Bad Request - The URL was malformed. Required parameters were not provided.";
}elseif(preg_match('/402/i',$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Update Too Soon - You have tried updating to quickly since last change.";
}elseif(preg_match('/403/i',$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Database Error - There was a server-sided database error.";
}elseif(preg_match('/405/i',$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Hostname Error - The hostname (".$this->_dnsHost.") doesn't belong to you.";
}elseif(preg_match('/200/i',$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Success) IP Address Updated Successfully!";
$successful_update=true;
}else{
$status="Dynamic DNS ({$this->_dnsHost}): (Unknown Response)";
log_error("Dynamic DNS ({$this->_dnsHost}): PAYLOAD: {$data}");
$this->_debug($data);
}
break;
case'ods':
if(preg_match("/299/i",$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Success) IP Address Updated Successfully!";
$successful_update=true;
}else{
$status="Dynamic DNS ({$this->_dnsHost}): (Unknown Response)";
log_error("Dynamic DNS ({$this->_dnsHost}): PAYLOAD: {$data}");
$this->_debug($data);
}
break;
case'freedns':
if(preg_match("/has not changed./i",$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Success) No Change In IP Address";
$successful_update=true;
}elseif(preg_match("/Updated/i",$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Success) IP Address Changed Successfully!";
$successful_update=true;
}else{
$status="Dynamic DNS ({$this->_dnsHost}): (Unknown Response)";
log_error("Dynamic DNS ({$this->_dnsHost}): PAYLOAD: {$data}");
$this->_debug($data);
}
break;
case'dnsexit':
if(preg_match("/is the same/i",$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Success) No Change In IP Address";
$successful_update=true;
}elseif(preg_match("/Success/i",$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Success) IP Address Changed Successfully!";
$successful_update=true;
}else{
$status="Dynamic DNS ({$this->_dnsHost}): (Unknown Response)";
log_error("Dynamic DNS ({$this->_dnsHost}): PAYLOAD: {$data}");
$this->_debug($data);
}
break;
case'staticcling':
if(preg_match("/invalid ip/i",$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Bad Request - The IP provided was invalid.";
}elseif(preg_match('/required info missing/i',$data)){
$status="Dynamic DNS ({$this->_dnsHost}): (Error) Bad Request - Required parameters were not provided.";
$status="Dynamic DNS: (Error) IP address provided is invalid";
}elseif(preg_match('/nohost/i',$data)){
$status="Dynamic DNS: (Error) Hostname does not exist or does not have dynamic DNS enabled";
}elseif(preg_match('/numhost/i',$data)){
$status="Dynamic DNS: (Error) You may update up to 20 hosts only";
}elseif(preg_match('/dnserr/i',$data)){
$status="Dynamic DNS: (Error) DNS error, stop updating for 30 minutes.";
}elseif(preg_match('/badagent/i',$data)){
$status="Dynamic DNS: (Error) Bad request";
}elseif(preg_match('/abuse/i',$data)){
$status="Dynamic DNS: (Error) Access has been blocked for abuse";
}elseif(preg_match('/911/i',$data)){
$status="Dynamic DNS: (Error) Server-side error or maintenance";
}elseif(preg_match('/yours/i',$data)){
$status="Dynamic DNS: (Error) Specified hostname does not exist under this username";
}else{
$status="Dynamic DNS: (Unknown Response)";
log_error("Dynamic DNS: PAYLOAD: {$data}");
$this->_debug($data);
}
break;
}
if($successful_update==true){
/* Write WAN IP to cache file */
$wan_ip=$this->_checkIP();
if($this->_useIPv6==false&&$wan_ip>0){
$currentTime=time();
notify_all_remote(sprintf(gettext("Dynamic DNS updated IP Address on %s (%s) to %s"),convert_real_interface_to_friendly_descr($this->_if),$this->_if,$wan_ip));
notify_all_remote(sprintf(gettext("Dynamic DNS updated IPv6 Address on %s (%s) to %s"),convert_real_interface_to_friendly_descr($this->_if),$this->_if,$wan_ip));
$error='Dynamic DNS: (ERROR!) No Dynamic DNS Service provider was selected.';
break;
case3:
$error='Dynamic DNS: (ERROR!) No Username Provided.';
break;
case4:
$error='Dynamic DNS: (ERROR!) No Password Provided.';
break;
case5:
$error='Dynamic DNS: (ERROR!) No Hostname Provided.';
break;
case6:
$error='Dynamic DNS: (ERROR!) The Dynamic DNS Service provided is not yet supported.';
break;
case7:
$error='Dynamic DNS: (ERROR!) No Update URL Provided.';
break;
case8:
$status="Route 53: (Error) Invalid ZoneID";
break;
case9:
$status="Route 53: (Error) Invalid TTL";
break;
case10:
$error="Dynamic DNS ({$this->_dnsHost}): No change in my IP address and/or ".$this->_dnsMaxCacheAgeDays." days has not passed. Not updating dynamic DNS entry.";
break;
default:
$error="Dynamic DNS: (ERROR!) Unknown Response.";
/* FIXME: $data isn't in scope here */
/* $this->_debug($data); */
break;
}
$this->lastError=$error;
log_error($error);
}
/*
* Private Function (added 12 July 05) [beta]
* - Detect whether or not IP needs to be updated.
* | Written Specifically for pfSense (https://www.pfsense.org) may
* | work with other systems. pfSense base is FreeBSD.
*/
function_detectChange(){
$currentTime=time();
$wan_ip=$this->_checkIP();
if($wan_ip==0){
log_error("Dynamic DNS ({$this->_dnsHost}): Current WAN IP could not be determined, skipping update process.");
returnfalse;
}
$log_error="Dynamic DNS ({$this->_dnsHost}): Current WAN IP: {$wan_ip} ";
* URL encode the parameters as per http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?Query_QueryAuth.html
* PHP's rawurlencode() follows RFC 1738, not RFC 3986 as required by Amazon. The only difference is the tilde (~), so convert it back after rawurlencode
<?=gettext("This field is only used by Custom Dynamic DNS Entries.")?>
<br/>
<?=gettext("This field should be identical to what your dynamic DNS Provider will return if the update succeeds, leave it blank to disable checking of returned results.");?>
<br/>
<?=gettext("If you need the new IP to be included in the request, put %IP% in its place.")?>
<br/>
<?=gettext('If you need to include multiple possible values, separate them with a |. If your provider includes a |, escape it with \|')?>
<br/>
<?=gettext('Tabs (\t), newlines (\n) and carriage returns (\r) at the beginning or end of the returned results are removed before comparison.')?>