summaryrefslogtreecommitdiff
path: root/routers
diff options
context:
space:
mode:
Diffstat (limited to 'routers')
-rw-r--r--routers/bird.php8
-rw-r--r--routers/cisco.php8
-rw-r--r--routers/juniper.php8
-rw-r--r--routers/quagga.php8
-rw-r--r--routers/router.php4
5 files changed, 20 insertions, 16 deletions
diff --git a/routers/bird.php b/routers/bird.php
index 5219cc2..9a6c869 100644
--- a/routers/bird.php
+++ b/routers/bird.php
@@ -120,11 +120,11 @@ final class Bird extends Router {
case 'as-path-regex':
if (match_aspath_regex($parameter)) {
- if (!$this->global_config['misc']['disable_ipv6']) {
+ if (!$this->config['disable_ipv6']) {
$commands[] = $birdc6.' \'show route where bgp_path ~ [= '.
$parameter.' =]\'';
}
- if (!$this->global_config['misc']['disable_ipv4']) {
+ if (!$this->config['disable_ipv4']) {
$commands[] = $birdc.' \'show route where bgp_path ~ [= '.
$parameter.' =]\'';
}
@@ -135,11 +135,11 @@ final class Bird extends Router {
case 'as':
if (match_as($parameter)) {
- if (!$this->global_config['misc']['disable_ipv6']) {
+ if (!$this->config['disable_ipv6']) {
$commands[] = $birdc6.' \'show route where bgp_path ~ [= '.
$parameter.' =]\'';
}
- if (!$this->global_config['misc']['disable_ipv4']) {
+ if (!$this->config['disable_ipv4']) {
$commands[] = $birdc.' \'show route where bgp_path ~ [= '.
$parameter.' =]\'';
}
diff --git a/routers/cisco.php b/routers/cisco.php
index aee0b02..fe6c746 100644
--- a/routers/cisco.php
+++ b/routers/cisco.php
@@ -89,11 +89,11 @@ final class Cisco extends Router {
case 'as-path-regex':
if (match_aspath_regex($parameter)) {
- if (!$this->global_config['misc']['disable_ipv6']) {
+ if (!$this->config['disable_ipv6']) {
$commands[] = 'show bgp ipv6 unicast quote-regexp "'.$parameter.
'"';
}
- if (!$this->global_config['misc']['disable_ipv4']) {
+ if (!$this->config['disable_ipv4']) {
$commands[] = 'show bgp ipv4 unicast quote-regexp "'.$parameter.
'"';
}
@@ -104,11 +104,11 @@ final class Cisco extends Router {
case 'as':
if (match_as($parameter)) {
- if (!$this->global_config['misc']['disable_ipv6']) {
+ if (!$this->config['disable_ipv6']) {
$commands[] = 'show bgp ipv6 unicast quote-regexp "^'.$parameter.
'_"';
}
- if (!$this->global_config['misc']['disable_ipv4']) {
+ if (!$this->config['disable_ipv4']) {
$commands[] = 'show bgp ipv4 unicast quote-regexp "^'.$parameter.
'_"';
}
diff --git a/routers/juniper.php b/routers/juniper.php
index 3e04921..7ec2470 100644
--- a/routers/juniper.php
+++ b/routers/juniper.php
@@ -76,11 +76,11 @@ final class Juniper extends Router {
case 'as-path-regex':
if (match_aspath_regex($parameter)) {
- if (!$this->global_config['misc']['disable_ipv6']) {
+ if (!$this->config['disable_ipv6']) {
$commands[] = 'show route aspath-regex "'.$parameter.
'" protocol bgp table inet6.0';
}
- if (!$this->global_config['misc']['disable_ipv4']) {
+ if (!$this->config['disable_ipv4']) {
$commands[] = 'show route aspath-regex "'.$parameter.
'" protocol bgp table inet.0';
}
@@ -91,11 +91,11 @@ final class Juniper extends Router {
case 'as':
if (match_as($parameter)) {
- if (!$this->global_config['misc']['disable_ipv6']) {
+ if (!$this->config['disable_ipv6']) {
$commands[] = 'show route aspath-regex "^'.$parameter.
' .*" protocol bgp table inet6.0';
}
- if (!$this->global_config['misc']['disable_ipv4']) {
+ if (!$this->config['disable_ipv4']) {
$commands[] = 'show route aspath-regex "^'.$parameter.
' .*" protocol bgp table inet.0';
}
diff --git a/routers/quagga.php b/routers/quagga.php
index 01d4387..d451e94 100644
--- a/routers/quagga.php
+++ b/routers/quagga.php
@@ -119,10 +119,10 @@ final class Quagga extends Router {
case 'as-path-regex':
if (match_aspath_regex($parameter)) {
- if (!$this->global_config['misc']['disable_ipv6']) {
+ if (!$this->config['disable_ipv6']) {
$commands[] = $vtysh.'show ipv6 bgp regexp '.$parameter.'"';
}
- if (!$this->global_config['misc']['disable_ipv4']) {
+ if (!$this->config['disable_ipv4']) {
$commands[] = $vtysh.'show ip bgp regexp '.$parameter.'"';
}
} else {
@@ -132,10 +132,10 @@ final class Quagga extends Router {
case 'as':
if (match_as($parameter)) {
- if (!$this->global_config['misc']['disable_ipv6']) {
+ if (!$this->config['disable_ipv6']) {
$commands[] = $vtysh.'show ipv6 bgp regexp ^'.$parameter.'_'.'"';
}
- if (!$this->global_config['misc']['disable_ipv4']) {
+ if (!$this->config['disable_ipv4']) {
$commands[] = $vtysh.'show ip bgp regexp ^'.$parameter.'_'.'"';
}
} else {
diff --git a/routers/router.php b/routers/router.php
index f980982..6e564d6 100644
--- a/routers/router.php
+++ b/routers/router.php
@@ -112,6 +112,10 @@ abstract class Router {
protected abstract function build_commands($command, $parameter);
+ public function get_config() {
+ return $this->config;
+ }
+
public function send_command($command, $parameter) {
try {
$commands = $this->build_commands($command, $parameter);