mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
Frr null routes (#1622)
* net/frr: fix null route issue * net/frr: version bump * convert tab to spaces
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
PLUGIN_NAME= frr
|
||||
PLUGIN_VERSION= 1.13
|
||||
PLUGIN_VERSION= 1.14
|
||||
PLUGIN_COMMENT= The FRRouting Protocol Suite
|
||||
PLUGIN_DEPENDS= frr6 ruby
|
||||
PLUGIN_MAINTAINER= franz.fabian.94@gmail.com
|
||||
|
||||
@@ -11,6 +11,11 @@ switching and routing, Internet access routers, and Internet peering.
|
||||
Plugin Changelog
|
||||
================
|
||||
|
||||
1.14
|
||||
|
||||
* fix null route issue in parsing
|
||||
* add missing via column to routing table for IPv4 (v6 already has it)
|
||||
|
||||
1.13
|
||||
|
||||
* Fix wrong match statement for IPv6 route-maps
|
||||
|
||||
@@ -36,6 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
<th data-column-id="ad" data-type="numeric">{{ lang._('Administrative Distance') }}</th>
|
||||
<th data-column-id="metric" data-type="numeric">{{ lang._('Metric') }}</th>
|
||||
<th data-column-id="interface" data-type="string">{{ lang._('Interface') }}</th>
|
||||
<th data-column-id="via" data-type="string">{{ lang._('Via') }}</th>
|
||||
<th data-column-id="time" data-type="string">{{ lang._('Time') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -51,6 +52,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
<td><%= entry['ad'] %></td>
|
||||
<td><%= entry['metric'] %></td>
|
||||
<td><%= entry['interface'] %></td>
|
||||
<td><%= entry['via'] %></td>
|
||||
<td><%= entry['time'] %></td>
|
||||
</tr>
|
||||
<% }); %>
|
||||
|
||||
@@ -113,13 +113,13 @@ class General
|
||||
end
|
||||
|
||||
# you don't have to understand this regex ;)
|
||||
entry_regex = /(\S+?)\s+?(\S+?)(?: \[(\d+)\/(\d+)\])? (?:via (\S+?)|is ([^,]+?)), ([^,\n]+)(?:, (\S+))?/
|
||||
entry_regex = /(\S+?)\s+?(\S+?)(?: \[(\d+)\/(\d+)\])? (?:(?:via (\S+?)|is ([^,]+?)|), ([^,\n]+)|(unreachable \(blackhole\)))(?:, (\S+))?/
|
||||
entries = []
|
||||
while (line = lines.shift&.strip)
|
||||
if line.length > 10
|
||||
code, network, ad, metric, via, direct, interface, time = line.scan(entry_regex).first
|
||||
code, network, ad, metric, via, direct, interface, unreachable, time = line.scan(entry_regex).first
|
||||
code = code.split('').map {|c| {short: c, long: meanings[c]}}
|
||||
entries << {code: code, network: (network || direct), ad: ad, via: via, metric: metric, interface: interface, time: time }
|
||||
entries << {code: code, network: (network || direct), ad: ad, via: via || unreachable, metric: metric, interface: interface, time: time }
|
||||
end
|
||||
end
|
||||
entries
|
||||
|
||||
Reference in New Issue
Block a user