summaryrefslogtreecommitdiff
path: root/routers/cisco.php
diff options
context:
space:
mode:
authorGuillaume Mazoyer <respawneral@gmail.com>2015-02-09 17:36:09 +0100
committerGuillaume Mazoyer <respawneral@gmail.com>2015-02-09 17:36:09 +0100
commit767174015892dde07a6bc9999e9170b7c21dd378 (patch)
treee1cf636135922d1548168722e73a663636599b5f /routers/cisco.php
parente2172308eec0ee790fe21858ae1c45e72407fa8c (diff)
Fix confusing variable name.
There is only one parameter to check so rename the confusing 'parameters' variable name to 'parameter' accross all the code base.
Diffstat (limited to 'routers/cisco.php')
-rw-r--r--routers/cisco.php26
1 files changed, 13 insertions, 13 deletions
diff --git a/routers/cisco.php b/routers/cisco.php
index 4d94a62..7444136 100644
--- a/routers/cisco.php
+++ b/routers/cisco.php
@@ -73,33 +73,33 @@ final class Cisco extends Router {
return $traceroute;
}
- protected function build_commands($command, $parameters) {
+ protected function build_commands($command, $parameter) {
$commands = array();
switch ($command) {
case 'bgp':
- if (match_ipv4($parameters, false)) {
- $commands[] = 'show bgp ipv4 unicast '.$parameters;
- } else if (match_ipv6($parameters, false)) {
- $commands[] = 'show bgp ipv6 unicast '.$parameters;
+ if (match_ipv4($parameter, false)) {
+ $commands[] = 'show bgp ipv4 unicast '.$parameter;
+ } else if (match_ipv6($parameter, false)) {
+ $commands[] = 'show bgp ipv6 unicast '.$parameter;
} else {
throw new Exception('The parameter is not an IPv4/IPv6 address.');
}
break;
case 'as-path-regex':
- if (match_aspath_regex($parameters)) {
- $commands[] = 'show bgp ipv4 unicast quote-regexp "'.$parameters.'"';
- $commands[] = 'show bgp ipv6 unicast quote-regexp "'.$parameters.'"';
+ if (match_aspath_regex($parameter)) {
+ $commands[] = 'show bgp ipv4 unicast quote-regexp "'.$parameter.'"';
+ $commands[] = 'show bgp ipv6 unicast quote-regexp "'.$parameter.'"';
} else {
throw new Exception('The parameter is not an AS-Path regular expression.');
}
break;
case 'as':
- if (match_as($parameters)) {
- $commands[] = 'show bgp ipv4 unicast quote-regexp "^'.$parameters.'_"';
- $commands[] = 'show bgp ipv6 unicast quote-regexp "^'.$parameters.'_"';
+ if (match_as($parameter)) {
+ $commands[] = 'show bgp ipv4 unicast quote-regexp "^'.$parameter.'_"';
+ $commands[] = 'show bgp ipv6 unicast quote-regexp "^'.$parameter.'_"';
} else {
throw new Exception('The parameter is not an AS number.');
}
@@ -107,7 +107,7 @@ final class Cisco extends Router {
case 'ping':
try {
- $commands[] = $this->build_ping($parameters);
+ $commands[] = $this->build_ping($parameter);
} catch (Exception $e) {
throw $e;
}
@@ -115,7 +115,7 @@ final class Cisco extends Router {
case 'traceroute':
try {
- $commands[] = $this->build_traceroute($parameters);
+ $commands[] = $this->build_traceroute($parameter);
} catch (Exception $e) {
throw $e;
}