]>
git.ipfire.org Git - thirdparty/bird.git/blob - misc/cisco2list
3 # Convert Cisco routing table listing to list of prefixes
6 $loc = ($ARGV[0] eq "-l"); # Print only local prefixes
9 ($loc ?
/^[OR]\s/ : /^B\s/) || next;
10 /^[ORB]( E[12])?\s+(\d+\.\d+\.\d+\.\d+)(\s|\/\d
+\s
)/ || die "Cannot parse $_";
13 if ($len =~ /^\s*$/) {
15 $len = ($net =~ /\.0$/) ?
24 : 32;
18 $net =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/;
19 printf "%02x%02x%02x%02x/%d\n", $1, $2, $3, $4, $len;