/[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 58 by dpavlin, Fri Nov 16 19:12:08 2007 UTC revision 67 by dpavlin, Sun Nov 18 01:29:04 2007 UTC
# Line 12  use MDAP; Line 12  use MDAP;
12  my $GROUP = '224.0.0.103';  my $GROUP = '224.0.0.103';
13  my $PORT  = '3235';  my $PORT  = '3235';
14    
15  my $debug = 0;  #my $debug = 0; # from MDAP
16  my $quiet = 1;  my $quiet = 1;
17  my $verbose = 0;  my $verbose = 0;
18  my $credentials = 0;  my $credentials = 0;
# Line 234  while (1) { Line 234  while (1) {
234                                          print "+ $ant version $build -> $new_build\n";                                          print "+ $ant version $build -> $new_build\n";
235                                          mdap_send("EXEC-CLI MDAP/$mdap_ver\r\nCLI-CMD:software upgrade\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:software upgrade\r\nSEQ-NR:1\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n");
236                                          $ant_flashing->{$ant}++;                                          $ant_flashing->{$ant}++;
237                                            next;
238                                  } else {                                  } else {
239                                          once "$ant OK version $build",                                          once "$ant OK version $build",
240                                                  $ant_unknown_password->{$ant} ? ' with unknown password' :                                                  $ant_unknown_password->{$ant} ? ' with unknown password' :
# Line 256  while (1) { Line 257  while (1) {
257                                                  status "$waiting of $count ants still flasing upto $build\n";                                                  status "$waiting of $count ants still flasing upto $build\n";
258                                          }                                          }
259                                  }                                  }
                         } else {  
                                 once "!! NO FIRMWARE for $board in $tftp_path for ant $ant, skipping update";  
                         }  
260    
261                          if ( $plugins ) {                                  if ( $plugins ) {
262                                  foreach my $plugin ( MDAP->plugins ) {                                          foreach my $plugin ( MDAP->plugins ) {
263                                          warn "## calling $plugin\n" if $debug;                                                  warn "## calling $plugin\n" if $debug;
264                                          if ( my $command = $plugin->check( $h ) ) {                                                  if ( my $command = $plugin->check( $h ) ) {
265    
266                                                  warn ">> $ant ",                                                          warn ">> $plugin $ant ",
267                                                          $h->{'ANT-NAME'}, " ",                                                                  $h->{'ANT-NAME'}, " ",
268                                                          $h->{'_BUILD'}, " ",                                                                  $h->{'_BUILD'}, " ",
269                                                          "\t:$command\n";                                                                  "\t:$command\n";
270                            
271                                                  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");
272                                                            last;
273                                                    }
274                                            }
275                                  }                                  }
276    
277                            } else {
278                                    once "!! NO FIRMWARE for $board in $tftp_path for ant $ant, skipping update";
279                          }                          }
280    
281                  } elsif ( $type eq 'REPLY-EXEC-CLI' ) {                  } elsif ( $type eq 'REPLY-EXEC-CLI' ) {
282                          print "##<< $type\n$data\n" if $debug;                          print "##<< $type\n$data\n" if $debug;
283                          if ( $seq_nr == 1 ) {                          if ( $seq_nr == 1 ) {
284  #                               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");
285                                  forget_ant( $ant ) if ( $ant_flashing->{$ant} );                                  forget_ant( $ant ) if ( $ant_flashing->{$ant} );
286                          } elsif ( $seq_nr < 0 ) {                          } elsif ( $seq_nr < 0 ) {
287                                  warn "EXEC-CLI failed: $data\n";                                  warn "EXEC-CLI failed: $data\n";

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

  ViewVC Help
Powered by ViewVC 1.1.26