--- /opt/source/rancid-3.7/bin/fnrancid 2017-10-04 21:56:36.345507599 +0200
+++ /home/rancid/bin/fnrancid 2017-10-04 21:52:37.152706399 +0200
@@ -174,6 +174,36 @@
&ipaddrval($a) <=> &ipaddrval($b);
}
+# This routine parses "get router info"
+sub GetRouter {
+ print STDERR " In GetRouter: $_" if ($debug);
+
+ ProcessHistory("-- Start Routes --","","","\n");
+
+ while () {
+ tr/\015//d;
+ next if /^\s*$/;
+ last if (/$prompt/);
+
+ # filter date
+ if (/^(.*)\s[0-9]{1,2}d[0-9]{1,2}h[0-9]{1,2}m/ && $filter_osc) {
+ ProcessHistory("","","","$1 \n");
+ next;
+ }
+ # filter time
+ if (/^(.*)\s[0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}/ && $filter_osc) {
+ ProcessHistory("","","","$1 \n");
+ next;
+ }
+
+ ProcessHistory("","","","$_");
+
+ }
+ ProcessHistory("-- End Routes --","","","\n");
+
+ return(0);
+}
+
# This routine parses "get system"
sub GetSystem {
print STDERR " In GetSystem: $_" if ($debug);
@@ -262,7 +289,8 @@
# Main
@commandtable = (
{'get system status' => 'GetSystem'},
- {'show full-configuration' => 'GetConf'}
+ {'show full-configuration' => 'GetConf'},
+ {'get router info routing-table all' => 'GetRouter'}
);
# Use an array to preserve the order of the commands and a hash for mapping
# commands to the subroutine and track commands that have been completed.