From 190b662532c9f97ba1249b6b5a0631f05862250a Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Thu, 11 Feb 2021 22:16:26 +0100 Subject: T3267: T2181: migrate per interface routing protocol settings to vyos-1x --- Makefile.am | 4 - debian/vyatta-cfg-quagga.install | 15 --- gen-interface-templates.pl | 139 --------------------- interface-templates/ipv6/ospfv3/bfd/node.def | 3 - interface-templates/ipv6/ospfv3/cost/node.def | 8 -- .../ipv6/ospfv3/dead-interval/node.def | 10 -- .../ipv6/ospfv3/hello-interval/node.def | 10 -- interface-templates/ipv6/ospfv3/ifmtu/node.def | 7 -- .../ipv6/ospfv3/instance-id/node.def | 8 -- .../ipv6/ospfv3/mtu-ignore/node.def | 3 - interface-templates/ipv6/ospfv3/network/node.def | 9 -- interface-templates/ipv6/ospfv3/node.def | 1 - interface-templates/ipv6/ospfv3/passive/node.def | 3 - interface-templates/ipv6/ospfv3/priority/node.def | 8 -- .../ipv6/ospfv3/retransmit-interval/node.def | 10 -- .../ipv6/ospfv3/transmit-delay/node.def | 10 -- interface-templates/ipv6/ripng/node.def | 1 - .../ipv6/ripng/split-horizon/disable/node.def | 6 - .../ipv6/ripng/split-horizon/node.def | 1 - .../ripng/split-horizon/poison-reverse/node.def | 9 -- 20 files changed, 265 deletions(-) delete mode 100755 gen-interface-templates.pl delete mode 100644 interface-templates/ipv6/ospfv3/bfd/node.def delete mode 100644 interface-templates/ipv6/ospfv3/cost/node.def delete mode 100644 interface-templates/ipv6/ospfv3/dead-interval/node.def delete mode 100644 interface-templates/ipv6/ospfv3/hello-interval/node.def delete mode 100644 interface-templates/ipv6/ospfv3/ifmtu/node.def delete mode 100644 interface-templates/ipv6/ospfv3/instance-id/node.def delete mode 100644 interface-templates/ipv6/ospfv3/mtu-ignore/node.def delete mode 100644 interface-templates/ipv6/ospfv3/network/node.def delete mode 100644 interface-templates/ipv6/ospfv3/node.def delete mode 100644 interface-templates/ipv6/ospfv3/passive/node.def delete mode 100644 interface-templates/ipv6/ospfv3/priority/node.def delete mode 100644 interface-templates/ipv6/ospfv3/retransmit-interval/node.def delete mode 100644 interface-templates/ipv6/ospfv3/transmit-delay/node.def delete mode 100644 interface-templates/ipv6/ripng/node.def delete mode 100644 interface-templates/ipv6/ripng/split-horizon/disable/node.def delete mode 100644 interface-templates/ipv6/ripng/split-horizon/node.def delete mode 100644 interface-templates/ipv6/ripng/split-horizon/poison-reverse/node.def diff --git a/Makefile.am b/Makefile.am index f14191ba..db21b096 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,10 +21,6 @@ src_check_prefix_boundary = src/check_prefix_boundary.c cpiop = find . ! -regex '\(.*~\|.*\.bak\|.*\.swp\|.*\#.*\#\)' -print0 | \ cpio -0pd -all-local: - rm -rf $(gentmpdir) - ./gen-interface-templates.pl $(gentmpdir) - clean-local: rm -rf $(gentmpdir) diff --git a/debian/vyatta-cfg-quagga.install b/debian/vyatta-cfg-quagga.install index beaa4132..a15eec20 100644 --- a/debian/vyatta-cfg-quagga.install +++ b/debian/vyatta-cfg-quagga.install @@ -2,18 +2,3 @@ opt/vyatta/sbin opt/vyatta/bin opt/vyatta/share/perl5 opt/vyatta/share/vyatta-cfg/templates/policy -opt/vyatta/share/vyatta-cfg/templates/interfaces/bonding -opt/vyatta/share/vyatta-cfg/templates/interfaces/bridge -opt/vyatta/share/vyatta-cfg/templates/interfaces/ethernet -opt/vyatta/share/vyatta-cfg/templates/interfaces/loopback -opt/vyatta/share/vyatta-cfg/templates/interfaces/openvpn -opt/vyatta/share/vyatta-cfg/templates/interfaces/pppoe -opt/vyatta/share/vyatta-cfg/templates/interfaces/pseudo-ethernet -opt/vyatta/share/vyatta-cfg/templates/interfaces/tunnel -opt/vyatta/share/vyatta-cfg/templates/interfaces/vti -opt/vyatta/share/vyatta-cfg/templates/interfaces/wireless -opt/vyatta/share/vyatta-cfg/templates/interfaces/wirelessmodem -opt/vyatta/share/vyatta-cfg/templates/interfaces/dummy -opt/vyatta/share/vyatta-cfg/templates/interfaces/l2tpv3 -opt/vyatta/share/vyatta-cfg/templates/interfaces/vxlan -opt/vyatta/share/vyatta-cfg/templates/interfaces/wireguard diff --git a/gen-interface-templates.pl b/gen-interface-templates.pl deleted file mode 100755 index 937af0b7..00000000 --- a/gen-interface-templates.pl +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/perl -# -# **** License **** -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# This code was originally developed by Vyatta, Inc. -# Portions created by Vyatta are Copyright (C) 2009 Vyatta, Inc. -# All Rights Reserved. -# -# Author: Stephen Hemminger -# Date: March 2009 -# Description: Script to automatically generate per-interface quagga -# templates. -# -# **** End License **** - -use strict; -use warnings; - -# set DEBUG in environment to test script -my $debug = $ENV{'DEBUG'}; - -# Mapping from configuration level to ifname used AT THAT LEVEL -my %interface_hash = ( - 'loopback/node.tag' => '$VAR(@)', - 'ethernet/node.tag' => '$VAR(@)', - 'ethernet/node.tag/vif/node.tag' => '$VAR(../@).$VAR(@)', - 'ethernet/node.tag/vif-s/node.tag' => '$VAR(../@).$VAR(@)', - 'ethernet/node.tag/vif-s/node.tag/vif-c/node.tag' => '$VAR(../../@).$VAR(../@).$VAR(@)', - 'wireless/node.tag' => '$VAR(@)', - 'wireless/node.tag/vif/node.tag' => '$VAR(../@).$VAR(@)', - 'pppoe/node.tag' => '$VAR(@)', - 'pseudo-ethernet/node.tag' => '$VAR(@)', - 'pseudo-ethernet/node.tag/vif/node.tag' => '$VAR(../@).$VAR(@)', - 'pseudo-ethernet/node.tag/vif-s/node.tag' => '$VAR(../@).$VAR(@)', - 'pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag' => '$VAR(../../@).$VAR(../@).$VAR(@)', - 'bonding/node.tag' => '$VAR(@)', - 'bonding/node.tag/vif/node.tag' => '$VAR(../@).$VAR(@)', - 'bonding/node.tag/vif-s/node.tag' => '$VAR(../@).$VAR(@)', - 'bonding/node.tag/vif-s/node.tag/vif-c/node.tag' => '$VAR(../../@).$VAR(../@).$VAR(@)', - 'tunnel/node.tag' => '$VAR(@)', - 'vti/node.tag' => '$VAR(@)', - 'bridge/node.tag' => '$VAR(@)', - 'openvpn/node.tag' => '$VAR(@)', - 'wirelessmodem/node.tag' => '$VAR(@)', - 'dummy/node.tag' => '$VAR(@)', - 'l2tpv3/node.tag' => '$VAR(@)', - 'vxlan/node.tag' => '$VAR(@)', - 'wireguard/node.tag' => '$VAR(@)', -); - -# Hash table to check if the priority needs to set @ root -# of the node.def which is generated. -my %interface_prio = ( - 'vti/node.tag' => '901', -); - -sub gen_template { - my ( $inpath, $outpath, $ifname, $gen_prio, $prio, $depth ) = @_; - - print $outpath, "\n" if ($debug); - opendir my $d, $inpath - or die "Can't open: $inpath:$!"; - - # walk through sample templates - foreach my $name ( grep { !/^\./ } readdir $d ) { - my $in = "$inpath/$name"; - my $out = "$outpath/$name"; - - # recurse into subdirectory - if ( -d $in ) { - my $subif = $ifname; - $subif =~ s#@\)#../@)#g if ($name ne 'node.tag'); - - ( -d $out ) - or mkdir($out) - or die "Can't create $out: $!"; - - gen_template( $in, $out, $subif, $gen_prio, $prio, $depth+1); - next; - } - - print "in: $in out: $out\n" if ($debug); - open my $inf, '<', $in or die "Can't open $in: $!"; - open my $outf, '>', $out or die "Can't open $out: $!"; - - # For the top node.tag create the priority tag. - if ($name eq 'node.def' && $gen_prio == 1 && $depth <= 1) { - print $outf "priority: $prio\n"; - } - while ( my $line = <$inf> ) { - $line =~ s#\$IFNAME#$ifname#; - print $outf $line; - } - close $inf; - close $outf or die "Close error $out:$!"; - } - closedir $d; -} - -sub mkdir_p { - my $path = shift; - - return 1 if ( mkdir($path) ); - - my $pos = rindex( $path, "/" ); - return unless $pos != -1; - return unless mkdir_p( substr( $path, 0, $pos ) ); - return mkdir($path); -} - -die "Usage: $0 output_directory\n" if ($#ARGV < 0); - -my $outdir = $ARGV[0]; - -foreach my $if_tree ( keys %interface_hash ) { - my $inpath = "interface-templates"; - my $outpath = "$outdir/interfaces/$if_tree"; - ( -d $outpath ) - or mkdir_p($outpath) - or die "Can't create $outpath:$!"; - - my $gen_prio = 0; - my $prio = 0; - $gen_prio = 1 if (exists $interface_prio{ $if_tree }); - if ($gen_prio == 1) { - $prio = $interface_prio{ $if_tree }; - } - - gen_template( $inpath, $outpath, $interface_hash{$if_tree}, - $gen_prio, $prio, 0 ); -} diff --git a/interface-templates/ipv6/ospfv3/bfd/node.def b/interface-templates/ipv6/ospfv3/bfd/node.def deleted file mode 100644 index 74d02f4f..00000000 --- a/interface-templates/ipv6/ospfv3/bfd/node.def +++ /dev/null @@ -1,3 +0,0 @@ -help: Enable Bidirectional Forwarding Detection (BFD) support -create:vtysh -c "configure terminal" -c "interface $IFNAME" -c "ipv6 ospf6 bfd" -delete:vtysh -c "configure terminal" -c "interface $IFNAME" -c "no ipv6 ospf6 bfd" diff --git a/interface-templates/ipv6/ospfv3/cost/node.def b/interface-templates/ipv6/ospfv3/cost/node.def deleted file mode 100644 index be2335a0..00000000 --- a/interface-templates/ipv6/ospfv3/cost/node.def +++ /dev/null @@ -1,8 +0,0 @@ -type: u32 -help: Interface cost -default: 1 -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "Must be between 1-65535" -val_help: u32:1-65535; OSPFv3 cost - -update: vtysh -c "configure terminal" -c "interface $IFNAME" -c "ipv6 ospf6 cost $VAR(@)" - diff --git a/interface-templates/ipv6/ospfv3/dead-interval/node.def b/interface-templates/ipv6/ospfv3/dead-interval/node.def deleted file mode 100644 index 37a44b64..00000000 --- a/interface-templates/ipv6/ospfv3/dead-interval/node.def +++ /dev/null @@ -1,10 +0,0 @@ -type: u32 -help: Interval after which neighbor is declared dead -default: 40 -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "Must be between 1-65535" -val_help: u32:1-65535; Neighbor dead interval in seconds (default 40) - -update: vtysh -c "configure terminal" -c "interface $IFNAME" \ - -c "ipv6 ospf6 dead-interval $VAR(@)" -delete: vtysh -c "configure terminal" -c "interface $IFNAME" \ - -c "ipv6 ospf6 dead-interval 40" diff --git a/interface-templates/ipv6/ospfv3/hello-interval/node.def b/interface-templates/ipv6/ospfv3/hello-interval/node.def deleted file mode 100644 index f81ac5e4..00000000 --- a/interface-templates/ipv6/ospfv3/hello-interval/node.def +++ /dev/null @@ -1,10 +0,0 @@ -type: u32 -help: Interval between hello packets -default: 10 -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "Must be between 1-65535" -val_help: u32:1-65535; Interval between OSPFv3 hello packets in seconds (default 10) - -update: vtysh -c "configure terminal" -c "interface $IFNAME" \ - -c "ipv6 ospf6 hello-interval $VAR(@)" -delete: vtysh -c "configure terminal" -c "interface $IFNAME" \ - -c "ipv6 ospf6 hello-interval 10" diff --git a/interface-templates/ipv6/ospfv3/ifmtu/node.def b/interface-templates/ipv6/ospfv3/ifmtu/node.def deleted file mode 100644 index 18d6d515..00000000 --- a/interface-templates/ipv6/ospfv3/ifmtu/node.def +++ /dev/null @@ -1,7 +0,0 @@ -type: u32 -help: Interface MTU -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "Must be between 1-65535" -val_help: u32:1-65535; Interface MTU - -update: vtysh -c "configure terminal" -c "interface $IFNAME" -c "ipv6 ospf6 ifmtu $VAR(@)" -delete: vtysh -c "configure terminal" -c "interface $IFNAME" -c "no ipv6 ospf6 ifmtu" diff --git a/interface-templates/ipv6/ospfv3/instance-id/node.def b/interface-templates/ipv6/ospfv3/instance-id/node.def deleted file mode 100644 index 7e87411e..00000000 --- a/interface-templates/ipv6/ospfv3/instance-id/node.def +++ /dev/null @@ -1,8 +0,0 @@ -type: u32 -help: Instance-id -default: 0 -syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 255; "Must be between 0-255" -val_help: u32:0-255; Instance Id (default 0) - -update: vtysh -c "configure terminal" -c "interface $IFNAME" -c "ipv6 ospf6 instance-id $VAR(@)" -delete: vtysh -c "configure terminal" -c "interface $IFNAME" -c "ipv6 ospf6 instance-id 0" diff --git a/interface-templates/ipv6/ospfv3/mtu-ignore/node.def b/interface-templates/ipv6/ospfv3/mtu-ignore/node.def deleted file mode 100644 index 2edf5205..00000000 --- a/interface-templates/ipv6/ospfv3/mtu-ignore/node.def +++ /dev/null @@ -1,3 +0,0 @@ -help: Disable Maximum Transmission Unit mismatch detection -create:vtysh -c "configure terminal" -c "interface $IFNAME" -c "ipv6 ospf6 mtu-ignore" -delete:vtysh -c "configure terminal" -c "interface $IFNAME" -c "no ipv6 ospf6 mtu-ignore" diff --git a/interface-templates/ipv6/ospfv3/network/node.def b/interface-templates/ipv6/ospfv3/network/node.def deleted file mode 100644 index d1f6292d..00000000 --- a/interface-templates/ipv6/ospfv3/network/node.def +++ /dev/null @@ -1,9 +0,0 @@ -type: txt -help: Network type -syntax:expression: $VAR(@) in "broadcast", "point-to-point"; \ - "Must be (broadcast|point-to-point)" -update:vtysh -c "configure terminal" -c "interface $IFNAME" -c "ipv6 ospf network $VAR(@)" -delete:vtysh -c "configure terminal" -c "interface $IFNAME" -c "no ipv6 ospf network" - -val_help: broadcast; Broadcast network type -val_help: point-to-point; Point-to-point network type diff --git a/interface-templates/ipv6/ospfv3/node.def b/interface-templates/ipv6/ospfv3/node.def deleted file mode 100644 index 43905a53..00000000 --- a/interface-templates/ipv6/ospfv3/node.def +++ /dev/null @@ -1 +0,0 @@ -help: IPv6 Open Shortest Path First (OSPFv3) diff --git a/interface-templates/ipv6/ospfv3/passive/node.def b/interface-templates/ipv6/ospfv3/passive/node.def deleted file mode 100644 index b4665b34..00000000 --- a/interface-templates/ipv6/ospfv3/passive/node.def +++ /dev/null @@ -1,3 +0,0 @@ -help: Disable forming of adjacency -create: vtysh -c "configure terminal" -c "interface $IFNAME" -c "ipv6 ospf6 passive" -delete: vtysh -c "configure terminal" -c "interface $IFNAME" -c "no ipv6 ospf6 passive" diff --git a/interface-templates/ipv6/ospfv3/priority/node.def b/interface-templates/ipv6/ospfv3/priority/node.def deleted file mode 100644 index 61f7c9be..00000000 --- a/interface-templates/ipv6/ospfv3/priority/node.def +++ /dev/null @@ -1,8 +0,0 @@ -type: u32 -help: Router priority -default: 1 -syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 255; "Must be between 0-255" -val_help: u32:0-255; Priority (default 1) - -update: vtysh -c "configure terminal" -c "interface $IFNAME" -c "ipv6 ospf6 priority $VAR(@)" -delete: vtysh -c "configure terminal" -c "interface $IFNAME" -c "ipv6 ospf6 priority 1" diff --git a/interface-templates/ipv6/ospfv3/retransmit-interval/node.def b/interface-templates/ipv6/ospfv3/retransmit-interval/node.def deleted file mode 100644 index 3271bd50..00000000 --- a/interface-templates/ipv6/ospfv3/retransmit-interval/node.def +++ /dev/null @@ -1,10 +0,0 @@ -type: u32 -help: Interval between retransmitting lost link state advertisements -default: 5 -syntax:expression: $VAR(@) >= 3 && $VAR(@) <= 65535; "Must be between 3-65535" -val_help: u32:3-65535; Retransmit interval in seconds (default 5) - -update: vtysh -c "configure terminal" -c "interface $IFNAME" \ - -c "ipv6 ospf6 retransmit-interval $VAR(@)" -delete: vtysh -c "configure terminal" -c "interface $IFNAME" \ - -c "ipv6 ospf6 retransmit-interval 5" diff --git a/interface-templates/ipv6/ospfv3/transmit-delay/node.def b/interface-templates/ipv6/ospfv3/transmit-delay/node.def deleted file mode 100644 index 137e5a89..00000000 --- a/interface-templates/ipv6/ospfv3/transmit-delay/node.def +++ /dev/null @@ -1,10 +0,0 @@ -type: u32 -help: Link state transmit delay -default: 1 -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "Must be between 1-65535" -val_help: u32:1-65535; Link state transmit delay (default 1) - -update: vtysh -c "configure terminal" -c "interface $IFNAME" \ - -c "ipv6 ospf6 transmit-delay $VAR(@)" -delete: vtysh -c "configure terminal" -c "interface $IFNAME" \ - -c "ipv6 ospf6 transmit-delay 1" diff --git a/interface-templates/ipv6/ripng/node.def b/interface-templates/ipv6/ripng/node.def deleted file mode 100644 index 69d49298..00000000 --- a/interface-templates/ipv6/ripng/node.def +++ /dev/null @@ -1 +0,0 @@ -help: Routing Information Protocol (RIPng) diff --git a/interface-templates/ipv6/ripng/split-horizon/disable/node.def b/interface-templates/ipv6/ripng/split-horizon/disable/node.def deleted file mode 100644 index ce6ab8a6..00000000 --- a/interface-templates/ipv6/ripng/split-horizon/disable/node.def +++ /dev/null @@ -1,6 +0,0 @@ -help: Disable split horizon -create: vtysh -c "configure terminal" -c "interface $IFNAME" -c "no ipv6 ripng split-horizon" -delete: vtysh -c "configure terminal" -c "interface $IFNAME" -c "ipv6 ripng split-horizon" - -commit:expression: ($VAR(../poison-reverse/) == ""); \ - "You cannot have 'split-horizon poison-reverse' enabled with 'split-horizon' disabled for $IFNAME" diff --git a/interface-templates/ipv6/ripng/split-horizon/node.def b/interface-templates/ipv6/ripng/split-horizon/node.def deleted file mode 100644 index c4fb5ddc..00000000 --- a/interface-templates/ipv6/ripng/split-horizon/node.def +++ /dev/null @@ -1 +0,0 @@ -help: Split horizon parameters diff --git a/interface-templates/ipv6/ripng/split-horizon/poison-reverse/node.def b/interface-templates/ipv6/ripng/split-horizon/poison-reverse/node.def deleted file mode 100644 index 82010036..00000000 --- a/interface-templates/ipv6/ripng/split-horizon/poison-reverse/node.def +++ /dev/null @@ -1,9 +0,0 @@ -help: Enable poison reverse for split-horizon -create: vtysh -c "configure terminal" -c "interface $IFNAME" \ - -c "ipv6 ripng split-horizon poisoned-reverse" - -delete: vtysh -c "configure terminal" -c "interface $IFNAME" \ - -c "no ipv6 ripng split-horizon" -c "ipv6 ripng split-horizon" - -commit:expression: ($VAR(../disable/) == ""); \ - "You cannot have 'split-horizon poison-reverse' enabled with 'split-horizon' disabled for $IFNAME" -- cgit v1.2.3