summaryrefslogtreecommitdiff
path: root/routers/quagga.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/quagga.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/quagga.php')
-rw-r--r--routers/quagga.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/routers/quagga.php b/routers/quagga.php
index 16f5d9c..1c88c33 100644
--- a/routers/quagga.php
+++ b/routers/quagga.php
@@ -91,35 +91,35 @@ final class Quagga extends Router {
return $traceroute;
}
- protected function build_commands($command, $parameters) {
+ protected function build_commands($command, $parameter) {
$commands = array();
$vtysh = 'vtysh -c "';
switch ($command) {
case 'bgp':
- if (match_ipv4($parameters, false)) {
- $commands[] = $vtysh.'show bgp ipv4 unicast '.$parameters.'"';
+ if (match_ipv4($parameter, false)) {
+ $commands[] = $vtysh.'show bgp ipv4 unicast '.$parameter.'"';
} else if (match_ipv6($parameters, false)) {
- $commands[] = $vtysh.'show bgp ipv6 unicast '.$parameters.'"';
+ $commands[] = $vtysh.'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[] = $vtysh.'show ip bgp regexp '.$parameters.'"';
- $commands[] = $vtysh.'show ipv6 bgp regexp '.$parameters.'"';
+ if (match_aspath_regex($parameter)) {
+ $commands[] = $vtysh.'show ip bgp regexp '.$parameter.'"';
+ $commands[] = $vtysh.'show ipv6 bgp regexp '.$parameter.'"';
} else {
throw new Exception('The parameter is not an AS-Path regular expression.');
}
break;
case 'as':
- if (match_as($parameters)) {
- $commands[] = $vtysh.'show ip bgp regexp ^'.$parameters.'_'.'"';
- $commands[] = $vtysh.'show ipv6 bgp regexp ^'.$parameters.'_'.'"';
+ if (match_as($parameter)) {
+ $commands[] = $vtysh.'show ip bgp regexp ^'.$parameter.'_'.'"';
+ $commands[] = $vtysh.'show ipv6 bgp regexp ^'.$parameter.'_'.'"';
} else {
throw new Exception('The parameter is not an AS number.');
}
@@ -127,7 +127,7 @@ final class Quagga extends Router {
case 'ping':
try {
- $commands[] = $this->build_ping($parameters);
+ $commands[] = $this->build_ping($parameter);
} catch (Exception $e) {
throw $e;
}
@@ -135,7 +135,7 @@ final class Quagga extends Router {
case 'traceroute':
try {
- $commands[] = $this->build_traceroute($parameters);
+ $commands[] = $this->build_traceroute($parameter);
} catch (Exception $e) {
throw $e;
}