diff options
Diffstat (limited to 'routers/bird.php')
-rw-r--r-- | routers/bird.php | 26 |
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; } |