Commit 1a2aa056 authored by Binh Nguyen's avatar Binh Nguyen

Move get_interface_map.pl to frr-ovs

parent 6cd1cee6
#!/bin/bash
LB_IP=197
INF="/proj/PhantomNet/binh/simeca_scripts/get_interface_map.pl"
INF="./get_interface_map.pl"
#NODE0
hn=$(hostname | awk -F'.' '{print $1}')
......
#!/usr/bin/perl -w
BEGIN {
require "/etc/emulab/paths.pm";
import emulabpaths;
}
use libsetup;
my $FINDIF = "$BINDIR/findif";
# lans that this node is a member of.
#
my %ifmap = ();
my @ifconfigs = ();
if (getifconfig(\@ifconfigs) != 0) {
warn "Could not fetch Emulab interfaces configuration!";
return undef;
}
foreach my $ifconfig (@ifconfigs) {
my $ip = $ifconfig->{IPADDR};
my $mac = $ifconfig->{MAC};
my $lan = $ifconfig->{LAN};
next unless $mac && $lan;
#print "Debug: checking interface: $mac/$ip/$lan\n"
my $iface = `$FINDIF -m $mac`;
chomp $iface;
if ($? != 0 || !$iface) {
warn "Emulab's findif tool failed for ip address: $ip\n";
next;
}
print "$lan -> $iface -> $ip -> $mac\n";
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment