2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-21 20:06:18 +00:00

98_DLNARenderer: support ignoredIPs and usedonlyIPs attribute

git-svn-id: https://svn.fhem.de/fhem/trunk@15828 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
dominikkarall 2018-01-08 18:41:15 +00:00
parent d2a02bc134
commit 5c77492dc3

View File

@ -2,6 +2,9 @@
# Author: dominik.karall@gmail.com # Author: dominik.karall@gmail.com
# $Id$ # $Id$
# #
# v2.0.7 - 20180108
# - FEATURE: support ignoredIPs and usedonlyIPs attribute
#
# v2.0.6 - 20171209 # v2.0.6 - 20171209
# - FEATURE: support acceptedUDNs for UDN whitelisting (thx@MichaelT!) # - FEATURE: support acceptedUDNs for UDN whitelisting (thx@MichaelT!)
# - BUGFIX: fix renew subscriptions errors on offline devices # - BUGFIX: fix renew subscriptions errors on offline devices
@ -192,7 +195,7 @@ sub DLNARenderer_Define($$) {
if(@param < 3) { if(@param < 3) {
#main #main
$hash->{UDN} = 0; $hash->{UDN} = 0;
my $VERSION = "v2.0.6"; my $VERSION = "v2.0.7";
$hash->{VERSION} = $VERSION; $hash->{VERSION} = $VERSION;
Log3 $hash, 3, "DLNARenderer: DLNA Renderer $VERSION"; Log3 $hash, 3, "DLNARenderer: DLNA Renderer $VERSION";
DLNARenderer_setupControlpoint($hash); DLNARenderer_setupControlpoint($hash);
@ -1172,13 +1175,14 @@ sub DLNARenderer_updateMetaDataItemPart {
############################## ##############################
sub DLNARenderer_setupControlpoint { sub DLNARenderer_setupControlpoint {
my ($hash) = @_; my ($hash) = @_;
my %empty = ();
my $error; my $error;
my $cp; my $cp;
my @usedonlyIPs = split(/,/, AttrVal($hash->{NAME}, 'usedonlyIPs', ''));
my @ignoredIPs = split(/,/, AttrVal($hash->{NAME}, 'ignoredIPs', ''));
do { do {
eval { eval {
$cp = UPnP::ControlPoint->new(SearchPort => 0, SubscriptionPort => 0, MaxWait => 30, UsedOnlyIP => \%empty, IgnoreIP => \%empty); $cp = UPnP::ControlPoint->new(SearchPort => 0, SubscriptionPort => 0, MaxWait => 30, UsedOnlyIP => \@usedonlyIPs, IgnoreIP => \@ignoredIPs);
$hash->{helper}{controlpoint} = $cp; $hash->{helper}{controlpoint} = $cp;
DLNARenderer_addSocketsToMainloop($hash); DLNARenderer_addSocketsToMainloop($hash);