NetworkInfo::Discovery::Rendezvous - NetworkInfo::Discovery extension to find Rendezvous services
Version 0.06
use NetworkInfo::Discovery::Rendezvous; my $scanner = new NetworkInfo::Discovery::Rendezvous domain => 'example.net'; $scanner->do_it; # print the list of services sorted by host for my $host ($scanner->get_interfaces) { printf "%s (%s)\n", $host->{nodename}, $host->{ip}; for my $service (@{$host->{services}}) { printf " %s (%s:%d)\n", $service->{name}, $service->{protocol}, $service->{port} } } # print the list of services by service name for my $service (sort {$a->{name} cmp $b->{name}} $scanner->get_services) { printf "--- %s ---\n", $service->{name}; for my $host (sort @{$service->{hosts}}) { printf " %s (%s:%s:%d)\n %s\n", $host->{nodename}, $host->{ip}, $host->{services}[0]{protocol}, $host->{services}[0]{port} } }
See also eg/rvdisc.pl for a more complete example.
This module is an extension to NetworkInfo::Discovery which can find services that register themselves using DNS-SD (DNS Service Discovery), the services discovery protocol behind Apple Rendezvous.
NetworkInfo::Discovery
It will first try to enumerate all the registered services by querying the dns-sd pseudo-service, which is available since the latest versions of mDNSResponder. If nothing is returned, it will then query some well-known services like afpovertcp.
dns-sd
afpovertcp
Creates and returns a new NetworkInfo::Discovery::Rendezvous object, which derives from NetworkInfo::Discovery::Detect.
NetworkInfo::Discovery::Rendezvous
NetworkInfo::Discovery::Detect
Options
domain - expects a scalar or an arrayref of domains
domain
Example
# specify one domain my $scanner = new NetworkInfo::Discovery::Rendezvous domain => 'example.net'; # specify several domains my $scanner = new NetworkInfo::Discovery::Rendezvous domain => [ qw(local example.net) ];
Run the services discovery.
Returns the list of discovered services.
Discover instances of a given service.
Add domains to the search list.
Examples
$scanner->domain('zeroconf.org'); $scanner->domain(qw(local zeroconf.org example.com));
NetworkInfo::Discovery, Net::Rendezvous
Sébastien Aperghis-Tramoni, <sebastien@aperghis.net>
Please report any bugs or feature requests to bug-networkinfo-discovery-rendezvous@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/Bugs.html?Dist=NetworkInfo-Discovery-Rendezvous. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-networkinfo-discovery-rendezvous@rt.cpan.org
Copyright 2004-2006 Sébastien Aperghis-Tramoni, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install NetworkInfo::Discovery::Rendezvous, copy and paste the appropriate command in to your terminal.
cpanm
cpanm NetworkInfo::Discovery::Rendezvous
CPAN shell
perl -MCPAN -e shell install NetworkInfo::Discovery::Rendezvous
For more information on module installation, please visit the detailed CPAN module installation guide.