--- mdap-server.pl 2007/11/16 15:54:20 48 +++ mdap-server.pl 2007/11/16 16:21:45 49 @@ -7,7 +7,7 @@ use Getopt::Long; use lib './lib'; -use MDAP::ChangeIP; +use MDAP; my $GROUP = '224.0.0.103'; my $PORT = '3235'; @@ -17,6 +17,8 @@ my $verbose = 0; my $credentials = 0; +my $plugins = 1; + my $resend_search_delay = 3; my $tftp_path = '/srv/tftp/'; @@ -32,6 +34,7 @@ "tftp=s" => \$tftp_path, "credentials" => \$credentials, "exec=s" => \$flashed_cmd, + 'plugins!' => \$plugins, ); $quiet = 0 if $verbose; @@ -266,9 +269,13 @@ once "!! NO FIRMWARE for $board in $tftp_path for ant $ant, skipping update\n"; } - if ( my $command = CWMP::ChangeIP::check( $h ) ) { - warn "## sending $command to $ant\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"); + if ( $plugins ) { + foreach my $plugin ( MDAP->plugins ) { + warn "## calling $plugin\n" if $debug; + if ( my $command = $plugin->check( $h ) ) { + warn "## plugin $plugin sending $command to $ant\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"); } + } } } elsif ( $type eq 'REPLY-EXEC-CLI' ) {