From 8fd1a5a0d0b460422acacd126e78555e3bc46b0c Mon Sep 17 00:00:00 2001 From: Robert Bays <rbays@roatan.(none)> Date: Thu, 20 May 2010 14:10:36 -0700 Subject: silence the perl critic. --- lib/Vyatta/Quagga/Config.pm | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'lib/Vyatta') diff --git a/lib/Vyatta/Quagga/Config.pm b/lib/Vyatta/Quagga/Config.pm index a1e76f80..4a6ca050 100644 --- a/lib/Vyatta/Quagga/Config.pm +++ b/lib/Vyatta/Quagga/Config.pm @@ -81,17 +81,15 @@ sub _reInitialize { # populate an array reference with Quagga commands sub returnQuaggaCommands { my ($self, $arrayref) = @_; - my $key; - my $string; - foreach $key (sort { $b cmp $a } keys %_vtyshdel) { - foreach $string (@{$_vtyshdel{$key}}) { + foreach my $key (sort { $b cmp $a } keys %_vtyshdel) { + foreach my $string (@{$_vtyshdel{$key}}) { push @{$arrayref}, "$string"; } } - foreach $key (sort keys %_vtysh) { - foreach $string (@{$_vtysh{$key}}) { + foreach my $key (sort keys %_vtysh) { + foreach my $string (@{$_vtysh{$key}}) { push @{$arrayref}, "$string"; } } @@ -156,15 +154,13 @@ sub _setConfigTree { if ($_DEBUG >= 3) { print "DEBUG: _setConfigTree - enter - level: $level\tdelete: $delete\trecurse: $recurse\n"; } - my $key; my @keys; - foreach $key (sort $sortfunc keys %$vtyshref) { + foreach my $key (sort $sortfunc keys %$vtyshref) { if ($_DEBUG >= 3) { print "DEBUG: _setConfigTree - key $key\n"; } if ((($recurse) && ($key =~ /^$level/)) || ((! $recurse) && ($key =~ /^$level$/))) { - my ($index, $cmd); - $index = 0; - foreach $cmd (@{$vtyshref->{$key}}) { + my $index = 0; + foreach my $cmd (@{$vtyshref->{$key}}) { if ($_DEBUG >= 2) { print "DEBUG: _setConfigTree - key: $key \t cmd: $cmd\n"; } if (! _sendQuaggaCommand("$cmd")) { return 0; } @@ -187,11 +183,10 @@ sub cmpb { $b cmp $a } # output: none, return failure if needed sub _sendQuaggaCommand { my ($command) = @_; - my $section; my $args = "$_vtyshexe --noerr -c 'configure terminal' "; my @commands = split / ; /, $command; - foreach $section (@commands) { + foreach my $section (@commands) { $args .= "-c '$section' "; } @@ -227,10 +222,9 @@ sub _qVarReplace { my @qcommands = split /\s/, $qcommand; my $result = ''; - my $token; # try to replace (#num, ?var) references foreach item in Quagga command template array # with their corresponding value in Vyatta command array at (#num) index - foreach $token (@qcommands) { + foreach my $token (@qcommands) { # is this a #var reference? if so translate and append to result if ($token =~ s/\#(\d+);*/$1/) { $token--; @@ -277,7 +271,6 @@ sub _qVarReplace { sub _qCommandFind { my $vyattaconfig = shift; my $qcom = shift; - my $token = ''; my $command = ''; my @nodes = split /\s+/, $vyattaconfig; @@ -286,7 +279,7 @@ sub _qCommandFind { # check if there is a corresponding hash in %qcom. if not, # do same check again replacing the end param with var to see # if this is a var replacement - foreach $token (@nodes) { + foreach my $token (@nodes) { if (exists $qcom->{$token}) { $command = $token; } elsif (exists $qcom->{"$command $token"}) { $command = "$command $token"; } elsif (exists $qcom->{"$command var"}) { $command = "$command var"; } @@ -333,8 +326,7 @@ sub _qtree { # traverse the Vyatta config tree and translate to Quagga commands where apropos if (@nodes > 0) { - my $node; - foreach $node (@nodes) { + foreach my $node (@nodes) { if ($_DEBUG >= 2) { print "DEBUG: _qtree - foreach node loop - node $node\n"; } # for set action, need to check that the node was actually changed. Otherwise -- cgit v1.2.3 From ea03012e644d5d292857ec6b9dcaa4cdde1da4aa Mon Sep 17 00:00:00 2001 From: Robert Bays <rbays@roatan.(none)> Date: Thu, 20 May 2010 17:10:57 -0700 Subject: change qcom struct to hash of hashes to make it easier for the developer to read --- lib/Vyatta/Quagga/Config.pm | 39 +- scripts/bgp/vyatta-bgp.pl | 1542 ++++++++++++++++++++++++++++--------------- 2 files changed, 1038 insertions(+), 543 deletions(-) (limited to 'lib/Vyatta') diff --git a/lib/Vyatta/Quagga/Config.pm b/lib/Vyatta/Quagga/Config.pm index 4a6ca050..356afeac 100644 --- a/lib/Vyatta/Quagga/Config.pm +++ b/lib/Vyatta/Quagga/Config.pm @@ -29,27 +29,23 @@ my $_DEBUG = 0; my %_vtysh; my %_vtyshdel; my $_qcomref = ''; -my $_qcomdelref = ''; my $_vtyshexe = '/usr/bin/vtysh'; ### Public methods - # Create the class. # input: $1 - level of the Vyatta config tree to start at -# $2 - hashref to Quagga add/change command templates -# $3 - hashref to Quagga delete command templates +# $2 - hash of hashes ref to Quagga set/delete command templates sub new { my $that = shift; my $class = ref ($that) || $that; my $self = { _level => shift, _qcref => shift, - _qcdref => shift, }; $_qcomref = $self->{_qcref}; - $_qcomdelref = $self->{_qcdref}; - if (! _qtree($self->{_level}, 'delete')) { return 0; } + if (! _qtree($self->{_level}, 'del')) { return 0; } if (! _qtree($self->{_level}, 'set')) { return 0; } bless $self, $class; @@ -74,7 +70,7 @@ sub _reInitialize { %_vtysh = (); %_vtyshdel = (); - _qtree($self->{_level}, 'delete'); + _qtree($self->{_level}, 'del'); _qtree($self->{_level}, 'set'); } @@ -264,12 +260,14 @@ sub _qVarReplace { } # For given Vyatta config tree string, find a corresponding Quagga command template -# string as defined in correctly referenced %qcom. i.e. add or delete %qcom. +# string as defined in %qcom # input: $1 - Vyatta config tree string -# $2 - Quagga command template hash +# $2 - action (set|del) +# $3 - Quagga command template hash # output: %qcom hash key to corresponding Quagga command template string sub _qCommandFind { my $vyattaconfig = shift; + my $action = shift; my $qcom = shift; my $command = ''; @@ -280,14 +278,14 @@ sub _qCommandFind { # do same check again replacing the end param with var to see # if this is a var replacement foreach my $token (@nodes) { - if (exists $qcom->{$token}) { $command = $token; } - elsif (exists $qcom->{"$command $token"}) { $command = "$command $token"; } - elsif (exists $qcom->{"$command var"}) { $command = "$command var"; } + if (exists $qcom->{$token}->{$action}) { $command = $token; } + elsif (exists $qcom->{"$command $token"}->{$action}) { $command = "$command $token"; } + elsif (exists $qcom->{"$command var"}->{$action}) { $command = "$command var"; } else { return undef; } } # return hash key if Quagga command template string is found - if (defined $qcom->{$command}) { return $command; } + if (defined $qcom->{$command}->{$action}) { return $command; } else { return undef; } } @@ -301,6 +299,7 @@ sub _qtree { my @nodes; my ($qcom, $vtysh); + $qcom = $_qcomref; # It's ugly that I have to create a new Vyatta config object every time, # but something gets messed up on the stack if I don't. not sure @@ -310,15 +309,11 @@ sub _qtree { # setup references for set or delete action if ($action eq 'set') { - $qcom = $_qcomref; $vtysh = \%_vtysh; - @nodes = $config->listNodes(); } else { - $qcom = $_qcomdelref; $vtysh = \%_vtyshdel; - @nodes = $config->listDeleted(); } @@ -331,10 +326,10 @@ sub _qtree { # for set action, need to check that the node was actually changed. Otherwise # we end up re-writing every node to Quagga every commit, which is bad. Mmm' ok? - if (($action eq 'delete') || ($config->isChanged("$node"))) { + if (($action eq 'del') || ($config->isChanged("$node"))) { # is there a Quagga command template? # TODO: need to add function reference support to qcom hash for complicated nodes - my $qcommand = _qCommandFind("$level $node", $qcom); + my $qcommand = _qCommandFind("$level $node", $action, $qcom); # if I found a Quagga command template, then replace any vars if ($qcommand) { @@ -345,14 +340,14 @@ sub _qtree { # is this a leaf node? if ($val) { - my $var = _qVarReplace("$level $node $val", $qcom->{$qcommand}); + my $var = _qVarReplace("$level $node $val", $qcom->{$qcommand}->{$action}); push @{$vtysh->{"$qcommand"}}, $var; if ($_DEBUG) { print "DEBUG: _qtree leaf node command: set $level $action $node $val \n\t\t\t\t\t$var\n"; } } else { - my $var = _qVarReplace("$level $node", $qcom->{$qcommand}); + my $var = _qVarReplace("$level $node", $qcom->{$qcommand}->{$action}); push @{$vtysh->{"$qcommand"}}, $var; if ($_DEBUG) { print "DEBUG: _qtree node command: set $level $action $node \n\t\t\t\t$var\n"; @@ -361,7 +356,7 @@ sub _qtree { } } # recurse to next level in tree - _qtree("$level $node", 'delete'); + _qtree("$level $node", 'del'); _qtree("$level $node", 'set'); } } diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl index bdb31f56..12b1349f 100755 --- a/scripts/bgp/vyatta-bgp.pl +++ b/scripts/bgp/vyatta-bgp.pl @@ -39,526 +39,1026 @@ use Vyatta::Quagga::Config; use Vyatta::Misc; my %qcom = ( - "protocols" => undef, - "protocols bgp" => undef, - "protocols bgp var" => "router bgp #3", - "protocols bgp var aggregate-address" => undef, - "protocols bgp var aggregate-address var" => "router bgp #3 ; no aggregate-address #5 ; aggregate-address #5 ?as-set ?summary-only", - "protocols bgp var address-family" => undef, - "protocols bgp var address-family ipv6-unicast" => undef, - "protocols bgp var address-family ipv6-unicast aggregate-address" => undef, - "protocols bgp var address-family ipv6-unicast aggregate-address var" => "router bgp #3 ; no ipv6 bgp aggregate-address #7 ; ipv6 bgp aggregate-address #7 ?summary-only", - "protocols bgp var address-family ipv6-unicast network" => "router bgp #3 ; no ipv6 bgp network #7 ; ipv6 bgp network #7", - "protocols bgp var address-family ipv6-unicast redistribute" => undef, - "protocols bgp var address-family ipv6-unicast redistribute connected" => "router bgp #3 ; address-family ipv6 ; redistribute connected", - "protocols bgp var address-family ipv6-unicast redistribute connected metric" => "router bgp #3 ; address-family ipv6 ; redistribute connected metric #9", - "protocols bgp var address-family ipv6-unicast redistribute connected route-map" => "router bgp #3 ; address-family ipv6 ; redistribute connected route-map #9", - "protocols bgp var address-family ipv6-unicast redistribute kernel" => "router bgp #3 ; address-family ipv6 ; redistribute kernel", - "protocols bgp var address-family ipv6-unicast redistribute kernel metric" => "router bgp #3 ; address-family ipv6 ; redistribute kernel metric #9", - "protocols bgp var address-family ipv6-unicast redistribute kernel route-map" => "router bgp #3 ; address-family ipv6 ; redistribute kernel route-map #9", - "protocols bgp var address-family ipv6-unicast redistribute ospfv3" => "router bgp #3 ; address-family ipv6 ; redistribute ospfv3", - "protocols bgp var address-family ipv6-unicast redistribute ospfv3 metric" => "router bgp #3 ; address-family ipv6 ; redistribute ospfv3 metric #9", - "protocols bgp var address-family ipv6-unicast redistribute ospfv3 route-map" => "router bgp #3 ; address-family ipv6 ; redistribute ospfv3 route-map #9", - "protocols bgp var address-family ipv6-unicast redistribute ripng" => "router bgp #3 ; address-family ipv6 ; redistribute ripng", - "protocols bgp var address-family ipv6-unicast redistribute ripng metric" => "router bgp #3 ; address-family ipv6 ; redistribute ripng metric #9", - "protocols bgp var address-family ipv6-unicast redistribute ripng route-map" => "router bgp #3 ; address-family ipv6 ; redistribute ripng route-map #9", - "protocols bgp var address-family ipv6-unicast redistribute static" => "router bgp #3 ; address-family ipv6 ; redistribute static", - "protocols bgp var address-family ipv6-unicast redistribute static metric" => "router bgp #3 ; address-family ipv6 ; redistribute static metric #9", - "protocols bgp var address-family ipv6-unicast redistribute static route-map" => "router bgp #3 ; address-family ipv6 ; redistribute static route-map #9", - "protocols bgp var neighbor" => undef, - "protocols bgp var neighbor var" => "router bgp #3 ; neighbor #5", - "protocols bgp var neighbor var address-family" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast" => "router bgp #3 ; address-family ipv6 ; neighbor #5 activate",, - "protocols bgp var neighbor var address-family ipv6-unicast allowas-in" => "router bgp #3 ; address-family ipv6 ; neighbor #5 allowas-in", - "protocols bgp var neighbor var address-family ipv6-unicast attribute-unchanged" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 attribute-unchanged ; neighbor #5 attribute-unchanged ?as-path ?med ?next-hop", - "protocols bgp var neighbor var address-family ipv6-unicast capability" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast capability dynamic" => "router bgp #3 ; address-family ipv6 ; neighbor #5 capability dynamic", - "protocols bgp var neighbor var address-family ipv6-unicast capability orf" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast capability orf prefix-list" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast capability orf prefix-list receive" => "router bgp #3 ; address-family ipv6 ; neighbor #5 capability orf prefix-list receive", - "protocols bgp var neighbor var address-family ipv6-unicast capability orf prefix-list send" => "router bgp #3 ; address-family ipv6 ; neighbor #5 capability orf prefix-list send", - "protocols bgp var neighbor var address-family ipv6-unicast default-originate" => "router bgp #3 ; address-family ipv6 ; neighbor #5 default-originate", - "protocols bgp var neighbor var address-family ipv6-unicast default-originate route-map" => "router bgp #3 ; address-family ipv6 ; neighbor #5 default-originate route-map #10", - "protocols bgp var neighbor var address-family ipv6-unicast disable-send-community" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast disable-send-community extended" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 send-community extended", - "protocols bgp var neighbor var address-family ipv6-unicast disable-send-community standard" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 send-community standard", - "protocols bgp var neighbor var address-family ipv6-unicast distribute-list" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast distribute-list export" => "router bgp #3 ; address-family ipv6 ; neighbor #5 distribute-list #10 out", - "protocols bgp var neighbor var address-family ipv6-unicast distribute-list import" => "router bgp #3 ; address-family ipv6 ; neighbor #5 distribute-list #10 in", - "protocols bgp var neighbor var address-family ipv6-unicast filter-list" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast filter-list export" => "router bgp #3 ; address-family ipv6 ; neighbor #5 filter-list #10 out", - "protocols bgp var neighbor var address-family ipv6-unicast filter-list import" => "router bgp #3 ; address-family ipv6 ; neighbor #5 filter-list #10 in", - "protocols bgp var neighbor var address-family ipv6-unicast maximum-prefix" => "router bgp #3 ; address-family ipv6 ; neighbor #5 maximum-prefix #9", - "protocols bgp var neighbor var address-family ipv6-unicast nexthop-local" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast nexthop-local" => "router bgp #3 ; address-family ipv6 ; neighbor #5 nexthop-local unchanged", - "protocols bgp var neighbor var address-family ipv6-unicast nexthop-self" => "router bgp #3 ; address-family ipv6 ; neighbor #5 next-hop-self", - "protocols bgp var neighbor var address-family ipv6-unicast prefix-list" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast prefix-list export" => "router bgp #3 ; address-family ipv6 ; neighbor #5 prefix-list #10 out", - "protocols bgp var neighbor var address-family ipv6-unicast prefix-list import" => "router bgp #3 ; address-family ipv6 ; neighbor #5 prefix-list #10 in", - "protocols bgp var neighbor var address-family ipv6-unicast remove-private-as" => "router bgp #3 ; address-family ipv6 ; neighbor #5 remove-private-AS", - "protocols bgp var neighbor var address-family ipv6-unicast route-map" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast route-map export" => "router bgp #3 ; address-family ipv6 ; neighbor #5 route-map #10 out", - "protocols bgp var neighbor var address-family ipv6-unicast route-map import" => "router bgp #3 ; address-family ipv6 ; neighbor #5 route-map #10 in", - "protocols bgp var neighbor var address-family ipv6-unicast route-reflector-client" => "router bgp #3 ; address-family ipv6 ; neighbor #5 route-reflector-client", - "protocols bgp var neighbor var address-family ipv6-unicast route-server-client" => "router bgp #3 ; address-family ipv6 ; neighbor #5 route-server-client", - "protocols bgp var neighbor var address-family ipv6-unicast soft-reconfiguration" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast soft-reconfiguration inbound" => "router bgp #3 ; address-family ipv6 ; neighbor #5 soft-reconfiguration inbound", - "protocols bgp var neighbor var address-family ipv6-unicast unsuppress-map" => "router bgp #3 ; address-family ipv6 ; neighbor #5 unsuppress-map #9", - "protocols bgp var neighbor var advertisement-interval" => "router bgp #3 ; neighbor #5 advertisement-interval #7", - # allowas-in as a standalone means any number of times. append number and you will only accept local-as N number of times in as-path - "protocols bgp var neighbor var allowas-in" => "router bgp #3 ; neighbor #5 allowas-in", - # default is 3, default won't be shown in quagga - "protocols bgp var neighbor var allowas-in number" => "router bgp #3 ; neighbor #5 allowas-in #8", - # it looks like "attribute-unchanged" as a standalone is really "attribute-unchanged as-path med next-hop" - "protocols bgp var neighbor var attribute-unchanged" => "router bgp #3 ; no neighbor #5 attribute-unchanged ; neighbor #5 attribute-unchanged ?as-path ?med ?next-hop", - "protocols bgp var neighbor var capability" => undef, - "protocols bgp var neighbor var capability dynamic" => "router bgp #3 ; neighbor #5 capability dynamic", - "protocols bgp var neighbor var capability orf" => undef, - "protocols bgp var neighbor var capability orf prefix-list" => undef, - # if both send and receive are sent then this gets translated to both in Quagga config. Doesn't mess up the delete though. - "protocols bgp var neighbor var capability orf prefix-list receive" => "router bgp #3 ; neighbor #5 capability orf prefix-list receive", - "protocols bgp var neighbor var capability orf prefix-list send" => "router bgp #3 ; neighbor #5 capability orf prefix-list send", - "protocols bgp var neighbor var default-originate" => "router bgp #3 ; neighbor #5 default-originate", - "protocols bgp var neighbor var default-originate route-map" => "router bgp #3 ; neighbor #5 default-originate route-map #8", - "protocols bgp var neighbor var disable-capability-negotiation" => "router bgp #3 ; neighbor #5 dont-capability-negotiate", - "protocols bgp var neighbor var disable-connected-check" => "router bgp #3 ; neighbor #5 disable-connected-check", - "protocols bgp var neighbor var disable-send-community" => undef, - "protocols bgp var neighbor var disable-send-community extended" => "router bgp #3 ; no neighbor #5 send-community extended", - "protocols bgp var neighbor var disable-send-community standard" => "router bgp #3 ; no neighbor #5 send-community standard", - "protocols bgp var neighbor var distribute-list" => undef, - "protocols bgp var neighbor var distribute-list export" => "router bgp #3 ; neighbor #5 distribute-list #8 out", - "protocols bgp var neighbor var distribute-list import" => "router bgp #3 ; neighbor #5 distribute-list #8 in", - "protocols bgp var neighbor var ebgp-multihop" => "router bgp #3 ; neighbor #5 ebgp-multihop #7", - "protocols bgp var neighbor var ttl-security" => undef, - "protocols bgp var neighbor var ttl-security hops" => "router bgp #3 ; neighbor #5 ttl-security hops #8", - "protocols bgp var neighbor var filter-list" => undef, - "protocols bgp var neighbor var filter-list export" => "router bgp #3 ; neighbor #5 filter-list #8 out", - "protocols bgp var neighbor var filter-list import" => "router bgp #3 ; neighbor #5 filter-list #8 in", - "protocols bgp var neighbor var local-as" => undef, - "protocols bgp var neighbor var local-as var" => "router bgp #3 ; no neighbor #5 local-as #7 ; neighbor #5 local-as #7", - "protocols bgp var neighbor var local-as var no-prepend" => "router bgp #3 ; no neighbor #5 local-as #7 ; neighbor #5 local-as #7 no-prepend", - "protocols bgp var neighbor var maximum-prefix" => "router bgp #3 ; neighbor #5 maximum-prefix #7", - "protocols bgp var neighbor var nexthop-self" => "router bgp #3 ; neighbor #5 next-hop-self", - "protocols bgp var neighbor var override-capability" => "router bgp #3 ; neighbor #5 override-capability", - "protocols bgp var neighbor var passive" => "router bgp #3 ; neighbor #5 passive", - "protocols bgp var neighbor var password" => "router bgp #3 ; neighbor #5 password #7", - "protocols bgp var neighbor var peer-group" => "router bgp #3 ; neighbor #5 peer-group #7", - "protocols bgp var neighbor var port" => "router bgp #3 ; neighbor #5 port #7", - "protocols bgp var neighbor var prefix-list" => undef, - "protocols bgp var neighbor var prefix-list export" => "router bgp #3 ; neighbor #5 prefix-list #8 out", - "protocols bgp var neighbor var prefix-list import" => "router bgp #3 ; neighbor #5 prefix-list #8 in", - "protocols bgp var neighbor var remote-as" => "router bgp #3 ; neighbor #5 remote-as #7", - "protocols bgp var neighbor var remove-private-as" => "router bgp #3 ; neighbor #5 remove-private-AS", - "protocols bgp var neighbor var route-map" => undef, - "protocols bgp var neighbor var route-map export" => "router bgp #3 ; neighbor #5 route-map #8 out", - "protocols bgp var neighbor var route-map import" => "router bgp #3 ; neighbor #5 route-map #8 in", - "protocols bgp var neighbor var route-reflector-client" => "router bgp #3 ; neighbor #5 route-reflector-client", - "protocols bgp var neighbor var route-server-client" => "router bgp #3 ; neighbor #5 route-server-client", - "protocols bgp var neighbor var shutdown" => "router bgp #3 ; neighbor #5 shutdown", - "protocols bgp var neighbor var soft-reconfiguration" => undef, - "protocols bgp var neighbor var soft-reconfiguration inbound" => "router bgp #3 ; neighbor #5 soft-reconfiguration inbound", - "protocols bgp var neighbor var strict-capability-match" => "router bgp #3 ; neighbor #5 strict-capability-match", - "protocols bgp var neighbor var timers" => 'router bgp #3 ; neighbor #5 timers @keepalive @holdtime', - "protocols bgp var neighbor var timers connect" => "router bgp #3 ; neighbor #5 timers connect #8", - "protocols bgp var neighbor var unsuppress-map" => "router bgp #3 ; neighbor #5 unsuppress-map #7", - "protocols bgp var neighbor var update-source" => "router bgp #3 ; neighbor #5 update-source #7", - "protocols bgp var neighbor var weight" => "router bgp #3 ; neighbor #5 weight #7", - "protocols bgp var network" => undef, - "protocols bgp var network var" => "router bgp #3 ; network #5 ?backdoor", - "protocols bgp var network var route-map" => "router bgp #3 ; network #5 route-map #7", - "protocols bgp var parameters" => undef, - "protocols bgp var parameters always-compare-med" => "router bgp #3 ; bgp always-compare-med", - "protocols bgp var parameters bestpath" => undef, - "protocols bgp var parameters bestpath as-path" => undef, - "protocols bgp var parameters bestpath as-path confed" => "router bgp #3 ; bgp bestpath as-path confed", - "protocols bgp var parameters bestpath as-path ignore" => "router bgp #3 ; bgp bestpath as-path ignore", - "protocols bgp var parameters bestpath compare-routerid" => "router bgp #3 ; bgp bestpath compare-routerid", - "protocols bgp var parameters bestpath med" => undef, - "protocols bgp var parameters bestpath med confed" => "router bgp #3 ; bgp bestpath med confed", - "protocols bgp var parameters bestpath med missing-as-worst" => "router bgp #3 ; bgp bestpath med missing-as-worst", - "protocols bgp var parameters cluster-id" => "router bgp #3 ; bgp cluster-id #6", - "protocols bgp var parameters confederation" => undef, - "protocols bgp var parameters confederation identifier" => "router bgp #3 ; bgp confederation identifier #7", - "protocols bgp var parameters confederation peers" => "router bgp #3 ; bgp confederation peers #7", - "protocols bgp var parameters dampening" => 'router bgp #3 ; no bgp dampening ; bgp dampening @half-life @re-use @start-suppress-time @max-suppress-time', - "protocols bgp var parameters default" => undef, - "protocols bgp var parameters default local-pref" => "router bgp #3 ; bgp default local-preference #7", - "protocols bgp var parameters default no-ipv4-unicast" => "router bgp #3 ; no bgp default ipv4-unicast", - "protocols bgp var parameters deterministic-med" => "router bgp #3 ; bgp deterministic-med", - "protocols bgp var parameters disable-network-import-check" => "router bgp #3 ; no bgp network import-check", - "protocols bgp var parameters enforce-first-as" => "router bgp #3 ; bgp enforce-first-as", - "protocols bgp var parameters graceful-restart" => undef, - "protocols bgp var parameters graceful-restart stalepath-time" => "router bgp #3 ; bgp graceful-restart stalepath-time #7", - "protocols bgp var parameters log-neighbor-changes" => "router bgp #3 ; bgp log-neighbor-changes", - "protocols bgp var parameters no-client-to-client-reflection" => "router bgp #3 ; no bgp client-to-client reflection", - "protocols bgp var parameters no-fast-external-failover" => "router bgp #3 ; no bgp fast-external-failover", - "protocols bgp var parameters router-id" => "router bgp #3 ; bgp router-id #6", - "protocols bgp var parameters scan-time" => "router bgp #3 ; bgp scan-time #6", - "protocols bgp var peer-group" => undef, - "protocols bgp var peer-group var" => "router bgp #3 ; neighbor #5 peer-group", - "protocols bgp var peer-group var address-family" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast" => "router bgp #3 ; address-family ipv6 ; neighbor #5 activate", - "protocols bgp var peer-group var address-family ipv6-unicast allowas-in" => "router bgp #3 ; address-family ipv6 ; neighbor #5 allowas-in", - "protocols bgp var peer-group var address-family ipv6-unicast attribute-unchanged" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 attribute-unchanged ; neighbor #5 attribute-unchanged ?as-path ?med ?next-hop", - "protocols bgp var peer-group var address-family ipv6-unicast capability" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast capability dynamic" => "router bgp #3 ; address-family ipv6 ; neighbor #5 capability dynamic", - "protocols bgp var peer-group var address-family ipv6-unicast capability orf" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast capability orf prefix-list" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast capability orf prefix-list receive" => "router bgp #3 ; address-family ipv6 ; neighbor #5 capability orf prefix-list receive", - "protocols bgp var peer-group var address-family ipv6-unicast capability orf prefix-list send" => "router bgp #3 ; address-family ipv6 ; neighbor #5 capability orf prefix-list send", - "protocols bgp var peer-group var address-family ipv6-unicast default-originate" => "router bgp #3 ; address-family ipv6 ; neighbor #5 default-originate", - "protocols bgp var peer-group var address-family ipv6-unicast default-originate route-map" => "router bgp #3 ; address-family ipv6 ; neighbor #5 default-originate route-map #10", - "protocols bgp var peer-group var address-family ipv6-unicast disable-send-community" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast disable-send-community extended" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 send-community extended", - "protocols bgp var peer-group var address-family ipv6-unicast disable-send-community standard" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 send-community standard", - "protocols bgp var peer-group var address-family ipv6-unicast distribute-list" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast distribute-list export" => "router bgp #3 ; address-family ipv6 ; neighbor #5 distribute-list #10 out", - "protocols bgp var peer-group var address-family ipv6-unicast distribute-list import" => "router bgp #3 ; address-family ipv6 ; neighbor #5 distribute-list #10 in", - "protocols bgp var peer-group var address-family ipv6-unicast filter-list" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast filter-list export" => "router bgp #3 ; address-family ipv6 ; neighbor #5 filter-list #10 out", - "protocols bgp var peer-group var address-family ipv6-unicast filter-list import" => "router bgp #3 ; address-family ipv6 ; neighbor #5 filter-list #10 in", - "protocols bgp var peer-group var address-family ipv6-unicast maximum-prefix" => "router bgp #3 ; address-family ipv6 ; neighbor #5 maximum-prefix #9", - "protocols bgp var peer-group var address-family ipv6-unicast nexthop-local" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast nexthop-local" => "router bgp #3 ; address-family ipv6 ; neighbor #5 nexthop-local unchanged", - "protocols bgp var peer-group var address-family ipv6-unicast nexthop-self" => "router bgp #3 ; address-family ipv6 ; neighbor #5 next-hop-self", - "protocols bgp var peer-group var address-family ipv6-unicast prefix-list" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast prefix-list export" => "router bgp #3 ; address-family ipv6 ; neighbor #5 prefix-list #10 out", - "protocols bgp var peer-group var address-family ipv6-unicast prefix-list import" => "router bgp #3 ; address-family ipv6 ; neighbor #5 prefix-list #10 in", - "protocols bgp var peer-group var address-family ipv6-unicast remove-private-as" => "router bgp #3 ; address-family ipv6 ; neighbor #5 remove-private-AS", - "protocols bgp var peer-group var address-family ipv6-unicast route-map" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast route-map export" => "router bgp #3 ; address-family ipv6 ; neighbor #5 route-map #10 out", - "protocols bgp var peer-group var address-family ipv6-unicast route-map import" => "router bgp #3 ; address-family ipv6 ; neighbor #5 route-map #10 in", - "protocols bgp var peer-group var address-family ipv6-unicast route-reflector-client" => "router bgp #3 ; address-family ipv6 ; neighbor #5 route-reflector-client", - "protocols bgp var peer-group var address-family ipv6-unicast route-server-client" => "router bgp #3 ; address-family ipv6 ; neighbor #5 route-server-client", - "protocols bgp var peer-group var address-family ipv6-unicast soft-reconfiguration" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast soft-reconfiguration inbound" => "router bgp #3 ; address-family ipv6 ; neighbor #5 soft-reconfiguration inbound", - "protocols bgp var peer-group var address-family ipv6-unicast unsuppress-map" => "router bgp #3 ; address-family ipv6 ; neighbor #5 unsuppress-map #9", - "protocols bgp var peer-group var allowas-in" => "router bgp #3 ; neighbor #5 allowas-in", - "protocols bgp var peer-group var allowas-in number" => "router bgp #3 ; neighbor #5 allowas-in #8", - "protocols bgp var peer-group var attribute-unchanged" => "router bgp #3 ; no neighbor #5 attribute-unchanged ; neighbor #5 attribute-unchanged ?as-path ?med ?next-hop", - "protocols bgp var peer-group var capability" => undef, - "protocols bgp var peer-group var capability dynamic" => "router bgp #3 ; neighbor #5 capability dynamic", - "protocols bgp var peer-group var capability orf" => undef, - "protocols bgp var peer-group var capability orf prefix-list" => undef, - "protocols bgp var peer-group var capability orf prefix-list receive" => "router bgp #3 ; neighbor #5 capability orf prefix-list receive", - "protocols bgp var peer-group var capability orf prefix-list send" => "router bgp #3 ; neighbor #5 capability orf prefix-list send", - "protocols bgp var peer-group var default-originate" => "router bgp #3 ; neighbor #5 default-originate", - "protocols bgp var peer-group var default-originate route-map" => "router bgp #3 ; neighbor #5 default-originate route-map #8", - "protocols bgp var peer-group var disable-capability-negotiation" => "router bgp #3 ; neighbor #5 dont-capability-negotiate", - "protocols bgp var peer-group var disable-connected-check" => "router bgp #3 ; neighbor #5 disable-connected-check", - "protocols bgp var peer-group var disable-send-community" => undef, - "protocols bgp var peer-group var disable-send-community extended" => "router bgp #3 ; no neighbor #5 send-community extended", - "protocols bgp var peer-group var disable-send-community standard" => "router bgp #3 ; no neighbor #5 send-community standard", - "protocols bgp var peer-group var distribute-list" => undef, - "protocols bgp var peer-group var distribute-list export" => "router bgp #3 ; neighbor #5 distribute-list #8 out", - "protocols bgp var peer-group var distribute-list import" => "router bgp #3 ; neighbor #5 distribute-list #8 in", - "protocols bgp var peer-group var ebgp-multihop" => "router bgp #3 ; neighbor #5 ebgp-multihop #7", - "protocols bgp var peer-group var filter-list" => undef, - "protocols bgp var peer-group var filter-list export" => "router bgp #3 ; neighbor #5 filter-list #8 out", - "protocols bgp var peer-group var filter-list import" => "router bgp #3 ; neighbor #5 filter-list #8 in", - "protocols bgp var peer-group var local-as" => undef, - "protocols bgp var peer-group var local-as var" => "router bgp #3 ; no neighbor #5 local-as #7 ; neighbor #5 local-as #7", - "protocols bgp var peer-group var local-as var no-prepend" => "router bgp #3 ; no neighbor #5 local-as #7 ; neighbor #5 local-as #7 no-prepend", - "protocols bgp var peer-group var maximum-prefix" => "router bgp #3 ; neighbor #5 maximum-prefix #7", - "protocols bgp var peer-group var nexthop-self" => "router bgp #3 ; neighbor #5 next-hop-self", - "protocols bgp var peer-group var override-capability" => "router bgp #3 ; neighbor #5 override-capability", - "protocols bgp var peer-group var passive" => "router bgp #3 ; neighbor #5 passive", - "protocols bgp var peer-group var password" => "router bgp #3 ; neighbor #5 password #7", - "protocols bgp var peer-group var port" => "router bgp #3 ; neighbor #5 port #7", - "protocols bgp var peer-group var prefix-list" => undef, - "protocols bgp var peer-group var prefix-list export" => "router bgp #3 ; neighbor #5 prefix-list #8 out", - "protocols bgp var peer-group var prefix-list import" => "router bgp #3 ; neighbor #5 prefix-list #8 in", - "protocols bgp var peer-group var remote-as" => "router bgp #3 ; neighbor #5 peer-group ; neighbor #5 remote-as #7", - "protocols bgp var peer-group var remove-private-as" => "router bgp #3 ; neighbor #5 remove-private-AS", - "protocols bgp var peer-group var route-map" => undef, - "protocols bgp var peer-group var route-map export" => "router bgp #3 ; neighbor #5 route-map #8 out", - "protocols bgp var peer-group var route-map import" => "router bgp #3 ; neighbor #5 route-map #8 in", - "protocols bgp var peer-group var route-reflector-client" => "router bgp #3 ; neighbor #5 route-reflector-client", - "protocols bgp var peer-group var route-server-client" => "router bgp #3 ; neighbor #5 route-server-client", - "protocols bgp var peer-group var shutdown" => "router bgp #3 ; neighbor #5 shutdown", - "protocols bgp var peer-group var soft-reconfiguration" => undef, - "protocols bgp var peer-group var soft-reconfiguration inbound" => "router bgp #3 ; neighbor #5 soft-reconfiguration inbound", - "protocols bgp var peer-group var timers" => 'router bgp #3 ; neighbor #5 timers @keepalive @holdtime', - "protocols bgp var peer-group var timers connect" => "router bgp #3 ; neighbor #5 timers connect #8", - "protocols bgp var peer-group var unsuppress-map" => "router bgp #3 ; neighbor #5 unsuppress-map #7", - "protocols bgp var peer-group var update-source" => "router bgp #3 ; neighbor #5 update-source #7", - "protocols bgp var peer-group var weight" => "router bgp #3 ; neighbor #5 weight #7", - "protocols bgp var redistribute" => undef, - "protocols bgp var redistribute connected" => "router bgp #3 ; redistribute connected", - "protocols bgp var redistribute connected metric" => "router bgp #3 ; redistribute connected metric #7", - "protocols bgp var redistribute connected route-map" => "router bgp #3 ; redistribute connected route-map #7", - "protocols bgp var redistribute kernel" => "router bgp #3 ; redistribute kernel", - "protocols bgp var redistribute kernel metric" => "router bgp #3 ; redistribute kernel metric #7", - "protocols bgp var redistribute kernel route-map" => "router bgp #3 ; redistribute kernel route-map #7", - "protocols bgp var redistribute ospf" => "router bgp #3 ; redistribute ospf", - "protocols bgp var redistribute ospf metric" => "router bgp #3 ; redistribute ospf metric #7", - "protocols bgp var redistribute ospf route-map" => "router bgp #3 ; redistribute ospf route-map #7", - "protocols bgp var redistribute rip" => "router bgp #3 ; redistribute rip", - "protocols bgp var redistribute rip metric" => "router bgp #3 ; redistribute rip metric #7", - "protocols bgp var redistribute rip route-map" => "router bgp #3 ; redistribute rip route-map #7", - "protocols bgp var redistribute static" => "router bgp #3 ; redistribute static", - "protocols bgp var redistribute static metric" => "router bgp #3 ; redistribute static metric #7", - "protocols bgp var redistribute static route-map" => "router bgp #3 ; redistribute static route-map #7", - "protocols bgp var timers" => 'router bgp #3 ; timers bgp @keepalive @holdtime', -); - -my %qcomdel = ( - "protocols" => undef, - "protocols bgp" => undef, - "protocols bgp var" => "no router bgp #3", - "protocols bgp var aggregate-address" => undef, - "protocols bgp var aggregate-address var" => "router bgp #3 ; no aggregate-address #5 ?as-set ?summary-only", - "protocols bgp var address-family" => undef, - "protocols bgp var address-family ipv6-unicast" => undef, - "protocols bgp var address-family ipv6-unicast aggregate-address" => undef, - "protocols bgp var address-family ipv6-unicast aggregate-address var" => "router bgp #3 ; no ipv6 bgp aggregate-address #7", - "protocols bgp var address-family ipv6-unicast network" => "router bgp #3 ; no ipv6 bgp network #7 ; no ipv6 bgp network #7", - "protocols bgp var address-family ipv6-unicast redistribute" => undef, - "protocols bgp var address-family ipv6-unicast redistribute connected" => "router bgp #3 ; address-family ipv6 ; no redistribute connected", - "protocols bgp var address-family ipv6-unicast redistribute connected metric" => "router bgp #3 ; address-family ipv6 ; no redistribute connected metric #9", - "protocols bgp var address-family ipv6-unicast redistribute connected route-map" => "router bgp #3 ; address-family ipv6 ; no redistribute connected route-map #9", - "protocols bgp var address-family ipv6-unicast redistribute kernel" => "router bgp #3 ; address-family ipv6 ; no redistribute kernel", - "protocols bgp var address-family ipv6-unicast redistribute kernel metric" => "router bgp #3 ; address-family ipv6 ; no redistribute kernel metric #9", - "protocols bgp var address-family ipv6-unicast redistribute kernel route-map" => "router bgp #3 ; address-family ipv6 ; no redistribute kernel route-map #9", - "protocols bgp var address-family ipv6-unicast redistribute ospfv3" => "router bgp #3 ; address-family ipv6 ; no redistribute ospfv3", - "protocols bgp var address-family ipv6-unicast redistribute ospfv3 metric" => "router bgp #3 ; address-family ipv6 ; no redistribute ospfv3 metric #9", - "protocols bgp var address-family ipv6-unicast redistribute ospfv3 route-map" => "router bgp #3 ; address-family ipv6 ; no redistribute ospfv3 route-map #9", - "protocols bgp var address-family ipv6-unicast redistribute ripng" => "router bgp #3 ; address-family ipv6 ; no redistribute ripng", - "protocols bgp var address-family ipv6-unicast redistribute ripng metric" => "router bgp #3 ; address-family ipv6 ; no redistribute ripng metric #9", - "protocols bgp var address-family ipv6-unicast redistribute ripng route-map" => "router bgp #3 ; address-family ipv6 ; no redistribute ripng route-map #9", - "protocols bgp var address-family ipv6-unicast redistribute static" => "router bgp #3 ; address-family ipv6 ; no redistribute static", - "protocols bgp var address-family ipv6-unicast redistribute static metric" => "router bgp #3 ; address-family ipv6 ; no redistribute static metric #9", - "protocols bgp var address-family ipv6-unicast redistribute static route-map" => "router bgp #3 ; address-family ipv6 ; no redistribute static route-map #9", - "protocols bgp var neighbor" => undef, - "protocols bgp var neighbor var" => "router bgp #3 ; no neighbor #5", - "protocols bgp var neighbor var address-family" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 activate", - "protocols bgp var neighbor var address-family ipv6-unicast allowas-in" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 allowas-in", - "protocols bgp var neighbor var address-family ipv6-unicast attribute-unchanged" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 attribute-unchanged", - "protocols bgp var neighbor var address-family ipv6-unicast capability" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast capability dynamic" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 capability dynamic", - "protocols bgp var neighbor var address-family ipv6-unicast capability orf" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast capability orf prefix-list" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast capability orf prefix-list receive" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 capability orf prefix-list receive", - "protocols bgp var neighbor var address-family ipv6-unicast capability orf prefix-list send" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 capability orf prefix-list send", - "protocols bgp var neighbor var address-family ipv6-unicast default-originate" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 default-originate", - "protocols bgp var neighbor var address-family ipv6-unicast default-originate route-map" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 default-originate route-map #10", - "protocols bgp var neighbor var address-family ipv6-unicast disable-send-community" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast disable-send-community extended" => "router bgp #3 ; address-family ipv6 ; neighbor #5 send-community extended", - "protocols bgp var neighbor var address-family ipv6-unicast disable-send-community standard" => "router bgp #3 ; address-family ipv6 ; neighbor #5 send-community standard", - "protocols bgp var neighbor var address-family ipv6-unicast distribute-list" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast distribute-list export" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 distribute-list #10 out", - "protocols bgp var neighbor var address-family ipv6-unicast distribute-list import" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 distribute-list #10 in", - "protocols bgp var neighbor var address-family ipv6-unicast filter-list" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast filter-list export" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 filter-list #10 out", - "protocols bgp var neighbor var address-family ipv6-unicast filter-list import" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 filter-list #10 in", - "protocols bgp var neighbor var address-family ipv6-unicast maximum-prefix" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 maximum-prefix #9", - "protocols bgp var neighbor var address-family ipv6-unicast nexthop-local" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast nexthop-local" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 nexthop-local unchanged", - "protocols bgp var neighbor var address-family ipv6-unicast nexthop-self" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 next-hop-self", - "protocols bgp var neighbor var address-family ipv6-unicast prefix-list" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast prefix-list export" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 prefix-list #10 out", - "protocols bgp var neighbor var address-family ipv6-unicast prefix-list import" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 prefix-list #10 in", - "protocols bgp var neighbor var address-family ipv6-unicast remove-private-as" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 remove-private-AS", - "protocols bgp var neighbor var address-family ipv6-unicast route-map" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast route-map export" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 route-map #10 out", - "protocols bgp var neighbor var address-family ipv6-unicast route-map import" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 route-map #10 in", - "protocols bgp var neighbor var address-family ipv6-unicast route-reflector-client" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 route-reflector-client", - "protocols bgp var neighbor var address-family ipv6-unicast route-server-client" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 route-server-client", - "protocols bgp var neighbor var address-family ipv6-unicast soft-reconfiguration" => undef, - "protocols bgp var neighbor var address-family ipv6-unicast soft-reconfiguration inbound" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 soft-reconfiguration inbound", - "protocols bgp var neighbor var address-family ipv6-unicast unsuppress-map" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 unsuppress-map #9", - "protocols bgp var neighbor var advertisement-interval" => "router bgp #3 ; no neighbor #5 advertisement-interval", - "protocols bgp var neighbor var allowas-in" => "router bgp #3 ; no neighbor #5 allowas-in", - "protocols bgp var neighbor var allowas-in number" => "router bgp #3 ; no neighbor #5 allowas-in #8 ; neighbor #5 allowas-in", - "protocols bgp var neighbor var attribute-unchanged" => "router bgp #3 ; no neighbor #5 attribute-unchanged ?as-path ?med ?next-hop", - "protocols bgp var neighbor var capability" => undef, - "protocols bgp var neighbor var capability dynamic" => "router bgp #3 ; no neighbor #5 capability dynamic", - "protocols bgp var neighbor var capability orf" => undef, - "protocols bgp var neighbor var capability orf prefix-list" => undef, - "protocols bgp var neighbor var capability orf prefix-list receive" => "router bgp #3 ; no neighbor #5 capability orf prefix-list receive", - "protocols bgp var neighbor var capability orf prefix-list send" => "router bgp #3 ; no neighbor #5 capability orf prefix-list send", - "protocols bgp var neighbor var default-originate" => "router bgp #3 ; no neighbor #5 default-originate", - "protocols bgp var neighbor var default-originate route-map" => "router bgp #3 ; no neighbor #5 default-originate route-map #8", - "protocols bgp var neighbor var disable-capability-negotiation" => "router bgp #3 ; no neighbor #5 dont-capability-negotiate", - "protocols bgp var neighbor var disable-connected-check" => "router bgp #3 ; no neighbor #5 disable-connected-check", - "protocols bgp var neighbor var disable-send-community" => undef, - "protocols bgp var neighbor var disable-send-community extended" => "router bgp #3 ; neighbor #5 send-community extended", - "protocols bgp var neighbor var disable-send-community standard" => "router bgp #3 ; neighbor #5 send-community standard", - "protocols bgp var neighbor var distribute-list" => undef, - "protocols bgp var neighbor var distribute-list export" => "router bgp #3 ; no neighbor #5 distribute-list #8 out", - "protocols bgp var neighbor var distribute-list import" => "router bgp #3 ; no neighbor #5 distribute-list #8 in", - "protocols bgp var neighbor var ebgp-multihop" => "router bgp #3 ; no neighbor #5 ebgp-multihop", - "protocols bgp var neighbor var ttl-security" => undef, - "protocols bgp var neighbor var ttl-security hops" => "router bgp #3 ; no neighbor #5 ttl-security hops", - "protocols bgp var neighbor var filter-list" => undef, - "protocols bgp var neighbor var filter-list export" => "router bgp #3 ; no neighbor #5 filter-list #8 out", - "protocols bgp var neighbor var filter-list import" => "router bgp #3 ; no neighbor #5 filter-list #8 in", - "protocols bgp var neighbor var local-as" => "router bgp #3 ; no neighbor #5 local-as", - "protocols bgp var neighbor var local-as no-prepend" => "router bgp #3 ; no neighbor #5 local-as #7 no-prepend ; neighbor #5 local-as #7", - "protocols bgp var neighbor var maximum-prefix" => "router bgp #3 ; no neighbor #5 maximum-prefix", - "protocols bgp var neighbor var nexthop-self" => "router bgp #3 ; no neighbor #5 next-hop-self", - "protocols bgp var neighbor var override-capability" => "router bgp #3 ; no neighbor #5 override-capability", - "protocols bgp var neighbor var passive" => "router bgp #3 ; no neighbor #5 passive", - "protocols bgp var neighbor var password" => "router bgp #3 ; no neighbor #5 password", - "protocols bgp var neighbor var peer-group" => "router bgp #3 ; no neighbor #5 peer-group #7", - "protocols bgp var neighbor var port" => "router bgp #3 ; no neighbor #5 port", - "protocols bgp var neighbor var prefix-list" => undef, - "protocols bgp var neighbor var prefix-list export" => "router bgp #3 ; no neighbor #5 prefix-list #8 out", - "protocols bgp var neighbor var prefix-list import" => "router bgp #3 ; no neighbor #5 prefix-list #8 in", - "protocols bgp var neighbor var remote-as" => "router bgp #3 ; no neighbor #5 remote-as #7", - "protocols bgp var neighbor var remove-private-as" => "router bgp #3 ; no neighbor #5 remove-private-AS", - "protocols bgp var neighbor var route-map" => undef, - "protocols bgp var neighbor var route-map export" => "router bgp #3 ; no neighbor #5 route-map #8 out", - "protocols bgp var neighbor var route-map import" => "router bgp #3 ; no neighbor #5 route-map #8 in", - "protocols bgp var neighbor var route-reflector-client" => "router bgp #3 ; no neighbor #5 route-reflector-client", - "protocols bgp var neighbor var route-server-client" => "router bgp #3 ; no neighbor #5 route-server-client", - "protocols bgp var neighbor var shutdown" => "router bgp #3 ; no neighbor #5 shutdown", - "protocols bgp var neighbor var soft-reconfiguration" => undef, - "protocols bgp var neighbor var soft-reconfiguration inbound" => "router bgp #3 ; no neighbor #5 soft-reconfiguration inbound", - "protocols bgp var neighbor var strict-capability-match" => "router bgp #3 ; no neighbor #5 strict-capability-match", - "protocols bgp var neighbor var timers" => 'router bgp #3 ; no neighbor #5 timers', - "protocols bgp var neighbor var timers connect" => "router bgp #3 ; no neighbor #5 timers connect", - "protocols bgp var neighbor var unsuppress-map" => "router bgp #3 ; no neighbor #5 unsuppress-map #7", - "protocols bgp var neighbor var update-source" => "router bgp #3 ; no neighbor #5 update-source", - "protocols bgp var neighbor var weight" => "router bgp #3 ; no neighbor #5 weight", - "protocols bgp var network" => undef, - "protocols bgp var network var" => "router bgp #3 ; no network #5", - "protocols bgp var network var route-map" => "router bgp #3 ; no network #5 route-map #7", - "protocols bgp var parameters" => undef, - "protocols bgp var parameters always-compare-med" => "router bgp #3 ; no bgp always-compare-med", - "protocols bgp var parameters bestpath" => undef, - "protocols bgp var parameters bestpath as-path" => undef, - "protocols bgp var parameters bestpath as-path confed" => "router bgp #3 ; no bgp bestpath as-path confed", - "protocols bgp var parameters bestpath as-path ignore" => "router bgp #3 ; no bgp bestpath as-path ignore", - "protocols bgp var parameters bestpath compare-routerid" => "router bgp #3 ; no bgp bestpath compare-routerid", - "protocols bgp var parameters bestpath med" => undef, - "protocols bgp var parameters bestpath med confed" => "router bgp #3 ; no bgp bestpath med confed", - "protocols bgp var parameters bestpath med missing-as-worst" => "router bgp #3 ; no bgp bestpath med missing-as-worst", - "protocols bgp var parameters cluster-id" => "router bgp #3 ; no bgp cluster-id #6", - "protocols bgp var parameters confederation" => undef, - "protocols bgp var parameters confederation identifier" => "router bgp #3 ; no bgp confederation identifier #7", - "protocols bgp var parameters confederation peers" => "router bgp #3 ; no bgp confederation peers #7", - "protocols bgp var parameters dampening" => "router bgp #3 ; no bgp dampening", - "protocols bgp var parameters default" => undef, - "protocols bgp var parameters default local-pref" => "router bgp #3 ; no bgp default local-preference #7", - "protocols bgp var parameters default no-ipv4-unicast" => "router bgp #3 ; bgp default ipv4-unicast", - "protocols bgp var parameters deterministic-med" => "router bgp #3 ; no bgp deterministic-med", - "protocols bgp var parameters disable-network-import-check" => "router bgp #3 ; bgp network import-check", - "protocols bgp var parameters enforce-first-as" => "router bgp #3 ; no bgp enforce-first-as", - "protocols bgp var parameters graceful-restart" => undef, - "protocols bgp var parameters graceful-restart stalepath-time" => "router bgp #3 ; no bgp graceful-restart stalepath-time #7", - "protocols bgp var parameters log-neighbor-changes" => "router bgp #3 ; no bgp log-neighbor-changes", - "protocols bgp var parameters no-client-to-client-reflection" => "router bgp #3 ; bgp client-to-client reflection", - "protocols bgp var parameters no-fast-external-failover" => "router bgp #3 ; bgp fast-external-failover", - "protocols bgp var parameters router-id" => "router bgp #3 ; no bgp router-id #6", - "protocols bgp var parameters scan-time" => "router bgp #3 ; no bgp scan-time #6", - "protocols bgp var peer-group" => undef, - "protocols bgp var peer-group var" => "router bgp #3 ; no neighbor #5 peer-group", - "protocols bgp var peer-group var address-family" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 activate", - "protocols bgp var peer-group var address-family ipv6-unicast allowas-in" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 allowas-in", - "protocols bgp var peer-group var address-family ipv6-unicast attribute-unchanged" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 attribute-unchanged", - "protocols bgp var peer-group var address-family ipv6-unicast capability" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast capability dynamic" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 capability dynamic", - "protocols bgp var peer-group var address-family ipv6-unicast capability orf" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast capability orf prefix-list" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast capability orf prefix-list receive" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 capability orf prefix-list receive", - "protocols bgp var peer-group var address-family ipv6-unicast capability orf prefix-list send" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 capability orf prefix-list send", - "protocols bgp var peer-group var address-family ipv6-unicast default-originate" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 default-originate", - "protocols bgp var peer-group var address-family ipv6-unicast default-originate route-map" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 default-originate route-map #10", - "protocols bgp var peer-group var address-family ipv6-unicast disable-send-community" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast disable-send-community extended" => "router bgp #3 ; address-family ipv6 ; neighbor #5 send-community extended", - "protocols bgp var peer-group var address-family ipv6-unicast disable-send-community standard" => "router bgp #3 ; address-family ipv6 ; neighbor #5 send-community standard", - "protocols bgp var peer-group var address-family ipv6-unicast distribute-list" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast distribute-list export" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 distribute-list #10 out", - "protocols bgp var peer-group var address-family ipv6-unicast distribute-list import" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 distribute-list #10 in", - "protocols bgp var peer-group var address-family ipv6-unicast filter-list" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast filter-list export" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 filter-list #10 out", - "protocols bgp var peer-group var address-family ipv6-unicast filter-list import" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 filter-list #10 in", - "protocols bgp var peer-group var address-family ipv6-unicast maximum-prefix" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 maximum-prefix #9", - "protocols bgp var peer-group var address-family ipv6-unicast nexthop-local" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast nexthop-local" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 nexthop-local unchanged", - "protocols bgp var peer-group var address-family ipv6-unicast nexthop-self" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 next-hop-self", - "protocols bgp var peer-group var address-family ipv6-unicast prefix-list" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast prefix-list export" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 prefix-list #10 out", - "protocols bgp var peer-group var address-family ipv6-unicast prefix-list import" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 prefix-list #10 in", - "protocols bgp var peer-group var address-family ipv6-unicast remove-private-as" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 remove-private-AS", - "protocols bgp var peer-group var address-family ipv6-unicast route-map" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast route-map export" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 route-map #10 out", - "protocols bgp var peer-group var address-family ipv6-unicast route-map import" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 route-map #10 in", - "protocols bgp var peer-group var address-family ipv6-unicast route-reflector-client" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 route-reflector-client", - "protocols bgp var peer-group var address-family ipv6-unicast route-server-client" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 route-server-client", - "protocols bgp var peer-group var address-family ipv6-unicast soft-reconfiguration" => undef, - "protocols bgp var peer-group var address-family ipv6-unicast soft-reconfiguration inbound" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 soft-reconfiguration inbound", - "protocols bgp var peer-group var address-family ipv6-unicast unsuppress-map" => "router bgp #3 ; address-family ipv6 ; no neighbor #5 unsuppress-map #9", - "protocols bgp var peer-group var allowas-in" => "router bgp #3 ; no neighbor #5 allowas-in", - "protocols bgp var peer-group var allowas-in number" => "router bgp #3 ; no neighbor #5 allowas-in #8 ; neighbor #5 allowas-in", - "protocols bgp var peer-group var attribute-unchanged" => "router bgp #3 ; no neighbor #5 attribute-unchanged ?as-path ?med ?next-hop", - "protocols bgp var peer-group var capability" => undef, - "protocols bgp var peer-group var capability dynamic" => "router bgp #3 ; no neighbor #5 capability dynamic", - "protocols bgp var peer-group var capability orf" => undef, - "protocols bgp var peer-group var capability orf prefix-list" => undef, - "protocols bgp var peer-group var capability orf prefix-list receive" => "router bgp #3 ; no neighbor #5 capability orf prefix-list receive", - "protocols bgp var peer-group var capability orf prefix-list send" => "router bgp #3 ; no neighbor #5 capability orf prefix-list send", - "protocols bgp var peer-group var default-originate" => "router bgp #3 ; no neighbor #5 default-originate", - "protocols bgp var peer-group var default-originate route-map" => "router bgp #3 ; no neighbor #5 default-originate route-map #8", - "protocols bgp var peer-group var disable-capability-negotiation" => "router bgp #3 ; no neighbor #5 dont-capability-negotiate", - "protocols bgp var peer-group var disable-connected-check" => "router bgp #3 ; no neighbor #5 disable-connected-check", - "protocols bgp var peer-group var disable-send-community" => undef, - "protocols bgp var peer-group var disable-send-community extended" => "router bgp #3 ; neighbor #5 send-community extended", - "protocols bgp var peer-group var disable-send-community standard" => "router bgp #3 ; neighbor #5 send-community standard", - "protocols bgp var peer-group var distribute-list" => undef, - "protocols bgp var peer-group var distribute-list export" => "router bgp #3 ; no neighbor #5 distribute-list #8 out", - "protocols bgp var peer-group var distribute-list import" => "router bgp #3 ; no neighbor #5 distribute-list #8 in", - "protocols bgp var peer-group var ebgp-multihop" => "router bgp #3 ; no neighbor #5 ebgp-multihop #7", - "protocols bgp var peer-group var filter-list" => undef, - "protocols bgp var peer-group var filter-list export" => "router bgp #3 ; no neighbor #5 filter-list #8 out", - "protocols bgp var peer-group var filter-list import" => "router bgp #3 ; no neighbor #5 filter-list #8 in", - "protocols bgp var peer-group var local-as" => undef, - "protocols bgp var peer-group var local-as var" => "router bgp #3 ; no neighbor #5 local-as #7", - "protocols bgp var peer-group var local-as var no-prepend" => "router bgp #3 ; no neighbor #5 local-as #7 ; neighbor #5 local-as", - "protocols bgp var peer-group var maximum-prefix" => "router bgp #3 ; no neighbor #5 maximum-prefix #7", - "protocols bgp var peer-group var nexthop-self" => "router bgp #3 ; no neighbor #5 next-hop-self", - "protocols bgp var peer-group var override-capability" => "router bgp #3 ; no neighbor #5 override-capability", - "protocols bgp var peer-group var passive" => "router bgp #3 ; no neighbor #5 passive", - "protocols bgp var peer-group var password" => "router bgp #3 ; no neighbor #5 password #7", - "protocols bgp var peer-group var port" => "router bgp #3 ; no neighbor #5 port #7", - "protocols bgp var peer-group var prefix-list" => undef, - "protocols bgp var peer-group var prefix-list export" => "router bgp #3 ; no neighbor #5 prefix-list #8 out", - "protocols bgp var peer-group var prefix-list import" => "router bgp #3 ; no neighbor #5 prefix-list #8 in", - "protocols bgp var peer-group var remote-as" => "router bgp #3 ; no neighbor #5", - "protocols bgp var peer-group var remove-private-as" => "router bgp #3 ; no neighbor #5 remove-private-AS", - "protocols bgp var peer-group var route-map" => undef, - "protocols bgp var peer-group var route-map export" => "router bgp #3 ; no neighbor #5 route-map #8 out", - "protocols bgp var peer-group var route-map import" => "router bgp #3 ; no neighbor #5 route-map #8 in", - "protocols bgp var peer-group var route-reflector-client" => "router bgp #3 ; no neighbor #5 route-reflector-client", - "protocols bgp var peer-group var route-server-client" => "router bgp #3 ; no neighbor #5 route-server-client", - "protocols bgp var peer-group var shutdown" => "router bgp #3 ; no neighbor #5 shutdown", - "protocols bgp var peer-group var soft-reconfiguration" => undef, - "protocols bgp var peer-group var soft-reconfiguration inbound" => "router bgp #3 ; no neighbor #5 soft-reconfiguration inbound", - "protocols bgp var peer-group var timers" => "router bgp #3 ; no neighbor #5", - "protocols bgp var peer-group var timers connect" => "router bgp #3 ; no neighbor #5 timers connect #8", - "protocols bgp var peer-group var unsuppress-map" => "router bgp #3 ; no neighbor #5 unsuppress-map #7", - "protocols bgp var peer-group var update-source" => "router bgp #3 ; no neighbor #5 update-source #7", - "protocols bgp var peer-group var weight" => "router bgp #3 ; no neighbor #5 weight #7", - "protocols bgp var redistribute" => undef, - "protocols bgp var redistribute connected" => "router bgp #3 ; no redistribute connected", - "protocols bgp var redistribute connected metric" => "router bgp #3 ; no redistribute connected metric #7", - "protocols bgp var redistribute connected route-map" => "router bgp #3 ; no redistribute connected route-map #7", - "protocols bgp var redistribute kernel" => "router bgp #3 ; no redistribute kernel", - "protocols bgp var redistribute kernel metric" => "router bgp #3 ; no redistribute kernel metric #7", - "protocols bgp var redistribute kernel route-map" => "router bgp #3 ; no redistribute kernel route-map #7", - "protocols bgp var redistribute ospf" => "router bgp #3 ; no redistribute ospf", - "protocols bgp var redistribute ospf metric" => "router bgp #3 ; no redistribute ospf metric #7", - "protocols bgp var redistribute ospf route-map" => "router bgp #3 ; no redistribute ospf route-map #7", - "protocols bgp var redistribute rip" => "router bgp #3 ; no redistribute rip", - "protocols bgp var redistribute rip metric" => "router bgp #3 ; no redistribute rip metric #7", - "protocols bgp var redistribute rip route-map" => "router bgp #3 ; no redistribute rip route-map #7", - "protocols bgp var redistribute static" => "router bgp #3 ; no redistribute static", - "protocols bgp var redistribute static metric" => "router bgp #3 ; no redistribute static metric #7", - "protocols bgp var redistribute static route-map" => "router bgp #3 ; no redistribute static route-map #7", - "protocols bgp var timers" => "router bgp #3 ; no timers bgp", + "protocols" => { + set => undef, + del => undef, + }, + "protocols bgp" => { + set => undef, + del => undef, + }, + "protocols bgp var" => { + set => "router bgp #3", + del => "no router bgp #3", + }, + "protocols bgp var address-family" => { + set => undef, + del => undef, + }, + "protocols bgp var address-family ipv6-unicast" => { + set => undef, + del => undef, + }, + "protocols bgp var address-family ipv6-unicast aggregate-address" => { + set => undef, + del => undef, + }, + "protocols bgp var address-family ipv6-unicast aggregate-address var" => { + set => "router bgp #3 ; no ipv6 bgp aggregate-address #7 ; ipv6 bgp aggregate-address #7 ?summary-only", + del => "router bgp #3 ; no ipv6 bgp aggregate-address #7", + }, + "protocols bgp var address-family ipv6-unicast network" => { + set => "router bgp #3 ; no ipv6 bgp network #7 ; ipv6 bgp network #7", + del => "router bgp #3 ; no ipv6 bgp network #7 ; no ipv6 bgp network #7", + }, + "protocols bgp var address-family ipv6-unicast redistribute" => { + set => undef, + del => undef, + }, + "protocols bgp var address-family ipv6-unicast redistribute connected" => { + set => "router bgp #3 ; address-family ipv6 ; redistribute connected", + del => "router bgp #3 ; address-family ipv6 ; no redistribute connected", + }, + "protocols bgp var address-family ipv6-unicast redistribute connected metric" => { + set => "router bgp #3 ; address-family ipv6 ; redistribute connected metric #9", + del => "router bgp #3 ; address-family ipv6 ; no redistribute connected metric #9", + }, + "protocols bgp var address-family ipv6-unicast redistribute connected route-map" => { + set => "router bgp #3 ; address-family ipv6 ; redistribute connected route-map #9", + del => "router bgp #3 ; address-family ipv6 ; no redistribute connected route-map #9", + }, + "protocols bgp var address-family ipv6-unicast redistribute kernel" => { + set => "router bgp #3 ; address-family ipv6 ; redistribute kernel", + del => "router bgp #3 ; address-family ipv6 ; no redistribute kernel", + }, + "protocols bgp var address-family ipv6-unicast redistribute kernel metric" => { + set => "router bgp #3 ; address-family ipv6 ; redistribute kernel metric #9", + del => "router bgp #3 ; address-family ipv6 ; no redistribute kernel metric #9", + }, + "protocols bgp var address-family ipv6-unicast redistribute kernel route-map" => { + set => "router bgp #3 ; address-family ipv6 ; redistribute kernel route-map #9", + del => "router bgp #3 ; address-family ipv6 ; no redistribute kernel route-map #9", + }, + "protocols bgp var address-family ipv6-unicast redistribute ospfv3" => { + set => "router bgp #3 ; address-family ipv6 ; redistribute ospfv3", + del => "router bgp #3 ; address-family ipv6 ; no redistribute ospfv3", + }, + "protocols bgp var address-family ipv6-unicast redistribute ospfv3 metric" => { + set => "router bgp #3 ; address-family ipv6 ; redistribute ospfv3 metric #9", + del => "router bgp #3 ; address-family ipv6 ; no redistribute ospfv3 metric #9", + }, + "protocols bgp var address-family ipv6-unicast redistribute ospfv3 route-map" => { + set => "router bgp #3 ; address-family ipv6 ; redistribute ospfv3 route-map #9", + del => "router bgp #3 ; address-family ipv6 ; no redistribute ospfv3 route-map #9", + }, + "protocols bgp var address-family ipv6-unicast redistribute ripng" => { + set => "router bgp #3 ; address-family ipv6 ; redistribute ripng", + del => "router bgp #3 ; address-family ipv6 ; no redistribute ripng", + }, + "protocols bgp var address-family ipv6-unicast redistribute ripng metric" => { + set => "router bgp #3 ; address-family ipv6 ; redistribute ripng metric #9", + del => "router bgp #3 ; address-family ipv6 ; no redistribute ripng metric #9", + }, + "protocols bgp var address-family ipv6-unicast redistribute ripng route-map" => { + set => "router bgp #3 ; address-family ipv6 ; redistribute ripng route-map #9", + del => "router bgp #3 ; address-family ipv6 ; no redistribute ripng route-map #9", + }, + "protocols bgp var address-family ipv6-unicast redistribute static" => { + set => "router bgp #3 ; address-family ipv6 ; redistribute static", + del => "router bgp #3 ; address-family ipv6 ; no redistribute static", + }, + "protocols bgp var address-family ipv6-unicast redistribute static metric" => { + set => "router bgp #3 ; address-family ipv6 ; redistribute static metric #9", + del => "router bgp #3 ; address-family ipv6 ; no redistribute static metric #9", + }, + "protocols bgp var address-family ipv6-unicast redistribute static route-map" => { + set => "router bgp #3 ; address-family ipv6 ; redistribute static route-map #9", + del => "router bgp #3 ; address-family ipv6 ; no redistribute static route-map #9", + }, + "protocols bgp var aggregate-address" => { + set => undef, + del => undef, + }, + "protocols bgp var aggregate-address var" => { + set => "router bgp #3 ; no aggregate-address #5 ; aggregate-address #5 ?as-set ?summary-only", + del => "router bgp #3 ; no aggregate-address #5 ?as-set ?summary-only", + }, + "protocols bgp var neighbor" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var" => { + set => "router bgp #3 ; neighbor #5", + del => "router bgp #3 ; no neighbor #5", + }, + "protocols bgp var neighbor var address-family" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var address-family ipv6-unicast" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 activate", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 activate", + }, + "protocols bgp var neighbor var address-family ipv6-unicast allowas-in" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 allowas-in", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 allowas-in", + }, + "protocols bgp var neighbor var address-family ipv6-unicast attribute-unchanged" => { + set => "router bgp #3 ; address-family ipv6 ; no neighbor #5 attribute-unchanged ; neighbor #5 attribute-unchanged ?as-path ?med ?next-hop", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 attribute-unchanged", + }, + "protocols bgp var neighbor var address-family ipv6-unicast capability" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var address-family ipv6-unicast capability dynamic" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 capability dynamic", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 capability dynamic", + }, + "protocols bgp var neighbor var address-family ipv6-unicast capability orf" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var address-family ipv6-unicast capability orf prefix-list" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var address-family ipv6-unicast capability orf prefix-list receive" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 capability orf prefix-list receive", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 capability orf prefix-list receive", + }, + "protocols bgp var neighbor var address-family ipv6-unicast capability orf prefix-list send" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 capability orf prefix-list send", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 capability orf prefix-list send", + }, + "protocols bgp var neighbor var address-family ipv6-unicast default-originate" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 default-originate", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 default-originate", + }, + "protocols bgp var neighbor var address-family ipv6-unicast default-originate route-map" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 default-originate route-map #10", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 default-originate route-map #10", + }, + "protocols bgp var neighbor var address-family ipv6-unicast disable-send-community" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var address-family ipv6-unicast disable-send-community extended" => { + set => "router bgp #3 ; address-family ipv6 ; no neighbor #5 send-community extended", + del => "router bgp #3 ; address-family ipv6 ; neighbor #5 send-community extended", + }, + "protocols bgp var neighbor var address-family ipv6-unicast disable-send-community standard" => { + set => "router bgp #3 ; address-family ipv6 ; no neighbor #5 send-community standard", + del => "router bgp #3 ; address-family ipv6 ; neighbor #5 send-community standard", + }, + "protocols bgp var neighbor var address-family ipv6-unicast distribute-list" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var address-family ipv6-unicast distribute-list export" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 distribute-list #10 out", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 distribute-list #10 out", + }, + "protocols bgp var neighbor var address-family ipv6-unicast distribute-list import" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 distribute-list #10 in", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 distribute-list #10 in", + }, + "protocols bgp var neighbor var address-family ipv6-unicast filter-list" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var address-family ipv6-unicast filter-list export" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 filter-list #10 out", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 filter-list #10 out", + }, + "protocols bgp var neighbor var address-family ipv6-unicast filter-list import" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 filter-list #10 in", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 filter-list #10 in", + }, + "protocols bgp var neighbor var address-family ipv6-unicast maximum-prefix" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 maximum-prefix #9", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 maximum-prefix #9", + }, + "protocols bgp var neighbor var address-family ipv6-unicast nexthop-local" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 nexthop-local unchanged", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 nexthop-local unchanged", + }, + "protocols bgp var neighbor var address-family ipv6-unicast nexthop-self" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 next-hop-self", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 next-hop-self", + }, + "protocols bgp var neighbor var address-family ipv6-unicast prefix-list" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var address-family ipv6-unicast prefix-list export" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 prefix-list #10 out", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 prefix-list #10 out", + }, + "protocols bgp var neighbor var address-family ipv6-unicast prefix-list import" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 prefix-list #10 in", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 prefix-list #10 in", + }, + "protocols bgp var neighbor var address-family ipv6-unicast remove-private-as" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 remove-private-AS", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 remove-private-AS", + }, + "protocols bgp var neighbor var address-family ipv6-unicast route-map" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var address-family ipv6-unicast route-map export" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 route-map #10 out", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 route-map #10 out", + }, + "protocols bgp var neighbor var address-family ipv6-unicast route-map import" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 route-map #10 in", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 route-map #10 in", + }, + "protocols bgp var neighbor var address-family ipv6-unicast route-reflector-client" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 route-reflector-client", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 route-reflector-client", + }, + "protocols bgp var neighbor var address-family ipv6-unicast route-server-client" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 route-server-client", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 route-server-client", + }, + "protocols bgp var neighbor var address-family ipv6-unicast soft-reconfiguration" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var address-family ipv6-unicast soft-reconfiguration inbound" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 soft-reconfiguration inbound", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 soft-reconfiguration inbound", + }, + "protocols bgp var neighbor var address-family ipv6-unicast unsuppress-map" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 unsuppress-map #9", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 unsuppress-map #9", + }, + "protocols bgp var neighbor var advertisement-interval" => { + set => "router bgp #3 ; neighbor #5 advertisement-interval #7", + del => "router bgp #3 ; no neighbor #5 advertisement-interval", + }, + "protocols bgp var neighbor var allowas-in" => { + set => "router bgp #3 ; neighbor #5 allowas-in", + del => "router bgp #3 ; no neighbor #5 allowas-in", + }, + "protocols bgp var neighbor var allowas-in number" => { + set => "router bgp #3 ; neighbor #5 allowas-in #8", + del => "router bgp #3 ; no neighbor #5 allowas-in #8 ; neighbor #5 allowas-in", + }, + "protocols bgp var neighbor var attribute-unchanged" => { + set => "router bgp #3 ; no neighbor #5 attribute-unchanged ; neighbor #5 attribute-unchanged ?as-path ?med ?next-hop", + del => "router bgp #3 ; no neighbor #5 attribute-unchanged ?as-path ?med ?next-hop", + }, + "protocols bgp var neighbor var capability" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var capability dynamic" => { + set => "router bgp #3 ; neighbor #5 capability dynamic", + del => "router bgp #3 ; no neighbor #5 capability dynamic", + }, + "protocols bgp var neighbor var capability orf" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var capability orf prefix-list" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var capability orf prefix-list receive" => { + set => "router bgp #3 ; neighbor #5 capability orf prefix-list receive", + del => "router bgp #3 ; no neighbor #5 capability orf prefix-list receive", + }, + "protocols bgp var neighbor var capability orf prefix-list send" => { + set => "router bgp #3 ; neighbor #5 capability orf prefix-list send", + del => "router bgp #3 ; no neighbor #5 capability orf prefix-list send", + }, + "protocols bgp var neighbor var default-originate" => { + set => "router bgp #3 ; neighbor #5 default-originate", + del => "router bgp #3 ; no neighbor #5 default-originate", + }, + "protocols bgp var neighbor var default-originate route-map" => { + set => "router bgp #3 ; neighbor #5 default-originate route-map #8", + del => "router bgp #3 ; no neighbor #5 default-originate route-map #8", + }, + "protocols bgp var neighbor var disable-capability-negotiation" => { + set => "router bgp #3 ; neighbor #5 dont-capability-negotiate", + del => "router bgp #3 ; no neighbor #5 dont-capability-negotiate", + }, + "protocols bgp var neighbor var disable-connected-check" => { + set => "router bgp #3 ; neighbor #5 disable-connected-check", + del => "router bgp #3 ; no neighbor #5 disable-connected-check", + }, + "protocols bgp var neighbor var disable-send-community" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var disable-send-community extended" => { + set => "router bgp #3 ; no neighbor #5 send-community extended", + del => "router bgp #3 ; neighbor #5 send-community extended", + }, + "protocols bgp var neighbor var disable-send-community standard" => { + set => "router bgp #3 ; no neighbor #5 send-community standard", + del => "router bgp #3 ; neighbor #5 send-community standard", + }, + "protocols bgp var neighbor var distribute-list" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var distribute-list export" => { + set => "router bgp #3 ; neighbor #5 distribute-list #8 out", + del => "router bgp #3 ; no neighbor #5 distribute-list #8 out", + }, + "protocols bgp var neighbor var distribute-list import" => { + set => "router bgp #3 ; neighbor #5 distribute-list #8 in", + del => "router bgp #3 ; no neighbor #5 distribute-list #8 in", + }, + "protocols bgp var neighbor var ebgp-multihop" => { + set => "router bgp #3 ; neighbor #5 ebgp-multihop #7", + del => "router bgp #3 ; no neighbor #5 ebgp-multihop", + }, + "protocols bgp var neighbor var filter-list" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var filter-list export" => { + set => "router bgp #3 ; neighbor #5 filter-list #8 out", + del => "router bgp #3 ; no neighbor #5 filter-list #8 out", + }, + "protocols bgp var neighbor var filter-list import" => { + set => "router bgp #3 ; neighbor #5 filter-list #8 in", + del => "router bgp #3 ; no neighbor #5 filter-list #8 in", + }, + "protocols bgp var neighbor var local-as" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var local-as var" => { + set => "router bgp #3 ; no neighbor #5 local-as #7 ; neighbor #5 local-as #7", + del => "router bgp #3 ; no neighbor #5 local-as", + }, + "protocols bgp var neighbor var local-as var no-prepend" => { + set => "router bgp #3 ; no neighbor #5 local-as #7 ; neighbor #5 local-as #7 no-prepend", + del => "router bgp #3 ; no neighbor #5 local-as #7 no-prepend; neighbor #5 local-as #7", + }, + "protocols bgp var neighbor var maximum-prefix" => { + set => "router bgp #3 ; neighbor #5 maximum-prefix #7", + del => "router bgp #3 ; no neighbor #5 maximum-prefix", + }, + "protocols bgp var neighbor var nexthop-self" => { + set => "router bgp #3 ; neighbor #5 next-hop-self", + del => "router bgp #3 ; no neighbor #5 next-hop-self", + }, + "protocols bgp var neighbor var override-capability" => { + set => "router bgp #3 ; neighbor #5 override-capability", + del => "router bgp #3 ; no neighbor #5 override-capability", + }, + "protocols bgp var neighbor var passive" => { + set => "router bgp #3 ; neighbor #5 passive", + del => "router bgp #3 ; no neighbor #5 passive", + }, + "protocols bgp var neighbor var password" => { + set => "router bgp #3 ; neighbor #5 password #7", + del => "router bgp #3 ; no neighbor #5 password", + }, + "protocols bgp var neighbor var peer-group" => { + set => "router bgp #3 ; neighbor #5 peer-group #7", + del => "router bgp #3 ; no neighbor #5 peer-group #7", + }, + "protocols bgp var neighbor var port" => { + set => "router bgp #3 ; neighbor #5 port #7", + del => "router bgp #3 ; no neighbor #5 port", + }, + "protocols bgp var neighbor var prefix-list" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var prefix-list export" => { + set => "router bgp #3 ; neighbor #5 prefix-list #8 out", + del => "router bgp #3 ; no neighbor #5 prefix-list #8 out", + }, + "protocols bgp var neighbor var prefix-list import" => { + set => "router bgp #3 ; neighbor #5 prefix-list #8 in", + del => "router bgp #3 ; no neighbor #5 prefix-list #8 in", + }, + "protocols bgp var neighbor var remote-as" => { + set => "router bgp #3 ; neighbor #5 remote-as #7", + del => "router bgp #3 ; no neighbor #5 remote-as #7", + }, + "protocols bgp var neighbor var remove-private-as" => { + set => "router bgp #3 ; neighbor #5 remove-private-AS", + del => "router bgp #3 ; no neighbor #5 remove-private-AS", + }, + "protocols bgp var neighbor var route-map" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var route-map export" => { + set => "router bgp #3 ; neighbor #5 route-map #8 out", + del => "router bgp #3 ; no neighbor #5 route-map #8 out", + }, + "protocols bgp var neighbor var route-map import" => { + set => "router bgp #3 ; neighbor #5 route-map #8 in", + del => "router bgp #3 ; no neighbor #5 route-map #8 in", + }, + "protocols bgp var neighbor var route-reflector-client" => { + set => "router bgp #3 ; neighbor #5 route-reflector-client", + del => "router bgp #3 ; no neighbor #5 route-reflector-client", + }, + "protocols bgp var neighbor var route-server-client" => { + set => "router bgp #3 ; neighbor #5 route-server-client", + del => "router bgp #3 ; no neighbor #5 route-server-client", + }, + "protocols bgp var neighbor var shutdown" => { + set => "router bgp #3 ; neighbor #5 shutdown", + del => "router bgp #3 ; no neighbor #5 shutdown", + }, + "protocols bgp var neighbor var soft-reconfiguration" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var soft-reconfiguration inbound" => { + set => "router bgp #3 ; neighbor #5 soft-reconfiguration inbound", + del => "router bgp #3 ; no neighbor #5 soft-reconfiguration inbound", + }, + "protocols bgp var neighbor var strict-capability-match" => { + set => "router bgp #3 ; neighbor #5 strict-capability-match", + del => "router bgp #3 ; no neighbor #5 strict-capability-match", + }, + "protocols bgp var neighbor var timers" => { + set => 'router bgp #3 ; neighbor #5 timers @keepalive @holdtime', + del => 'router bgp #3 ; no neighbor #5 timers', + }, + "protocols bgp var neighbor var timers connect" => { + set => "router bgp #3 ; neighbor #5 timers connect #8", + del => "router bgp #3 ; no neighbor #5 timers connect", + }, + "protocols bgp var neighbor var ttl-security" => { + set => undef, + del => undef, + }, + "protocols bgp var neighbor var ttl-security hops" => { + set => "router bgp #3 ; neighbor #5 ttl-security hops #8", + del => "router bgp #3 ; no neighbor #5 ttl-security hops", + }, + "protocols bgp var neighbor var unsuppress-map" => { + set => "router bgp #3 ; neighbor #5 unsuppress-map #7", + del => "router bgp #3 ; no neighbor #5 unsuppress-map #7", + }, + "protocols bgp var neighbor var update-source" => { + set => "router bgp #3 ; neighbor #5 update-source #7", + del => "router bgp #3 ; no neighbor #5 update-source", + }, + "protocols bgp var neighbor var weight" => { + set => "router bgp #3 ; neighbor #5 weight #7", + del => "router bgp #3 ; no neighbor #5 weight", + }, + "protocols bgp var network" => { + set => undef, + del => undef, + }, + "protocols bgp var network var" => { + set => "router bgp #3 ; network #5 ?backdoor", + del => "router bgp #3 ; no network #5", + }, + "protocols bgp var network var route-map" => { + set => "router bgp #3 ; network #5 route-map #7", + del => "router bgp #3 ; no network #5 route-map #7", + }, + "protocols bgp var parameters" => { + set => undef, + del => undef, + }, + "protocols bgp var parameters always-compare-med" => { + set => "router bgp #3 ; bgp always-compare-med", + del => "router bgp #3 ; no bgp always-compare-med", + }, + "protocols bgp var parameters bestpath" => { + set => undef, + del => undef, + }, + "protocols bgp var parameters bestpath as-path" => { + set => undef, + del => undef, + }, + "protocols bgp var parameters bestpath as-path confed" => { + set => "router bgp #3 ; bgp bestpath as-path confed", + del => "router bgp #3 ; no bgp bestpath as-path confed", + }, + "protocols bgp var parameters bestpath as-path ignore" => { + set => "router bgp #3 ; bgp bestpath as-path ignore", + del => "router bgp #3 ; no bgp bestpath as-path ignore", + }, + "protocols bgp var parameters bestpath compare-routerid" => { + set => "router bgp #3 ; bgp bestpath compare-routerid", + del => "router bgp #3 ; no bgp bestpath compare-routerid", + }, + "protocols bgp var parameters bestpath med" => { + set => undef, + del => undef, + }, + "protocols bgp var parameters bestpath med confed" => { + set => "router bgp #3 ; bgp bestpath med confed", + del => "router bgp #3 ; no bgp bestpath med confed", + }, + "protocols bgp var parameters bestpath med missing-as-worst" => { + set => "router bgp #3 ; bgp bestpath med missing-as-worst", + del => "router bgp #3 ; no bgp bestpath med missing-as-worst", + }, + "protocols bgp var parameters cluster-id" => { + set => "router bgp #3 ; bgp cluster-id #6", + del => "router bgp #3 ; no bgp cluster-id #6", + }, + "protocols bgp var parameters confederation" => { + set => undef, + del => undef, + }, + "protocols bgp var parameters confederation identifier" => { + set => "router bgp #3 ; bgp confederation identifier #7", + del => "router bgp #3 ; no bgp confederation identifier #7", + }, + "protocols bgp var parameters confederation peers" => { + set => "router bgp #3 ; bgp confederation peers #7", + del => "router bgp #3 ; no bgp confederation peers #7", + }, + "protocols bgp var parameters dampening" => { + set => 'router bgp #3 ; no bgp dampening ; bgp dampening @half-life @re-use @start-suppress-time @max-suppress-time', + del => "router bgp #3 ; no bgp dampening", + }, + "protocols bgp var parameters default" => { + set => undef, + del => undef, + }, + "protocols bgp var parameters default local-pref" => { + set => "router bgp #3 ; bgp default local-preference #7", + del => "router bgp #3 ; no bgp default local-preference #7", + }, + "protocols bgp var parameters default no-ipv4-unicast" => { + set => "router bgp #3 ; no bgp default ipv4-unicast", + del => "router bgp #3 ; bgp default ipv4-unicast", + }, + "protocols bgp var parameters deterministic-med" => { + set => "router bgp #3 ; bgp deterministic-med", + del => "router bgp #3 ; no bgp deterministic-med", + }, + "protocols bgp var parameters disable-network-import-check" => { + set => "router bgp #3 ; no bgp network import-check", + del => "router bgp #3 ; bgp network import-check", + }, + "protocols bgp var parameters enforce-first-as" => { + set => "router bgp #3 ; bgp enforce-first-as", + del => "router bgp #3 ; no bgp enforce-first-as", + }, + "protocols bgp var parameters graceful-restart" => { + set => undef, + del => undef, + }, + "protocols bgp var parameters graceful-restart stalepath-time" => { + set => "router bgp #3 ; bgp graceful-restart stalepath-time #7", + del => "router bgp #3 ; no bgp graceful-restart stalepath-time #7", + }, + "protocols bgp var parameters log-neighbor-changes" => { + set => "router bgp #3 ; bgp log-neighbor-changes", + del => "router bgp #3 ; no bgp log-neighbor-changes", + }, + "protocols bgp var parameters no-client-to-client-reflection" => { + set => "router bgp #3 ; no bgp client-to-client reflection", + del => "router bgp #3 ; bgp client-to-client reflection", + }, + "protocols bgp var parameters no-fast-external-failover" => { + set => "router bgp #3 ; no bgp fast-external-failover", + del => "router bgp #3 ; bgp fast-external-failover", + }, + "protocols bgp var parameters router-id" => { + set => "router bgp #3 ; bgp router-id #6", + del => "router bgp #3 ; no bgp router-id #6", + }, + "protocols bgp var parameters scan-time" => { + set => "router bgp #3 ; bgp scan-time #6", + del => "router bgp #3 ; no bgp scan-time #6", + }, + "protocols bgp var peer-group" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var" => { + set => "router bgp #3 ; neighbor #5 peer-group", + del => "router bgp #3 ; no neighbor #5 peer-group", + }, + "protocols bgp var peer-group var address-family" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var address-family ipv6-unicast" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 activate", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 activate", + }, + "protocols bgp var peer-group var address-family ipv6-unicast allowas-in" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 allowas-in", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 allowas-in", + }, + "protocols bgp var peer-group var address-family ipv6-unicast attribute-unchanged" => { + set => "router bgp #3 ; address-family ipv6 ; no neighbor #5 attribute-unchanged ; neighbor #5 attribute-unchanged ?as-path ?med ?next-hop", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 attribute-unchanged", + }, + "protocols bgp var peer-group var address-family ipv6-unicast capability" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var address-family ipv6-unicast capability dynamic" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 capability dynamic", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 capability dynamic", + }, + "protocols bgp var peer-group var address-family ipv6-unicast capability orf" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var address-family ipv6-unicast capability orf prefix-list" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var address-family ipv6-unicast capability orf prefix-list receive" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 capability orf prefix-list receive", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 capability orf prefix-list receive", + }, + "protocols bgp var peer-group var address-family ipv6-unicast capability orf prefix-list send" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 capability orf prefix-list send", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 capability orf prefix-list send", + }, + "protocols bgp var peer-group var address-family ipv6-unicast default-originate" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 default-originate", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 default-originate", + }, + "protocols bgp var peer-group var address-family ipv6-unicast default-originate route-map" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 default-originate route-map #10", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 default-originate route-map #10", + }, + "protocols bgp var peer-group var address-family ipv6-unicast disable-send-community" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var address-family ipv6-unicast disable-send-community extended" => { + set => "router bgp #3 ; address-family ipv6 ; no neighbor #5 send-community extended", + del => "router bgp #3 ; address-family ipv6 ; neighbor #5 send-community extended", + }, + "protocols bgp var peer-group var address-family ipv6-unicast disable-send-community standard" => { + set => "router bgp #3 ; address-family ipv6 ; no neighbor #5 send-community standard", + del => "router bgp #3 ; address-family ipv6 ; neighbor #5 send-community standard", + }, + "protocols bgp var peer-group var address-family ipv6-unicast distribute-list" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var address-family ipv6-unicast distribute-list export" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 distribute-list #10 out", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 distribute-list #10 out", + }, + "protocols bgp var peer-group var address-family ipv6-unicast distribute-list import" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 distribute-list #10 in", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 distribute-list #10 in", + }, + "protocols bgp var peer-group var address-family ipv6-unicast filter-list" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var address-family ipv6-unicast filter-list export" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 filter-list #10 out", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 filter-list #10 out", + }, + "protocols bgp var peer-group var address-family ipv6-unicast filter-list import" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 filter-list #10 in", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 filter-list #10 in", + }, + "protocols bgp var peer-group var address-family ipv6-unicast maximum-prefix" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 maximum-prefix #9", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 maximum-prefix #9", + }, + "protocols bgp var peer-group var address-family ipv6-unicast nexthop-local" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 nexthop-local unchanged", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 nexthop-local unchanged", + }, + "protocols bgp var peer-group var address-family ipv6-unicast nexthop-self" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 next-hop-self", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 next-hop-self", + }, + "protocols bgp var peer-group var address-family ipv6-unicast prefix-list" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var address-family ipv6-unicast prefix-list export" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 prefix-list #10 out", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 prefix-list #10 out", + }, + "protocols bgp var peer-group var address-family ipv6-unicast prefix-list import" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 prefix-list #10 in", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 prefix-list #10 in", + }, + "protocols bgp var peer-group var address-family ipv6-unicast remove-private-as" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 remove-private-AS", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 remove-private-AS", + }, + "protocols bgp var peer-group var address-family ipv6-unicast route-map" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var address-family ipv6-unicast route-map export" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 route-map #10 out", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 route-map #10 out", + }, + "protocols bgp var peer-group var address-family ipv6-unicast route-map import" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 route-map #10 in", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 route-map #10 in", + }, + "protocols bgp var peer-group var address-family ipv6-unicast route-reflector-client" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 route-reflector-client", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 route-reflector-client", + }, + "protocols bgp var peer-group var address-family ipv6-unicast route-server-client" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 route-server-client", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 route-server-client", + }, + "protocols bgp var peer-group var address-family ipv6-unicast soft-reconfiguration" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var address-family ipv6-unicast soft-reconfiguration inbound" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 soft-reconfiguration inbound", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 soft-reconfiguration inbound", + }, + "protocols bgp var peer-group var address-family ipv6-unicast unsuppress-map" => { + set => "router bgp #3 ; address-family ipv6 ; neighbor #5 unsuppress-map #9", + del => "router bgp #3 ; address-family ipv6 ; no neighbor #5 unsuppress-map #9", + }, + "protocols bgp var peer-group var allowas-in" => { + set => "router bgp #3 ; neighbor #5 allowas-in", + del => "router bgp #3 ; no neighbor #5 allowas-in", + }, + "protocols bgp var peer-group var allowas-in number" => { + set => "router bgp #3 ; neighbor #5 allowas-in #8", + del => "router bgp #3 ; no neighbor #5 allowas-in #8 ; neighbor #5 allowas-in", + }, + "protocols bgp var peer-group var attribute-unchanged" => { + set => "router bgp #3 ; no neighbor #5 attribute-unchanged ; neighbor #5 attribute-unchanged ?as-path ?med ?next-hop", + del => "router bgp #3 ; no neighbor #5 attribute-unchanged ?as-path ?med ?next-hop", + }, + "protocols bgp var peer-group var capability" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var capability dynamic" => { + set => "router bgp #3 ; neighbor #5 capability dynamic", + del => "router bgp #3 ; no neighbor #5 capability dynamic", + }, + "protocols bgp var peer-group var capability orf" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var capability orf prefix-list" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var capability orf prefix-list receive" => { + set => "router bgp #3 ; neighbor #5 capability orf prefix-list receive", + del => "router bgp #3 ; no neighbor #5 capability orf prefix-list receive", + }, + "protocols bgp var peer-group var capability orf prefix-list send" => { + set => "router bgp #3 ; neighbor #5 capability orf prefix-list send", + del => "router bgp #3 ; no neighbor #5 capability orf prefix-list send", + }, + "protocols bgp var peer-group var default-originate" => { + set => "router bgp #3 ; neighbor #5 default-originate", + del => "router bgp #3 ; no neighbor #5 default-originate", + }, + "protocols bgp var peer-group var default-originate route-map" => { + set => "router bgp #3 ; neighbor #5 default-originate route-map #8", + del => "router bgp #3 ; no neighbor #5 default-originate route-map #8", + }, + "protocols bgp var peer-group var disable-capability-negotiation" => { + set => "router bgp #3 ; neighbor #5 dont-capability-negotiate", + del => "router bgp #3 ; no neighbor #5 dont-capability-negotiate", + }, + "protocols bgp var peer-group var disable-connected-check" => { + set => "router bgp #3 ; neighbor #5 disable-connected-check", + del => "router bgp #3 ; no neighbor #5 disable-connected-check", + }, + "protocols bgp var peer-group var disable-send-community" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var disable-send-community extended" => { + set => "router bgp #3 ; no neighbor #5 send-community extended", + del => "router bgp #3 ; neighbor #5 send-community extended", + }, + "protocols bgp var peer-group var disable-send-community standard" => { + set => "router bgp #3 ; no neighbor #5 send-community standard", + del => "router bgp #3 ; neighbor #5 send-community standard", + }, + "protocols bgp var peer-group var distribute-list" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var distribute-list export" => { + set => "router bgp #3 ; neighbor #5 distribute-list #8 out", + del => "router bgp #3 ; no neighbor #5 distribute-list #8 out", + }, + "protocols bgp var peer-group var distribute-list import" => { + set => "router bgp #3 ; neighbor #5 distribute-list #8 in", + del => "router bgp #3 ; no neighbor #5 distribute-list #8 in", + }, + "protocols bgp var peer-group var ebgp-multihop" => { + set => "router bgp #3 ; neighbor #5 ebgp-multihop #7", + del => "router bgp #3 ; no neighbor #5 ebgp-multihop #7", + }, + "protocols bgp var peer-group var filter-list" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var filter-list export" => { + set => "router bgp #3 ; neighbor #5 filter-list #8 out", + del => "router bgp #3 ; no neighbor #5 filter-list #8 out", + }, + "protocols bgp var peer-group var filter-list import" => { + set => "router bgp #3 ; neighbor #5 filter-list #8 in", + del => "router bgp #3 ; no neighbor #5 filter-list #8 in", + }, + "protocols bgp var peer-group var local-as" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var local-as var" => { + set => "router bgp #3 ; no neighbor #5 local-as ; neighbor #5 local-as #7", + del => "router bgp #3 ; no neighbor #5 local-as #7", + }, + "protocols bgp var peer-group var local-as var no-prepend" => { + set => "router bgp #3 ; no neighbor #5 local-as #7 ; neighbor #5 local-as #7i no-prepend", + del => "router bgp #3 ; no neighbor #5 local-as #7 no-prepend ; neighbor #5 local-as #7", + }, + "protocols bgp var peer-group var maximum-prefix" => { + set => "router bgp #3 ; neighbor #5 maximum-prefix #7", + del => "router bgp #3 ; no neighbor #5 maximum-prefix #7", + }, + "protocols bgp var peer-group var nexthop-self" => { + set => "router bgp #3 ; neighbor #5 next-hop-self", + del => "router bgp #3 ; no neighbor #5 next-hop-self", + }, + "protocols bgp var peer-group var override-capability" => { + set => "router bgp #3 ; neighbor #5 override-capability", + del => "router bgp #3 ; no neighbor #5 override-capability", + }, + "protocols bgp var peer-group var passive" => { + set => "router bgp #3 ; neighbor #5 passive", + del => "router bgp #3 ; no neighbor #5 passive", + }, + "protocols bgp var peer-group var password" => { + set => "router bgp #3 ; neighbor #5 password #7", + del => "router bgp #3 ; no neighbor #5 password #7", + }, + "protocols bgp var peer-group var port" => { + set => "router bgp #3 ; neighbor #5 port #7", + del => "router bgp #3 ; no neighbor #5 port #7", + }, + "protocols bgp var peer-group var prefix-list" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var prefix-list export" => { + set => "router bgp #3 ; neighbor #5 prefix-list #8 out", + del => "router bgp #3 ; no neighbor #5 prefix-list #8 out", + }, + "protocols bgp var peer-group var prefix-list import" => { + set => "router bgp #3 ; neighbor #5 prefix-list #8 in", + del => "router bgp #3 ; no neighbor #5 prefix-list #8 in", + }, + "protocols bgp var peer-group var remote-as" => { + set => "router bgp #3 ; neighbor #5 peer-group ; neighbor #5 remote-as #7", + del => "router bgp #3 ; no neighbor #5", + }, + "protocols bgp var peer-group var remove-private-as" => { + set => "router bgp #3 ; neighbor #5 remove-private-AS", + del => "router bgp #3 ; no neighbor #5 remove-private-AS", + }, + "protocols bgp var peer-group var route-map" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var route-map export" => { + set => "router bgp #3 ; neighbor #5 route-map #8 out", + del => "router bgp #3 ; no neighbor #5 route-map #8 out", + }, + "protocols bgp var peer-group var route-map import" => { + set => "router bgp #3 ; neighbor #5 route-map #8 in", + del => "router bgp #3 ; no neighbor #5 route-map #8 in", + }, + "protocols bgp var peer-group var route-reflector-client" => { + set => "router bgp #3 ; neighbor #5 route-reflector-client", + del => "router bgp #3 ; no neighbor #5 route-reflector-client", + }, + "protocols bgp var peer-group var route-server-client" => { + set => "router bgp #3 ; neighbor #5 route-server-client", + del => "router bgp #3 ; no neighbor #5 route-server-client", + }, + "protocols bgp var peer-group var shutdown" => { + set => "router bgp #3 ; neighbor #5 shutdown", + del => "router bgp #3 ; no neighbor #5 shutdown", + }, + "protocols bgp var peer-group var soft-reconfiguration" => { + set => undef, + del => undef, + }, + "protocols bgp var peer-group var soft-reconfiguration inbound" => { + set => "router bgp #3 ; neighbor #5 soft-reconfiguration inbound", + del => "router bgp #3 ; no neighbor #5 soft-reconfiguration inbound", + }, + "protocols bgp var peer-group var timers" => { + set => 'router bgp #3 ; neighbor #5 timers @keepalive @holdtime', + del => "router bgp #3 ; no neighbor #5", + }, + "protocols bgp var peer-group var timers connect" => { + set => "router bgp #3 ; neighbor #5 timers connect #8", + del => "router bgp #3 ; no neighbor #5 timers connect #8", + }, + "protocols bgp var peer-group var unsuppress-map" => { + set => "router bgp #3 ; neighbor #5 unsuppress-map #7", + del => "router bgp #3 ; no neighbor #5 unsuppress-map #7", + }, + "protocols bgp var peer-group var update-source" => { + set => "router bgp #3 ; neighbor #5 update-source #7", + del => "router bgp #3 ; no neighbor #5 update-source #7", + }, + "protocols bgp var peer-group var weight" => { + set => "router bgp #3 ; neighbor #5 weight #7", + del => "router bgp #3 ; no neighbor #5 weight #7", + }, + "protocols bgp var redistribute" => { + set => undef, + del => undef, + }, + "protocols bgp var redistribute connected" => { + set => "router bgp #3 ; redistribute connected", + del => "router bgp #3 ; no redistribute connected", + }, + "protocols bgp var redistribute connected metric" => { + set => "router bgp #3 ; redistribute connected metric #7", + del => "router bgp #3 ; no redistribute connected metric #7", + }, + "protocols bgp var redistribute connected route-map" => { + set => "router bgp #3 ; redistribute connected route-map #7", + del => "router bgp #3 ; no redistribute connected route-map #7", + }, + "protocols bgp var redistribute kernel" => { + set => "router bgp #3 ; redistribute kernel", + del => "router bgp #3 ; no redistribute kernel", + }, + "protocols bgp var redistribute kernel metric" => { + set => "router bgp #3 ; redistribute kernel metric #7", + del => "router bgp #3 ; no redistribute kernel metric #7", + }, + "protocols bgp var redistribute kernel route-map" => { + set => "router bgp #3 ; redistribute kernel route-map #7", + del => "router bgp #3 ; no redistribute kernel route-map #7", + }, + "protocols bgp var redistribute ospf" => { + set => "router bgp #3 ; redistribute ospf", + del => "router bgp #3 ; no redistribute ospf", + }, + "protocols bgp var redistribute ospf metric" => { + set => "router bgp #3 ; redistribute ospf metric #7", + del => "router bgp #3 ; no redistribute ospf metric #7", + }, + "protocols bgp var redistribute ospf route-map" => { + set => "router bgp #3 ; redistribute ospf route-map #7", + del => "router bgp #3 ; no redistribute ospf route-map #7", + }, + "protocols bgp var redistribute rip" => { + set => "router bgp #3 ; redistribute rip", + del => "router bgp #3 ; no redistribute rip", + }, + "protocols bgp var redistribute rip metric" => { + set => "router bgp #3 ; redistribute rip metric #7", + del => "router bgp #3 ; no redistribute rip metric #7", + }, + "protocols bgp var redistribute rip route-map" => { + set => "router bgp #3 ; redistribute rip route-map #7", + del => "router bgp #3 ; no redistribute rip route-map #7", + }, + "protocols bgp var redistribute static" => { + set => "router bgp #3 ; redistribute static", + del => "router bgp #3 ; no redistribute static", + }, + "protocols bgp var redistribute static metric" => { + set => "router bgp #3 ; redistribute static metric #7", + del => "router bgp #3 ; no redistribute static metric #7", + }, + "protocols bgp var redistribute static route-map" => { + set => "router bgp #3 ; redistribute static route-map #7", + del => "router bgp #3 ; no redistribute static route-map #7", + }, + "protocols bgp var timers" => { + set => 'router bgp #3 ; timers bgp @keepalive @holdtime', + del => "router bgp #3 ; no timers bgp", + }, ); my ( $pg, $as, $neighbor ); @@ -707,7 +1207,7 @@ sub check_source { sub main { # initialize the Quagga Config object with data from Vyatta config tree - my $qconfig = new Vyatta::Quagga::Config('protocols', \%qcom, \%qcomdel); + my $qconfig = new Vyatta::Quagga::Config('protocols', \%qcom); #$qconfig->setDebugLevel('3'); #$qconfig->_reInitialize(); -- cgit v1.2.3 From 674a60ba8dc885f0d1a7775fdfc000c653a76deb Mon Sep 17 00:00:00 2001 From: Robert Bays <rbays@roatan.(none)> Date: Sat, 22 May 2010 23:21:48 -0700 Subject: add functionality to skip nodes while in _setConfigTree --- lib/Vyatta/Quagga/Config.pm | 55 ++++++++++++++++++++++++++++++++------------- scripts/bgp/vyatta-bgp.pl | 14 ++++++++++-- 2 files changed, 51 insertions(+), 18 deletions(-) (limited to 'lib/Vyatta') diff --git a/lib/Vyatta/Quagga/Config.pm b/lib/Vyatta/Quagga/Config.pm index 356afeac..3f4cfa07 100644 --- a/lib/Vyatta/Quagga/Config.pm +++ b/lib/Vyatta/Quagga/Config.pm @@ -95,26 +95,26 @@ sub returnQuaggaCommands { # methods to send the commands to Quagga sub setConfigTree { - my ($self, $level) = @_; - if (_setConfigTree($level, 0, 0)) { return 1; } + my ($self, $level, @skip_list) = @_; + if (_setConfigTree($level, 0, 0, @skip_list)) { return 1; } return 0; } sub setConfigTreeRecursive { - my ($self, $level) = @_; - if (_setConfigTree($level, 0, 1)) { return 1; } + my ($self, $level, @skip_list) = @_; + if (_setConfigTree($level, 0, 1, @skip_list)) { return 1; } return 0; } sub deleteConfigTree { - my ($self, $level) = @_; - if (_setConfigTree($level, 1, 0)) { return 1; } + my ($self, $level, @skip_list) = @_; + if (_setConfigTree($level, 1, 0, @skip_list)) { return 1; } return 0; } sub deleteConfigTreeRecursive { - my ($self, $level) = @_; - if (_setConfigTree($level, 1, 1)) { return 1; } + my ($self, $level, @skip_list) = @_; + if (_setConfigTree($level, 1, 1, @skip_list)) { return 1; } return 0; } @@ -129,9 +129,11 @@ sub deleteConfigTreeRecursive { # input: $1 - level of the tree to start at # $2 - delete bool # $3 - recursive bool +# $4 - arrays of strings to skip # output: none, return failure if needed sub _setConfigTree { - my ($level, $delete, $recurse) = @_; + my ($level, $delete, $recurse, @skip_list) = @_; + my $qcom = $_qcomref; if ((! defined $level) || (! defined $delete) || @@ -148,18 +150,38 @@ sub _setConfigTree { $sortfunc = \&cmpb; } - if ($_DEBUG >= 3) { print "DEBUG: _setConfigTree - enter - level: $level\tdelete: $delete\trecurse: $recurse\n"; } + if ($_DEBUG >= 3) { + print "DEBUG: _setConfigTree - enter - level: $level\tdelete: $delete\trecurse: $recurse\tskip: "; + foreach my $key (@skip_list) { print "$key "; } + print "\n"; + } - my @keys; foreach my $key (sort $sortfunc keys %$vtyshref) { if ($_DEBUG >= 3) { print "DEBUG: _setConfigTree - key $key\n"; } + # skip parameters in skip_list + my $found = 0; + if ((scalar @skip_list) > 0) { + foreach my $node (@skip_list) { + if ($key =~ /$node/) { + $found = 1; + if ($_DEBUG >= 3) { print "DEBUG: _setConfigTree - key $node in skip list\n"; } + } + } + } + if ($found) { next; } + + # should we run the vtysh command with noerr? + my $noerr = ''; + if ($qcom->{$key}->{'noerr'}) { $noerr = 1; } + + # this conditional matches key to level exactly or if recurse, start of key to level if ((($recurse) && ($key =~ /^$level/)) || ((! $recurse) && ($key =~ /^$level$/))) { my $index = 0; foreach my $cmd (@{$vtyshref->{$key}}) { if ($_DEBUG >= 2) { print "DEBUG: _setConfigTree - key: $key \t cmd: $cmd\n"; } - if (! _sendQuaggaCommand("$cmd")) { return 0; } + if (! _sendQuaggaCommand("$cmd", "$noerr")) { return 0; } # remove this command so we don't hit it again in another Recurse call delete ${$vtyshref->{$key}}[$index]; $index++; @@ -178,8 +200,10 @@ sub cmpb { $b cmp $a } # input: $1 - qVarReplaced Quagga Command string # output: none, return failure if needed sub _sendQuaggaCommand { - my ($command) = @_; - my $args = "$_vtyshexe --noerr -c 'configure terminal' "; + my ($command, $noerr) = @_; + + if ($noerr) { $noerr = '--noerr'; } + my $args = "$_vtyshexe $noerr -c 'configure terminal' "; my @commands = split / ; /, $command; foreach my $section (@commands) { @@ -190,8 +214,7 @@ sub _sendQuaggaCommand { # TODO: need to fix this system call. split into command and args. system("$args"); if ($? != 0) { - # TODO: note that DEBUG will never happen here with --noerr as an argument. - # need to fix --noerr. Also probably need to code a way to conditionally use --noerr. + # TODO: need to fix to return error on output and error codes. if ($_DEBUG) { print "DEBUG: _sendQuaggaCommand - vtysh failure $? - $args\n"; print "\n"; diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl index 12b1349f..b72deab9 100755 --- a/scripts/bgp/vyatta-bgp.pl +++ b/scripts/bgp/vyatta-bgp.pl @@ -148,7 +148,7 @@ my %qcom = ( del => undef, }, "protocols bgp var neighbor var" => { - set => "router bgp #3 ; neighbor #5", + set => undef, del => "router bgp #3 ; no neighbor #5", }, "protocols bgp var neighbor var address-family" => { @@ -1213,8 +1213,18 @@ sub main { #$qconfig->_reInitialize(); # deletes with priority + # TODO: need to put syntax check in remote-as + # delete everything in neighbhor except for the important nodes + my @skip_array = ('remote-as', 'route-map', 'filter-list', 'prefix-list', 'distribute-list', 'unsuppress-map'); + # notice the extra space in the level string. keeps the parent from being deleted. + $qconfig->deleteConfigTreeRecursive('protocols bgp var neighbor var ', @skip_array) || die "exiting $?\n"; + # now delete everything in neighbor except remote-as + @skip_array = ('remote-as'); + $qconfig->deleteConfigTreeRecursive('protocols bgp var neighbor var ', @skip_array) || die "exiting $?\n"; + # now finish off neighbor + $qconfig->deleteConfigTreeRecursive('protocols bgp var neighbor var') || die "exiting $?\n"; + # now delete everything else $qconfig->deleteConfigTreeRecursive('protocols bgp') || die "exiting $?\n"; - # would be cool if I could add a recursive delete such as everything but (protocols bgp var neigh var remote-as) # sets with priority $qconfig->setConfigTreeRecursive('protocols bgp var parameters') || die "exiting $?\n"; -- cgit v1.2.3 From 9b35460dbd426d8439ae00138b06de0235697294 Mon Sep 17 00:00:00 2001 From: Robert Bays <rbays@roatan.(none)> Date: Sat, 22 May 2010 23:40:25 -0700 Subject: add differential noerr. now it supports one of set, del, or both. --- lib/Vyatta/Quagga/Config.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/Vyatta') diff --git a/lib/Vyatta/Quagga/Config.pm b/lib/Vyatta/Quagga/Config.pm index 3f4cfa07..8b463bf4 100644 --- a/lib/Vyatta/Quagga/Config.pm +++ b/lib/Vyatta/Quagga/Config.pm @@ -156,6 +156,7 @@ sub _setConfigTree { print "\n"; } + # This loop walks the list of commands and sends to quagga if appropriate foreach my $key (sort $sortfunc keys %$vtyshref) { if ($_DEBUG >= 3) { print "DEBUG: _setConfigTree - key $key\n"; } @@ -173,7 +174,10 @@ sub _setConfigTree { # should we run the vtysh command with noerr? my $noerr = ''; - if ($qcom->{$key}->{'noerr'}) { $noerr = 1; } + if ( (defined $qcom->{$key}->{'noerr'}) && ( + ($qcom->{$key}->{'noerr'} eq "both") || + (($qcom->{$key}->{'noerr'} eq "del") && ($delete)) || + (($qcom->{$key}->{'noerr'} eq "set") && (!$delete)))) { $noerr = 1; } # this conditional matches key to level exactly or if recurse, start of key to level if ((($recurse) && ($key =~ /^$level/)) || ((! $recurse) && ($key =~ /^$level$/))) { -- cgit v1.2.3 From 8a6a7bd1ca4f4607bbacc3f135665f7d4e5894d5 Mon Sep 17 00:00:00 2001 From: Robert Bays <rbays@roatan.(none)> Date: Sun, 23 May 2010 00:26:04 -0700 Subject: change the system call in _sendQuaggaCommand(). with the selective noerr fixed, we can now fail on return code. --- lib/Vyatta/Quagga/Config.pm | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'lib/Vyatta') diff --git a/lib/Vyatta/Quagga/Config.pm b/lib/Vyatta/Quagga/Config.pm index 8b463bf4..4eee2e8f 100644 --- a/lib/Vyatta/Quagga/Config.pm +++ b/lib/Vyatta/Quagga/Config.pm @@ -202,30 +202,24 @@ sub cmpb { $b cmp $a } # properly format a Quagga command for vtysh and send to Quagga # input: $1 - qVarReplaced Quagga Command string +# $2 - boolean: should we use noerr? # output: none, return failure if needed sub _sendQuaggaCommand { my ($command, $noerr) = @_; - if ($noerr) { $noerr = '--noerr'; } - my $args = "$_vtyshexe $noerr -c 'configure terminal' "; + my @arg_array = ("$_vtyshexe"); + if ($noerr) { push (@arg_array, '--noerr'); } + if ($_DEBUG >= 2) { push (@arg_array, '-E'); } + push (@arg_array, '-c'); + push (@arg_array, 'configure terminal'); my @commands = split / ; /, $command; foreach my $section (@commands) { - $args .= "-c '$section' "; + push (@arg_array, '-c'); + push (@arg_array, "$section"); } - if ($_DEBUG >= 2) { print "DEBUG: _sendQuaggaCommand - args prior to system call - $args\n"; } - # TODO: need to fix this system call. split into command and args. - system("$args"); - if ($? != 0) { - # TODO: need to fix to return error on output and error codes. - if ($_DEBUG) { - print "DEBUG: _sendQuaggaCommand - vtysh failure $? - $args\n"; - print "\n"; - } - return 0; - } - + system(@arg_array) == 0 or die "_sendQuaggaCommand: @arg_array failed: $?"; return 1; } -- cgit v1.2.3