summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-05-14 13:56:28 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-05-14 13:56:28 -0700
commitc859a613509619459122f5823e1764fef392f43a (patch)
tree15eb841e4df69c3aea16ad3e2f7102ef8ec4529b
parent53a7bece51cfb07a8e3dd581aa04580f0cd7d71e (diff)
parent6851a2b28cb7c15bfc4a884c8bd11d784389a8ed (diff)
downloadvyatta-cfg-c859a613509619459122f5823e1764fef392f43a.tar.gz
vyatta-cfg-c859a613509619459122f5823e1764fef392f43a.zip
Merge branch 'hollywood' of suva.vyatta.com:/git/vyatta-cfg into hollywood
-rw-r--r--.gitignore1
l---------ChangeLog1
-rwxr-xr-xdebian/autogen.sh26
-rw-r--r--debian/changelog38
-rwxr-xr-xetc/init.d/vyatta-ofr2
-rwxr-xr-xscripts/VyattaConfigLoad.pm58
-rwxr-xr-xscripts/vyatta-interfaces.pl45
7 files changed, 122 insertions, 49 deletions
diff --git a/.gitignore b/.gitignore
index 765492c..082e2ef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,7 +10,6 @@ libtool
/aclocal.m4
/autom4te.cache
/build-stamp
-/ChangeLog
/config
/config.log
/config.guess
diff --git a/ChangeLog b/ChangeLog
new file mode 120000
index 0000000..d526672
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1 @@
+debian/changelog \ No newline at end of file
diff --git a/debian/autogen.sh b/debian/autogen.sh
index ff125d1..e8c94af 100755
--- a/debian/autogen.sh
+++ b/debian/autogen.sh
@@ -1,32 +1,6 @@
#!/bin/sh
-if [ -d .git ] ; then
-# generate GNU/Debian format ChangeLog from git log
-
- rm -f ChangeLog
-
- if which git2cl >/dev/null ; then
- git-log --pretty --numstat --summary | git2cl >> ChangeLog
- else
- git-log --pretty=short >> ChangeLog
- fi
-
-# append repository reference
-
- url=` git repo-config --get remote.origin.url`
- test "x$url" = "x" && url=`pwd`
-
- branch=`git-branch --no-color | sed '/^\* /!d; s/^\* //'`
- test "x$branch" = "x" && branch=master
-
- sha=`git log --pretty=oneline --no-color -n 1 | cut -c-8`
- test "x$sha" = "x" && sha=00000000
-
- echo "$url#$branch-$sha" >> ChangeLog
-
-fi
-
rm -rf config
rm -f aclocal.m4 config.guess config.statusconfig.sub configure INSTALL
diff --git a/debian/changelog b/debian/changelog
index e1076c5..734169c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,41 @@
+vyatta-cfg (0.9) unstable; urgency=low
+
+ 3.0.5
+
+
+ -- Mark O'Brien <mobrien@vyatta.com> Tue, 06 May 2008 12:43:19 -0700
+
+vyatta-cfg (0.8) unstable; urgency=low
+
+ 3.0.4
+ [ Mark O'Brien ]
+
+
+ [ An-Cheng Huang ]
+ * support "wildcard" ranking at boot time. only VRRP uses this for
+ now.
+
+ [ Mark O'Brien ]
+
+ -- Mark O'Brien <mobrien@vyatta.com> Mon, 05 May 2008 16:40:38 -0700
+
+vyatta-cfg (0.7) unstable; urgency=low
+
+ 3.0.3
+ [ Mark O'Brien ]
+
+
+ [ Stephen Hemminger ]
+ * Remove hack to cycle state for static routes
+ * Eliminate vestigates of watchlink
+
+ [ rbalocca ]
+ * Indicate the VC4.0.2 release candidate in the changelog
+
+ [ Mark O'Brien ]
+
+ -- Mark O'Brien <mobrien@vyatta.com> Tue, 29 Apr 2008 16:42:21 -0700
+
vyatta-cfg (0.6) unstable; urgency=low
VC4.0.2
diff --git a/etc/init.d/vyatta-ofr b/etc/init.d/vyatta-ofr
index 776aaf4..9309a57 100755
--- a/etc/init.d/vyatta-ofr
+++ b/etc/init.d/vyatta-ofr
@@ -4,7 +4,7 @@
# Required-Start: $syslog $time $local_fs
# Required-Stop: $syslog $time $local_fs
# Default-Start: 2 3 4 5
-# Default-Stop: S 0 1 6
+# Default-Stop: 0 1 6
# Short-Description: Vyatta Router
# Description: Debian init script for the Vyatta Router
### END INIT INFO
diff --git a/scripts/VyattaConfigLoad.pm b/scripts/VyattaConfigLoad.pm
index 2efa81e..bf86e57 100755
--- a/scripts/VyattaConfigLoad.pm
+++ b/scripts/VyattaConfigLoad.pm
@@ -23,30 +23,58 @@ package VyattaConfigLoad;
use strict;
use sort 'stable';
use lib "/opt/vyatta/share/perl5/";
-use XorpConfigParser;
+use XorpConfigParser;
use VyattaConfig;
# configuration ordering. higher rank configured before lower rank.
my $default_rank = 0;
my %config_rank = (
- 'qos-policy' => 110,
- 'firewall' => 102,
- 'service nat' => 101,
- 'interfaces' => 100,
- 'interfaces bridge' => 99,
- 'interfaces ethernet' => 98,
- 'interfaces tunnel' => 91,
- 'system' => 90,
- 'protocols static' => 85,
- 'service ssh' => 84,
- 'service telnet' => 83,
- 'policy' => 82,
- 'vpn' => 80,
+ 'qos-policy' => 1100,
+ 'firewall' => 1020,
+ 'service nat' => 1010,
+ 'interfaces' => 1000,
+ 'interfaces bridge' => 990,
+ 'interfaces ethernet' => 980,
+ 'interfaces tunnel' => 910,
+ 'system gateway-address'=> 890,
+ 'system name-server' => 880,
+ 'system login user' => 870,
+ 'system' => 860,
+ 'protocols static' => 850,
+ 'service ssh' => 840,
+ 'service telnet' => 830,
+ 'policy' => 820,
+ 'protocols bgp' => 790,
+ 'protocols ospf' => 780,
+ 'protocols rip' => 770,
+ 'vpn' => 600,
+);
+
+my %regex_rank = (
+ 'interfaces ethernet \S* vrrp' => 500,
+ 'interfaces ethernet \S* vif \S* vrrp' => 500,
+ 'protocols bgp \d+ neighbor \S*[^\d.]\S*' => 800,
);
my @all_nodes = ();
my @all_naked_nodes = ();
+sub match_regex {
+ my ($pattern, $str) = @_;
+ $pattern =~ s/^(.*)$/\^$1\$/;
+ return ($str =~ m/$pattern/) ? 1 : 0;
+}
+
+sub get_regex_rank {
+ my ($str) = @_;
+ foreach (keys %regex_rank) {
+ if (match_regex($_, $str)) {
+ return $regex_rank{$_};
+ }
+ }
+ return undef;
+}
+
sub get_config_rank {
# longest prefix match
my @path = @_;
@@ -55,6 +83,8 @@ sub get_config_rank {
if (defined($config_rank{$path_str})) {
return ($config_rank{$path_str});
}
+ my $wrank = get_regex_rank($path_str);
+ return $wrank if (defined($wrank));
pop @path;
}
return $default_rank;
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl
index de82edd..dd71d7a 100755
--- a/scripts/vyatta-interfaces.pl
+++ b/scripts/vyatta-interfaces.pl
@@ -195,6 +195,21 @@ sub dhcp_get_interfaces {
}
}
}
+
+ $config->setLevel("interfaces bridge");
+ my @brs = $config->listNodes();
+ foreach my $br (@brs) {
+ $config->setLevel("interfaces bridge $br");
+ if ($config->exists("address")) {
+ my @addrs = $config->returnValues("address");
+ foreach my $addr (@addrs) {
+ if (defined $addr && $addr eq "dhcp") {
+ push @dhcp_intfs, $br;
+ }
+ }
+ }
+ }
+
return @dhcp_intfs;
}
@@ -203,10 +218,20 @@ sub is_dhcp_enabled {
my $config = new VyattaConfig;
- if ($intf =~ m/(\w+)\.(\d)/) {
- $config->setLevel("interfaces ethernet $1 vif $2");
+ if ($intf =~ m/^eth/) {
+ if ($intf =~ m/(\w+)\.(\d+)/) {
+ $config->setLevel("interfaces ethernet $1 vif $2");
+ } else {
+ $config->setLevel("interfaces ethernet $intf");
+ }
+ } elsif ($intf =~ m/^br/) {
+ $config->setLevel("interfaces bridge $intf");
} else {
- $config->setLevel("interfaces ethernet $intf");
+ #
+ # currently we only support dhcp on ethernet
+ # and bridge interfaces.
+ #
+ return 0;
}
my @addrs = $config->returnOrigValues("address");
foreach my $addr (@addrs) {
@@ -221,11 +246,17 @@ sub is_address_enabled {
my $intf = shift;
my $config = new VyattaConfig;
-
- if ($intf =~ m/(\w+)\.(\d)/) {
- $config->setLevel("interfaces ethernet $1 vif $2");
+
+ if ($intf =~ m/^eth/) {
+ if ($intf =~ m/(\w+)\.(\d+)/) {
+ $config->setLevel("interfaces ethernet $1 vif $2");
+ } else {
+ $config->setLevel("interfaces ethernet $intf");
+ }
+ } elsif ($intf =~ m/^br/) {
+ $config->setLevel("interfaces bridge $intf");
} else {
- $config->setLevel("interfaces ethernet $intf");
+ die "unsupported dhcp interface [$intf]";
}
my @addrs = $config->returnOrigValues("address");
foreach my $addr (@addrs) {