Skip to content

Commit

Permalink
[BF] update route server comparison code to reflect changes in defaul…
Browse files Browse the repository at this point in the history
…t bird config
  • Loading branch information
nickhilliard committed Nov 18, 2014
1 parent 5528b5d commit 8ca7ddc
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tools/runtime/route-servers/compare-route-server-prefixes.pl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
# https://github.com/inex/IXP-Manager/wiki/Installation-08-Setting-Up-Your-IXP#perl-libraries
#
#
# NB: Ensure you set $conffile and $sockfile in the protocols loop below (search for XXX-SET-ME)
# NB: Ensure you set $vlanid, $conffile and $sockfile in the protocols loop
# below (search for XXX-SET-ME)


use strict;
Expand All @@ -46,6 +47,9 @@
my $debug = 1;
my $do_nothing = 1;

# XXX-SET-ME
my $vlanid = "1";

my $ixpconfig = new IXPManager::Config;
my $dbh = $ixpconfig->{db};
my ($query, $sth);
Expand Down Expand Up @@ -99,8 +103,8 @@

foreach my $protocol (qw(4 6)) {
# XXX-SET-ME
my $conffile = "/usr/local/etc/bird/bird-vlanidXXX-ipv".$protocol.".conf";
my $sockfile = "/var/run/bird/bird-vlanidXXX-ipv".$protocol.".ctl";
my $conffile = "/etc/bird/bird-vlanid".$vlanid."-ipv".$protocol.".conf";
my $sockfile = "/var/run/bird/bird-vlanid".$vlanid."-ipv".$protocol.".ctl";

open (INPUT, $conffile);
my ($asn, $address, $prefixes);
Expand Down Expand Up @@ -147,7 +151,9 @@
$dbh->do('START TRANSACTION') or die $dbh->errstr;

foreach my $asn (@asnlist) {
open (INPUT, '/usr/sbin/birdc -s '.$sockfile.' show route table t_' . $vliidhash{ $asn } . '_as'.$asn.' protocol pb_as'.$asn.' |');
my $cmd = '/usr/sbin/birdc -s '.$sockfile.' show route table t_' . $vliidhash{ $asn } . '_as'.$asn.' protocol pb_' . $vliidhash{ $asn } . '_as'.$asn;
print "BIRD: $cmd\n" if ($debug);
open (INPUT, $cmd.' |');
while (<INPUT>) {
# 195.189.221.0/24 via 193.242.111.17 on vlan10 [pb_as2110 May17] * (100) [AS22711i]
next unless (/^([A-Fa-f0-9:\.]+\/\d+)\s+via\s+.*\[AS(\d+)\S*\]/);
Expand Down

0 comments on commit 8ca7ddc

Please sign in to comment.