/[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 26 by dpavlin, Mon Apr 23 23:36:57 2007 UTC revision 27 by dpavlin, Tue Apr 24 09:52:05 2007 UTC
# Line 140  sub ant_another_passwd { Line 140  sub ant_another_passwd {
140          return 1;          return 1;
141  }  }
142    
143    sub forget_ant {
144            my $ant = shift || die "no ant?";
145            delete $ant_unknown_password->{$ant};
146            delete $ant_passwd->{$ant};
147            delete $ant_ok_password->{$ant};
148    }
149    
150  my $once;  my $once;
151    
152  sub once {  sub once {
# Line 189  while (1) { Line 196  while (1) {
196                  } elsif ($type eq 'REPLY-INFO') {                  } elsif ($type eq 'REPLY-INFO') {
197    
198                          if ( $seq_nr < 0 ) {                          if ( $seq_nr < 0 ) {
199                                  if ( $ant_ok_password ) {  #                               if ( $ant_ok_password ) {
200                                          $ant_ok_password->{$ant} = 0;  #                                       $ant_ok_password->{$ant} = 0;
201                                  } elsif ( ant_another_passwd( $ant ) ) {  #                               } elsif ( ant_another_passwd( $ant ) ) {
202                                    if ( ant_another_passwd( $ant ) ) {
203                                          ($user_id,$user_pwd) = ant_credentials( $ant );                                          ($user_id,$user_pwd) = ant_credentials( $ant );
204                                          mdap_send("INFO MDAP/$mdap_ver\r\nSEQ-NR:1\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n");                                          mdap_send("INFO MDAP/$mdap_ver\r\nSEQ-NR:1\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n");
205                                  }                                  }
# Line 220  while (1) { Line 228  while (1) {
228                  } elsif ( $type eq 'REPLY-EXEC-CLI' && $h->{'SEQ-NR'} == 1 ) {                  } elsif ( $type eq 'REPLY-EXEC-CLI' && $h->{'SEQ-NR'} == 1 ) {
229                                  print "+ $ant bootp mode re-flash started\n";                                  print "+ $ant bootp mode re-flash started\n";
230                                  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");
231                                  $ant_unknown_password->{$ant} = 0;                                  forget_ant( $ant );
                                 $ant_passwd->{$ant} = 0;  
                                 $ant_ok_password->{$ant} = 0;  
232                  } else {                  } else {
233                          print "!! reply ignored ", dump( $h ), $/;                          print "!! reply ignored ", dump( $h ), $/;
234                  }                  }

Legend:
Removed from v.26  
changed lines
  Added in v.27

  ViewVC Help
Powered by ViewVC 1.1.26