summaryrefslogtreecommitdiff
path: root/routers/juniper.php
diff options
context:
space:
mode:
authorGuillaume Mazoyer <gmazoyer@gravitons.in>2015-07-23 17:59:59 +0200
committerGuillaume Mazoyer <gmazoyer@gravitons.in>2015-07-23 17:59:59 +0200
commitc6119c771d8fdc4f4794e03afd9a4f84b5cdbebe (patch)
tree6733adef9fe17a7c9a2e4dcaab559a0d886034f2 /routers/juniper.php
parent6e9a4fb7765dda39656d1e95a743de1f79aab3b2 (diff)
Rework hostname parameter check.
Rename FQDN to hostname which seems more appropriate. Refactor match_fqdn / match_hostname function to use a more accurate way of checking a potential hostname.
Diffstat (limited to 'routers/juniper.php')
-rw-r--r--routers/juniper.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/juniper.php b/routers/juniper.php
index b5c3449..3eb34e5 100644
--- a/routers/juniper.php
+++ b/routers/juniper.php
@@ -27,10 +27,10 @@ final class Juniper extends Router {
$ping = null;
if (match_ipv4($destination) || match_ipv6($destination) ||
- match_fqdn($destination)) {
+ match_hostname($destination)) {
$ping = 'ping count 10 rapid '.$destination;
} else {
- throw new Exception('The parameter is not an IPv4/IPv6 address or a FQDN.');
+ throw new Exception('The parameter is not an IPv4/IPv6 address or a hostname.');
}
if (($ping != null) && $this->has_source_interface_id()) {
@@ -45,10 +45,10 @@ final class Juniper extends Router {
if (match_ipv4($destination)) {
$traceroute = 'traceroute as-number-lookup '.$destination;
- } else if (match_ipv6($destination) || match_fqdn($destination)) {
+ } else if (match_ipv6($destination) || match_hostname($destination)) {
$traceroute = 'traceroute '.$destination;
} else {
- throw new Exception('The parameter is not an IPv4/IPv6 address or a FQDN.');
+ throw new Exception('The parameter is not an IPv4/IPv6 address or a hostname.');
}
if (($traceroute != null) && $this->has_source_interface_id()) {