]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/route_types.pl
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / lib / route_types.pl
index 29bcd3a672538491e2f7a15c5b0ae768f2f58a47..66384fe4492af8e3f59037dbf7c178557308e295 100755 (executable)
@@ -54,15 +54,15 @@ while (<STDIN>) {
 
        $_ =~ s/\s*,\s*/,/g;
 
-       # else: 7-field line
+       # else: 8-field line
        my @f = split(/,/, $_);
-       unless (@f == 7 || @f == 8) {
+       unless (@f == 8 || @f == 9) {
                die "invalid input on route_types line $.\n";
        }
 
        my $proto = $f[0];
        $f[3] = $1 if ($f[3] =~ /^'(.*)'$/);
-       $f[6] = $1 if ($f[6] =~ /^"(.*)"$/);
+       $f[7] = $1 if ($f[7] =~ /^"(.*)"$/);
 
        $protodetail{$proto} = {
                "number" => scalar @protos,
@@ -72,8 +72,9 @@ while (<STDIN>) {
                "char" => $f[3],
                "ipv4" => int($f[4]),
                "ipv6" => int($f[5]),
-               "shorthelp" => $f[6],
-               "restrict2" => $f[7],
+               "redist" => int($f[6]),
+               "shorthelp" => $f[7],
+               "restrict2" => $f[8],
        };
        push @protos, $proto;
        $daemons{$f[2]} = {
@@ -113,19 +114,15 @@ sub codelist {
                        $protodetail{$p}->{"shorthelp"});
                if (length($str . $s) > 70) {
                        $str =~ s/ $//;
-                       push @lines, $str . "%s\" \\\n";
+                       push @lines, $str . "\\n\" \\\n";
                        $str = "  \"       ";
                }
                $str .= $s;
        }
        $str =~ s/ $//;
-       push @lines, $str . "%s\" \\\n";
-       push @lines, "  \"       > - selected route, * - FIB route%s%s\", \\\n";
-       my @nl = ();
-       for (my $c = 0; $c < @lines + 1; $c++) {
-               push @nl, "VTYNL"
-       }
-       return join("", @lines) ."  ". join(", ", @nl);
+       push @lines, $str . "\\n\" \\\n";
+       push @lines, "  \"       > - selected route, * - FIB route\\n\\n\"";
+       return join("", @lines);
 }
 
 print "\n";
@@ -140,8 +137,9 @@ sub collect {
                next if ($protodetail{$p}->{"daemon"} eq $daemon && $daemon ne "zebra");
                next if ($protodetail{$p}->{"restrict2"} ne "" && 
                         $protodetail{$p}->{"restrict2"} ne $daemon);
+               next if ($protodetail{$p}->{"redist"} eq 0);
                next unless (($ipv4 && $protodetail{$p}->{"ipv4"})
-                               || ($ipv6 && $protodetail{$p}->{"ipv6"}));
+                            || ($ipv6 && $protodetail{$p}->{"ipv6"}));
                push @names, $protodetail{$p}->{"cname"};
                push @help, "  \"".$protodetail{$p}->{"longhelp"}."\\n\"";
        }