use Data::Dumper;

$n = new A3Com::ARP (
    CACHE => 0,
    GLOBALCACHE => 0,
);

$n->switch ("bd4-edge1");

%a = $n->arp_table;

foreach my $k (keys %a)
{
    print "$k -> $a{$k}\n";
}

exit;

$n = new A3Com::BridgeTable (
    "SWITCH" => "bd4-edge1",
    "LOGIN" => "root",
    "PASSWORD" => "",
    "ENABLE" => "",
    "LOG" => 0,
    "CACHE" => 0,
    "GLOBALCACHE" => 0,
);

print STDERR "calling btable\n";

%a = $n->btable();

print STDERR "btable returned (" . $n->error . ")\n";

print STDERR Dumper (\%a), "\n";

exit;

for (sort {$a <=> $b} keys %a) {
    print "$_=@{$a{$_}}\n";
}

exit;

my %h = $n->load_history ("out");

my (%n) = $n->merge_current_with_history (\%a, \%h, scalar (time));

if ($n->error ne "")
{
    print $n->error, " error\n";
}

$n->save_history (\%n, "out");

exit;

use A3Com::ARP;

$n = new A3Com::ARP (
    CACHE => 0,
    GLOBALCACHE => 0,
);

$n->switch ("helium");

%a = $n->arp_table;

foreach my $k (keys %a)
{
    print "$k -> $a{$k}\n";
}

exit;
use A3Com::BridgeTable;

$n = new A3Com::BridgeTable (
    SWITCH => "sw2-3",
    CACHE => 0,
    GLOBALCACHE => 0,
);

%a = $n->btable();

for (keys %a) {
    print "$_=@{$a{$_}}\n";
}

exit;
use A3Com::ARP;

$ENV{"A3COM_GLOBALCACHEDIR"} = "$ENV{HOME}/.a3comglobal";

$n = new A3Com::ARP (
    SWITCH => "hydrogen",
    GLOBALCACHE => 0,
    CACHE => 0,
);

die if (!defined $n);


$t = time;

$c = {
    "10.1.1.225" => "00:a0:c9:67:d6:2a",
};

$h = $n->load_history ("out.arp");

if ($n->error ne "") {
    die "load error: " . $n->error . "\n";
}

$m = $n->merge_current_with_history (
    $c,
    $h,
    $t,
);


$n->save_history ("out1.arp", $h);

if ($n->error ne "") {
    die "save error: " . $n->error . "\n";
}

exit;
use A3Com::ARP;

$n = new A3Com::ARP;
$n->switch ("helium");

for ($n->mac_addrs) {
    print "$_\n";
}


__END__
use A3Com::EtherDetail;

$n = new A3Com::EtherDetail;
$n->switch ("sw27-3");
$n->cache(1);

@p = $n->ports;
die $n->error . "\n" if (!defined $p[0]);

print "[@p]\n";

print $n->port_val (1, "rxFrameRate"), "\n";

__END__
use A3Com::Password;

$n = new A3Com::Password;
$n->switch ("10.1.27.100");
$n->login ("adm");
$n->password ("transmeta");
$n->log (1);

$result = $n->set_admpassword ("transmeta");
if ($result eq undef) {
    die "*** ERROR: " . $n->error, "\n";
}

exit (0);


__END__
use A3Com::BridgeTable;

$n = new A3Com::BridgeTable;
$n->switch ("testsw");
$n->log (0);
$n->cache (1);


@i = $n->mac("0:0:0:1:1:1");

die $n->error, "\n"
    if (!defined (@macs = $n->macs));

for (@macs) { print "mac [$_]\n"; }

die $n->error, "\n"
    if (!defined (@ports = $n->ports));

for (@ports) { print "port [$_]\n"; }
__END__


die $n->error, "\n"
    if (!defined (@i = $n->ip_addrs));
for (@i) { print "ip [$_]\n"; }

die $n->error, "\n"
    if (!defined (@m = $n->mac_addrs));
for (@m) { print "mac [$_]\n"; }

__END__
