NAME
App::Netdisco::AnyEvent::Nbtstat - Request NetBIOS node status with AnyEvent
SYNOPSIS
use App::Netdisco::AnyEvent::Nbtstat;;
my $request = App::Netdisco::AnyEvent::Nbtstat->new();
my $cv = AE::cv;
$request->nbtstat(
'127.0.0.1',
sub {
my $result = shift;
print "MAC: ", $result->{'mac_address'} || '', " ";
print "Status: ", $result->{'status'}, "\n";
printf '%3s %-18s %4s %-18s', '', 'Name', '', 'Type'
if ( $result->{'status'} eq 'OK' );
print "\n";
for my $rr ( @{ $result->{'names'} } ) {
printf '%3s %-18s <%02s> %-18s', '', $rr->{'name'},
$rr->{'suffix'},
$rr->{'G'};
print "\n";
}
$cv->send;
}
);
$cv->recv;
DESCRIPTION
App::Netdisco::AnyEvent::Nbtstat is an asynchronous AnyEvent NetBIOS node status requester.
ATTRIBUTES
App::Netdisco::AnyEvent::Nbtstat implements the following attributes.
interval
my $interval = $request->interval;
$request->interval(1);
Interval between requests, defaults to 0.02 seconds.
timeout
my $timeout = $request->timeout;
$request->timeout(2);
Maximum request response time, defaults to 0.5 seconds.
METHODS
App::Netdisco::AnyEvent::Nbtstat implements the following methods.
nbtstat
$request->nbtstat($ip, sub {
my $result = shift;
});
Perform a NetBIOS node status request of $ip.