28 |
); |
); |
29 |
|
|
30 |
$quiet = 0 if $verbose; |
$quiet = 0 if $verbose; |
31 |
|
$credentials = 1 if $debug; |
32 |
|
|
33 |
# tab-delimited list of user id/passwd to try on ants |
# tab-delimited list of user id/passwd to try on ants |
34 |
my @try_accounts = ( "Administrator\t" ); |
my @try_accounts = ( "Administrator\t" ); |
99 |
|
|
100 |
$sock->mcast_send( $data, "${GROUP}:${PORT}" ); |
$sock->mcast_send( $data, "${GROUP}:${PORT}" ); |
101 |
if ($debug) { |
if ($debug) { |
102 |
warn ">> ", dump( $data ), $/; |
warn ">> ${GROUP}:${PORT} >> ", dump( $data ), $/; |
103 |
} elsif( ! $quiet ) { |
} elsif( ! $quiet ) { |
104 |
$data =~ s/\s+/ /gi; |
$data =~ s/\s+/ /gi; |
105 |
warn ">> ", substr($data,0,70), $/; |
warn ">> ", substr($data,0,70), $/; |
193 |
|
|
194 |
print "<< $type $proto/$mdap_ver << ", length($data), " bytes\n" unless $quiet; |
print "<< $type $proto/$mdap_ver << ", length($data), " bytes\n" unless $quiet; |
195 |
|
|
196 |
warn dump($h),$/ if ($debug); |
warn dump( $data, $h ),$/ if ($debug); |
197 |
|
|
198 |
# we are getting our own messages (since our source port |
# we are getting our own messages (since our source port |
199 |
# is same as destination) |
# is same as destination) |
220 |
next; |
next; |
221 |
} else { |
} else { |
222 |
$ant_ok_password->{$ant}++; |
$ant_ok_password->{$ant}++; |
223 |
print "$ant credentials $user_id $user_pwd\n" if ($credentials && $ant_ok_password->{$ant} == 1); |
print "$ant credentials $user_id $user_pwd\n" if ( $credentials && $ant_ok_password->{$ant} == 1 ) || $debug; |
224 |
} |
} |
225 |
|
|
226 |
my $board = $h->{'_BOARD_NAME'} || die "no _BOARD_NAME?"; |
my $board = $h->{'_BOARD_NAME'} || die "no _BOARD_NAME?"; |
236 |
$ant_ok_password->{$ant} ? ' password protected' : |
$ant_ok_password->{$ant} ? ' password protected' : |
237 |
'', |
'', |
238 |
"\n"; |
"\n"; |
239 |
|
|
240 |
$ant_flashing->{$ant} = 0; |
$ant_flashing->{$ant} = 0; |
241 |
|
# green|red|orange|flash|off |
242 |
|
mdap_send("EXEC-CLI MDAP/$mdap_ver\r\nCLI-CMD:system config led=flash\r\nSEQ-NR:1\r\nTO-ANT:$ant\r\nUSER-ID:$user_id\r\nUSER-PWD:$user_pwd\r\n"); |
243 |
my $waiting = 0; |
my $waiting = 0; |
244 |
my $count = 0; |
my $count = 0; |
245 |
map { |
map { |
256 |
} else { |
} else { |
257 |
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"; |
258 |
} |
} |
259 |
} elsif ( $type eq 'REPLY-EXEC-CLI' && $h->{'SEQ-NR'} == 1 ) { |
} elsif ( $type eq 'REPLY-EXEC-CLI' ) { |
260 |
|
if ( $seq_nr == 1 ) { |
261 |
print "+ $ant bootp mode re-flash started\n" if ($verbose); |
print "+ $ant bootp mode re-flash started\n" if ($verbose); |
262 |
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"); |
263 |
forget_ant( $ant ); |
forget_ant( $ant ); |
264 |
$ant_flashing->{$ant}++; |
$ant_flashing->{$ant}++; |
265 |
|
} elsif ( $seq_nr == 2 ) { |
266 |
|
print "+ $ant led\n" if ($verbose); |
267 |
|
} |
268 |
} else { |
} else { |
269 |
print "!! reply ignored ", dump( $h ), $/; |
print "!! reply $type ignored ", dump( $h ), $/; |
270 |
} |
} |
271 |
|
|
272 |
} else { |
} else { |