/[mdap]/mdap-server.pl
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 /mdap-server.pl

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

revision 49 by dpavlin, Fri Nov 16 16:21:45 2007 UTC revision 58 by dpavlin, Fri Nov 16 19:12:08 2007 UTC
# Line 162  sub forget_ant { Line 162  sub forget_ant {
162          delete $ant_ok_password->{$ant};          delete $ant_ok_password->{$ant};
163  }  }
164    
 my $once;  
   
 sub once {  
         my $m = join('', @_);  
         $once->{$m}++;  
         print $m if ($once->{$m} == 1);  
 }  
   
165  my $status = '';  my $status = '';
166    
167  sub status {  sub status {
# Line 246  while (1) { Line 238  while (1) {
238                                          once "$ant OK version $build",                                          once "$ant OK version $build",
239                                                  $ant_unknown_password->{$ant} ? ' with unknown password' :                                                  $ant_unknown_password->{$ant} ? ' with unknown password' :
240                                                  $ant_passwd->{$ant} ? ' password protected' :                                                  $ant_passwd->{$ant} ? ' password protected' :
241                                                  '',                                                  '';
                                                 "\n";  
242    
243                                          $ant_flashing->{$ant} = 0;                                          $ant_flashing->{$ant} = 0;
244                                          # green|red|orange|flash|off                                          # green|red|orange|flash|off
# Line 266  while (1) { Line 257  while (1) {
257                                          }                                          }
258                                  }                                  }
259                          } else {                          } else {
260                                  once "!! NO FIRMWARE for $board in $tftp_path for ant $ant, skipping update\n";                                  once "!! NO FIRMWARE for $board in $tftp_path for ant $ant, skipping update";
261                          }                          }
262    
263                          if ( $plugins ) {                          if ( $plugins ) {
264                                  foreach my $plugin ( MDAP->plugins ) {                                  foreach my $plugin ( MDAP->plugins ) {
265                                          warn "## calling $plugin\n" if $debug;                                          warn "## calling $plugin\n" if $debug;
266                                          if ( my $command = $plugin->check( $h ) ) {                                          if ( my $command = $plugin->check( $h ) ) {
267                                                  warn "## plugin $plugin sending $command to $ant\n";  
268                                                    warn ">> $ant ",
269                                                            $h->{'ANT-NAME'}, " ",
270                                                            $h->{'_BUILD'}, " ",
271                                                            "\t:$command\n";
272            
273                                                  mdap_send("EXEC-CLI MDAP/$mdap_ver\r\nCLI-CMD:$command\r\nSEQ-NR:1\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n");              }                                                  mdap_send("EXEC-CLI MDAP/$mdap_ver\r\nCLI-CMD:$command\r\nSEQ-NR:1\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n");              }
274                                  }                                  }
275                          }                          }
276    
277                  } elsif ( $type eq 'REPLY-EXEC-CLI' ) {                  } elsif ( $type eq 'REPLY-EXEC-CLI' ) {
278                          print "+ $type\n$data\n" if ($verbose);                          print "##<< $type\n$data\n" if $debug;
279                          if ( $seq_nr == 1 ) {                          if ( $seq_nr == 1 ) {
280                                  mdap_send("EXEC-CLI MDAP/$mdap_ver\r\nSEQ-NR:2\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n");  #                               mdap_send("EXEC-CLI MDAP/$mdap_ver\r\nSEQ-NR:2\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n");
281                                  forget_ant( $ant ) if ( $ant_flashing->{$ant} );                                  forget_ant( $ant ) if ( $ant_flashing->{$ant} );
282                          } elsif ( $seq_nr < 0 ) {                          } elsif ( $seq_nr < 0 ) {
283                                  warn "EXEC-CLI failed\n";                                  warn "EXEC-CLI failed: $data\n";
284                          }                          }
285    
286                  } else {                  } else {

Legend:
Removed from v.49  
changed lines
  Added in v.58

  ViewVC Help
Powered by ViewVC 1.1.26