/usr/share/lightsquid/ip2name/ip2name.demo is in lightsquid 1.8-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #contributor: esl
#return user, if defined ;-)
#return hostname if defined,
#if hostname not definet, for homensubnet return 192.168.1.10 -> #010
#else - return ip
#skip ip 192.168.1.250
$homesubnet = "192.168.1.";
sub StartIp2Name() {
}
sub Ip2Name($$$) {
# $Lhost,$user,$Ltimestamp
my $IP=shift;
my $userid=shift;
my $user=$IP;
return $userid if ($userid ne "-");
my $user2 = `host $user`;
$user2 =~ m/domain name pointer (.*?).$/;
$user2 = $1;
if ($user2 =~ m/$oursubnet(\d*)/) {$user = sprintf("#%03d",$1);}
else {$user = $user2;}
return $user;
}
sub StopIp2Name() {
}
#WARNING !!!!!
1;
|