add backend call for ipv6 route display

This commit is contained in:
Fabian Franz
2017-05-16 20:55:26 +02:00
parent d8cde46558
commit 143ca89921
3 changed files with 21 additions and 4 deletions
@@ -121,4 +121,8 @@ class DiagnosticsController extends ApiControllerBase
{
return $this->get_general_information('routes');
}
public function generalroutes6Action()
{
return $this->get_general_information('routes6');
}
}
@@ -99,8 +99,8 @@ class General
def initialize(vtysh)
@vtysh = vtysh
end
def routes
lines = @vtysh.execute("show ip route").lines
def routes(ipv6 = false)
lines = @vtysh.execute("show ip#{ipv6 ? 'v6' : ''} route").lines
# headers
meanings = {}
@@ -124,6 +124,10 @@ class General
end
entries
end
def routes6
routes(true)
end
end
class OSPF
@@ -679,9 +683,12 @@ OptionParser.new do |opts|
options[:ospfv3_overview] = od
end
#### general things about routing
opts.on("-R", "--general-routes", "Print Routing Table") do |od|
opts.on("-R", "--general-routes", "Print Routing Table (IPv4)") do |od|
options[:general_routes] = od
end
opts.on("-6", "--general-routes6", "Print Routing Table (IPv6)") do |od|
options[:general_routes6] = od
end
### BGP
opts.on("-B", "--bgp-overview", "Print an overview of BGP") do |od|
options[:bgp_overview] = od
@@ -104,4 +104,10 @@ message: Print OSPF summary
command:/usr/local/opnsense/scripts/quagga/quagga.rb --general-routes
parameters:
type:script_output
message: Print Routing Table
message: Print IPv4 Routing Table
[general-routes6]
command:/usr/local/opnsense/scripts/quagga/quagga.rb --general-routes6
parameters:
type:script_output
message: Print IPv6 Routing Table