/[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 128 by dpavlin, Mon Aug 3 19:59:08 2009 UTC revision 129 by dpavlin, Mon Aug 3 20:53:46 2009 UTC
# Line 75  sub client_ip { Line 75  sub client_ip {
75    
76  use log;  use log;
77  use config;  use config;
78    use pxelinux;
79    
80  our $file;  our $file;
81  our $transaction = 0; # FIXME predictible transaction numbers  our $transaction = 0; # FIXME predictible transaction numbers
# Line 125  sub process_packet { Line 126  sub process_packet {
126                  Giaddr  => $dhcp->giaddr(),                  Giaddr  => $dhcp->giaddr(),
127                  Chaddr  => $dhcp->chaddr(),                  Chaddr  => $dhcp->chaddr(),
128                  File    => $file,                  File    => $file,
   
                 DHO_PXELINUX_MAGIC()       => 0xF100747E,  
                 DHO_PXELINUX_CONFIG_FILE() => 'pxelinux.cfg/default',  
                 DHO_PXELINUX_PATH_PREFIX() => 'live-helper/tftpboot/',  
                 DHO_PXELINUX_REBOOT_TIME() => 5, # default: 300 s  
129          };          };
130    
131            foreach my $opt ( 'magic', 'config_file', 'path_prefix', 'reboot_time' ) {
132                    my $DH0 = eval 'DHO_PXELINUX_' . uc $opt;
133                    warn "DH0: $@" if $@;
134                    my $v = eval "\$pxelinux::$opt";
135                    warn "v: $@" if $@;
136                    next unless defined $v;
137                    warn "pxelinux dhcp option $opt = $DH0 = $v";
138                    $packet->{ $DH0 } = $v;
139            }
140    
141          my $messagetype = $dhcp->getOptionValue(DHO_DHCP_MESSAGE_TYPE());          my $messagetype = $dhcp->getOptionValue(DHO_DHCP_MESSAGE_TYPE());
142    
143          if ($messagetype eq DHCPDISCOVER()) {          if ($messagetype eq DHCPDISCOVER()) {
# Line 162  sub process_packet { Line 168  sub process_packet {
168    
169          warn ">> $mac == $ip server: $server::ip", $file ? " file: $file\n" : "\n" if $debug;          warn ">> $mac == $ip server: $server::ip", $file ? " file: $file\n" : "\n" if $debug;
170    
171    warn "## created packet ", dump( $packet );
172    
173          $packet = new Net::DHCP::Packet( %$packet );          $packet = new Net::DHCP::Packet( %$packet );
174          warn "send ",$packet->toString() if $debug;          warn "send ",$packet->toString() if $debug;
175    

Legend:
Removed from v.128  
changed lines
  Added in v.129

  ViewVC Help
Powered by ViewVC 1.1.26