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 { |
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 |
} |
} |
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 |
} |
} |