Subject: | [PATCH] patch to get client-hostname from leases |
Date: | Mon, 23 Feb 2009 19:35:05 -0300 |
To: | bug-Net-DHCP-Info [...] rt.cpan.org |
From: | Paulino Kenji Sato <pksato [...] gmail.com> |
Hello,
I make this patch to get client-hostname from dhcpd.leases,
Show quoted text
---- start ---
diff -rupN Net-DHCP-Info/lib/Net/DHCP/Info/Obj.pm
Net-DHCP-Info-0.01/lib/Net/DHCP/Info/Obj.pm
--- Net-DHCP-Info/lib/Net/DHCP/Info/Obj.pm 2007-10-08 17:16:23.000000000 -0300
+++ Net-DHCP-Info-0.01/lib/Net/DHCP/Info/Obj.pm 2009-02-23
18:53:04.000000000 -0300
@@ -23,6 +23,7 @@ BEGIN { ## no critic # for strict
remote_id __remote_id
circuit_id __circuit_id
binding __binding
+ hostname __hostname
range __range
/;
for my $subname (keys %sub2key) {
diff -rupN Net-DHCP-Info/lib/Net/DHCP/Info.pm
Net-DHCP-Info-0.01/lib/Net/DHCP/Info.pm
--- Net-DHCP-Info/lib/Net/DHCP/Info.pm 2007-10-08 17:16:23.000000000 -0300
+++ Net-DHCP-Info-0.01/lib/Net/DHCP/Info.pm 2009-02-23 19:16:55.000000000 -0300
@@ -17,6 +17,7 @@ our $ENDS = qr{^\s+ends\s\d+\s(.+
our $HW_ETHERNET = qr{^\s+hardware\sethernet\s(.+)};
our $REMOTE_ID = qr{option\sagent.remote-id\s(.+)};
our $CIRCUIT_ID = qr{option\sagent.circuit-id\s(.+)};
+our $HOSTNAME = qr{^\s+client-hostname\s\"(.+)\"};
our $BINDING = qr{^\s+binding\sstate\s(.+)};
our $END = qr{^\}$};
@@ -94,6 +95,9 @@ sub fetch_lease { #=====================
elsif(/$BINDING/mx) {
$lease->binding($1);
}
+ elsif(/$HOSTNAME/mx) {
+ $lease->hostname($1);
+ }
elsif(/$END/mx) {
last READ_LEASE;
}
----- end ----
TNX
--
Paulino Kenji Sato
http://www.nobel.com.br