/[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 20 by dpavlin, Mon Apr 23 19:40:57 2007 UTC revision 23 by dpavlin, Mon Apr 23 21:26:08 2007 UTC
# Line 122  sub ant_another_passwd { Line 122  sub ant_another_passwd {
122          $ant_passwd->{$ant}++;          $ant_passwd->{$ant}++;
123    
124          if ( $ant_passwd->{$ant} > $#try_accounts ) {          if ( $ant_passwd->{$ant} > $#try_accounts ) {
125                  print "!! ant $ant password protected\n";                  print "$ant ant with unknown password\n";
126                  $ant_password_protected->{$ant}++;                  $ant_password_protected->{$ant}++;
127                  return 0;                  return 0;
128          }          }
# Line 132  sub ant_another_passwd { Line 132  sub ant_another_passwd {
132  my $once;  my $once;
133    
134  sub once {  sub once {
135          my $m = join(" ", @_);          my $m = join('', @_);
136          $once->{$m}++;          $once->{$m}++;
137          print $m if ($once->{$m} == 1);          print $m if ($once->{$m} == 1);
138  }  }
# Line 188  while (1) { Line 188  while (1) {
188                                  my $build = $h->{'_BUILD'} || die "no _BUILD?";                                  my $build = $h->{'_BUILD'} || die "no _BUILD?";
189                                  my $new_build = fw_build( $board );                                  my $new_build = fw_build( $board );
190                                  if ( $build ne $new_build ) {                                  if ( $build ne $new_build ) {
191                                          print "UPDATE STEP 1 on ant $ant version $build -> $new_build\n";                                          print "+ $ant version $build -> $new_build\n";
192                                          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");
193                                  } else {                                  } else {
194                                          once "OK ant $ant has $build\n";                                          once "$ant OK version $build",
195                                                    $ant_password_protected->{$ant} ? '' : ' with password',
196                                                    "\n";
197                                  }                                  }
198                          } else {                          } else {
199                                  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\n";
200                          }                          }
201                  } elsif ( $type eq 'REPLY-EXEC-CLI' && $h->{'SEQ-NR'} == 1 ) {                  } elsif ( $type eq 'REPLY-EXEC-CLI' && $h->{'SEQ-NR'} == 1 ) {
202                                  print "UPDATE STEP 2 on ant $ant\n";                                  print "+ $ant bootp mode re-flash started\n";
203                                  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");
204                                    $ant_password_protected->{$ant} = 0;
205                  } else {                  } else {
206                          print "!! reply ignored ", dump( $h ), $/;                          print "!! reply ignored ", dump( $h ), $/;
207                  }                  }

Legend:
Removed from v.20  
changed lines
  Added in v.23

  ViewVC Help
Powered by ViewVC 1.1.26