105 |
|
|
106 |
$dhcp->comment( $transaction++ ); |
$dhcp->comment( $transaction++ ); |
107 |
|
|
108 |
my $mac = substr($dhcp->chaddr(),0,$dhcp->hlen()*2); |
my $mac = format::mac( substr($dhcp->chaddr(),0,$dhcp->hlen()*2) ); |
109 |
my $ip = client_mac_ip($mac, $dhcp->ciaddr); |
my $ip = client_mac_ip($mac, $dhcp->ciaddr); |
110 |
|
|
111 |
my $hostname = $dhcp->getOptionValue(DHO_HOST_NAME); |
my $hostname = $dhcp->getOptionValue(DHO_HOST_NAME); |
112 |
print "$ip ", client::conf( $ip => 'hostname', default => $hostname ), " >> /etc/hosts\n"; |
print "$ip ", client::conf( $ip => 'hostname', default => $hostname ), " >> /etc/hosts\n" if $hostname; |
113 |
|
|
114 |
my $audit = { mac => format::mac($mac), ip => $ip, hostname => $hostname, |
my $audit = { mac => $mac, ip => $ip, hostname => $hostname, |
115 |
options => { |
options => { |
116 |
map { |
map { |
117 |
( $_ => $dhcp->getOptionValue( $_ ) ) |
( $_ => $dhcp->getOptionValue( $_ ) ) |