Net::U...olPoint(3pm)
β¨ Net::UPnP::ControlPoint β the perl module bestie π
okay so this is a page from the User Contributed Perl Documentation, and it's all about Net::UPnP::ControlPoint, a Perl extension for a UPnP control point. yes girl, we're finding devices on the network. slay.
πΈ NAME πΈ
Net::UPnP::ControlPoint β Perl extension for UPnP control point. that's the whole vibe. it's the little module that goes out into your LAN and finds your stuff. periodt. π«Ά
β¨ SYNOPSIS β¨
here's the whole thing, literally copy-paste-able, no cap:
use Net::UPnP::ControlPoint;
my $obj = Net::UPnP::ControlPoint->new();
@dev_list = $obj->search(st =>'upnp:rootdevice', mx => 3);
$devNum= 0;
foreach $dev (@dev_list) {
$device_type = $dev->getdevicetype();
if ($device_type ne 'urn:schemas-upnp-org:device:MediaServer:1') {
next;
}
print "[$devNum] : " . $dev->getfriendlyname() . "\n";
unless ($dev->getservicebyname('urn:schemas-upnp-org:service:ContentDirectory:1')) {
next;
}
$condir_service = $dev->getservicebyname('urn:schemas-upnp-org:service:ContentDirectory:1');
unless (defined(condir_service)) {
next;
}
%action_in_arg = (
'ObjectID' => 0,
'BrowseFlag' => 'BrowseDirectChildren',
'Filter' => '*',
'StartingIndex' => 0,
'RequestedCount' => 0,
'SortCriteria' => '',
);
$action_res = $condir_service->postcontrol('Browse', \%action_in_arg);
$actrion_out_arg = $action_res->getargumentlist();
unless ($actrion_out_arg->{'Result'}) {
next;
}
$result = $actrion_out_arg->{'Result'};
while ($result =~ m/<dc:title>(.*?)<\/dc:title>/sgi) {
print "\t$1\n";
}
$devNum++;
}
look at her go π she's browsing a MediaServer's ContentDirectory and printing every <dc:title> she finds. main character energy fr fr. π
π¦ DESCRIPTION π¦
The package can search UPnP devices in the local network and get the device list of Net::UPnP::Device.
that's it. that's the whole job. she looks around your network, she finds the devices, and she hands you back a list of Net::UPnP::Device objects. iconic. π
π METHODS π
new β create new Net::UPnP::ControlPoint π±
$ctrlPoint = Net::UPnP::ControlPoint();
Creates a new object. Read perldoc perlboot if you don't understand that.
ngl bestie, if the blessed-reference thing is confusing you, that's literally what perlboot is for. go read it. it's giving tutorial. π
search β search UPnP devices π
@device_list = $ctrlPoint->search();
@device_list = $ctrlPoint->search(
[st => $search_target], # 'upnp:rootdevice'
[mx => $maximum_wait] # 3
);
Search UPnP devices and return the device list. Please see Net::UPnP::Device too.
so like, call it with no args and it does its thing, or hand it st and mx and it does its thing your way. the st is the search target (like 'upnp:rootdevice') and mx is the maximum wait (like 3). then you get back a list of devices. go look at Net::UPnP::Device for what those objects can do. π
π SEE ALSO π
Net::UPnP::Deviceβ the whole point of the search, honestly. your devices live there. π¦
π AUTHOR π
Satoshi Konno skonno@cybergarage.org
CyberGarage http://www.cybergarage.org
ty for your service king π«‘
π COPYRIGHT AND LICENSE π
Copyright (C) 2005 by Satoshi Konno
It may be used, redistributed, and/or modified under the terms of BSD License.
so like, BSD License terms, bestie. use it, share it, remix it β just respect the license, okay? π
and that's the whole page!! this was Net::UPnP::ControlPoint(3pm) from the User Contributed Perl Documentation, rendered with perl v5.36.0, dated 2022-12-06. go find some devices, babe. mwah π
β¨π
π¦ where this page comes from
- debian bookworm: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- debian trixie: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- ubuntu noble: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- ubuntu resolute: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- ubuntu stonking: libnet-upnp-perl 1.4.6-2 Β· BSD-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms