return unless $buf;
my $dhcp = Net::DHCP::Packet->new($buf);
- $dhcp->comment( $transaction++ );
warn "recv: ", $dhcp->toString if $debug;
+ $dhcp->comment( $transaction++ );
+
my $mac = substr($dhcp->chaddr(),0,$dhcp->hlen()*2);
my $ip = client_mac_ip($mac, $dhcp->ciaddr);
my $hostname = $dhcp->getOptionValue(DHO_HOST_NAME);
print "$ip ", client::conf( $ip => 'hostname', default => $hostname ), " >> /etc/hosts\n";
- my $audit = { mac => format::mac($mac), ip => $ip, hostname => $hostname };
+ my $audit = { mac => format::mac($mac), ip => $ip, hostname => $hostname,
+ options => {
+ map {
+ ( $_ => $dhcp->getOptionValue( $_ ) )
+ } @{ $dhcp->{options_order} }
+ },
+ };
=for later