X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXUser.pm;h=a2617a31884d80dd632c4193dba45928e9a8d4ee;hb=f18ba64dd93bbf7c47e6b5143bfc99af817888e8;hp=3497fa8af71e4eb41b3d8bba230dc26e5449ff86;hpb=a8231fd4a9b0626eaa5ec376a3fb0ee371854649;p=spider.git diff --git a/perl/DXUser.pm b/perl/DXUser.pm index 3497fa8a..a2617a31 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -92,7 +92,7 @@ $noips = 4; believe => '1,Believable nodes,parray', lastping => '1,Last Ping at,ptimelist', maxconnect => '1,Max Connections', - ip => '1,IP address', + ip => '1,IP addresses,piplist', ); #no strict; @@ -189,6 +189,21 @@ sub del_file unlink "$main::local_data/users.v3"; } +# IP address handling +# this allows one to ask whether an IP address has been used with this node or let's one set an IP address for this node. +sub ip +{ + my $self = shift; + my $node = shift; + my $ipin = shift; + + $self->{ip} = {} unless ref $self->{ip}; + my $ref = $self->{ip}; + delete $ref->{''}; + $ref->{$node} = [$ipin, $main::systime] if $ipin; + return $ref->{$node}->[0]; +} + # # periodic processing #