/[pxelator]/lib/PXElator/dhcpd.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/PXElator/dhcpd.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 244 by dpavlin, Mon Aug 17 13:27:18 2009 UTC revision 260 by dpavlin, Wed Aug 19 10:56:04 2009 UTC
# Line 95  sub process_packet { Line 95  sub process_packet {
95          return unless $buf;          return unless $buf;
96    
97          my $dhcp = Net::DHCP::Packet->new($buf);          my $dhcp = Net::DHCP::Packet->new($buf);
         $dhcp->comment( $transaction++ );  
98    
99          warn "recv: ", $dhcp->toString if $debug;          warn "recv: ", $dhcp->toString if $debug;
100    
101            $dhcp->comment( $transaction++ );
102    
103          my $mac = substr($dhcp->chaddr(),0,$dhcp->hlen()*2);          my $mac = substr($dhcp->chaddr(),0,$dhcp->hlen()*2);
104          my $ip = client_mac_ip($mac, $dhcp->ciaddr);          my $ip = client_mac_ip($mac, $dhcp->ciaddr);
105    
106          my $hostname = $dhcp->getOptionValue(DHO_HOST_NAME);          my $hostname = $dhcp->getOptionValue(DHO_HOST_NAME);
107          print "$ip ", client::conf( $ip => 'hostname', default => $hostname ), " >> /etc/hosts\n";          print "$ip ", client::conf( $ip => 'hostname', default => $hostname ), " >> /etc/hosts\n";
108    
109          my $audit = { mac => format::mac($mac), ip => $ip, hostname => $hostname };          my $audit = { mac => format::mac($mac), ip => $ip, hostname => $hostname,
110                    options => {
111                            map {
112                                    ( $_ => $dhcp->getOptionValue( $_ ) )
113                            } @{ $dhcp->{options_order} }
114                    },
115            };
116    
117  =for later  =for later
118    

Legend:
Removed from v.244  
changed lines
  Added in v.260

  ViewVC Help
Powered by ViewVC 1.1.26