summaryrefslogtreecommitdiff
path: root/routers/bird.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/bird.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/bird.php')
-rw-r--r--routers/bird.php26
1 files changed, 13 insertions, 13 deletions
diff --git a/routers/bird.php b/routers/bird.php
index bc0a851..9fa2d15 100644
--- a/routers/bird.php
+++ b/routers/bird.php
@@ -91,7 +91,7 @@ final class Bird extends Router {
return $traceroute;
}
- protected function build_commands($command, $parameters) {
+ protected function build_commands($command, $parameter) {
$commands = array();
$birdc = 'birdc';
@@ -99,32 +99,32 @@ final class Bird extends Router {
switch ($command) {
case 'bgp':
- if (match_ipv4($parameters, false)) {
- $commands[] = $birdc.' \'show route for '.$parameters.'\'';
- } else if (match_ipv6($parameters, false)) {
- $commands[] = $birdc6.' \'show route for '.$parameters.'\'';
+ if (match_ipv4($parameter, false)) {
+ $commands[] = $birdc.' \'show route for '.$parameter.'\'';
+ } else if (match_ipv6($parameter, false)) {
+ $commands[] = $birdc6.' \'show route for '.$parameter.'\'';
} else {
throw new Exception('The parameter is not an IPv4/IPv6 address.');
}
break;
case 'as-path-regex':
- if (match_aspath_regex($parameters)) {
+ if (match_aspath_regex($parameter)) {
$commands[] = $birdc.' \'show route where bgp_path ~ [= '.
- $parameters.' =]\'';
+ $parameter.' =]\'';
$commands[] = $birdc6.' \'show route where bgp_path ~ [= '.
- $parameters.' =]\'';
+ $parameter.' =]\'';
} else {
throw new Exception('The parameter is not an AS-Path regular expression.');
}
break;
case 'as':
- if (match_as($parameters)) {
+ if (match_as($parameter)) {
$commands[] = $birdc.' \'show route where bgp_path ~ [= '.
- $parameters.' =]\'';
+ $parameter.' =]\'';
$commands[] = $birdc6.' \'show route where bgp_path ~ [= '.
- $parameters.' =]\'';
+ $parameter.' =]\'';
} else {
throw new Exception('The parameter is not an AS number.');
}
@@ -132,7 +132,7 @@ final class Bird extends Router {
case 'ping':
try {
- $commands[] = $this->build_ping($parameters);
+ $commands[] = $this->build_ping($parameter);
} catch (Exception $e) {
throw $e;
}
@@ -140,7 +140,7 @@ final class Bird extends Router {
case 'traceroute':
try {
- $commands[] = $this->build_traceroute($parameters);
+ $commands[] = $this->build_traceroute($parameter);
} catch (Exception $e) {
throw $e;
}