X-Git-Url: http://git.rot13.org/?p=perl-cwmp.git;a=blobdiff_plain;f=bin%2Fcpe-queue.pl;h=a4b6f73175ffd7d72b20eb0b80cd6aa7b3342175;hp=6b6a008e22b331fea083af3701b006dbe004b4a4;hb=c3e3a10c037b3b0fb7d531d226464e19c9d9e18f;hpb=35e5be71b934e7bd7898d3e86ea42e1592c7cfb8 diff --git a/bin/cpe-queue.pl b/bin/cpe-queue.pl index 6b6a008..a4b6f73 100755 --- a/bin/cpe-queue.pl +++ b/bin/cpe-queue.pl @@ -14,14 +14,16 @@ use File::Slurp; my $debug = 1; my $protocol_dump = 0; my $list = 0; +my $introspect = 0; GetOptions( 'debug+' => \$debug, 'protocol-dump!' => \$protocol_dump, 'list!' => \$list, + 'introspect!' => \$introspect, ); -die "usage: $0 CPE_id [--protocol-dump]\n" unless @ARGV; +die "usage: $0 [...queue/]CPE_id [ --list | --introspect | --protocol-dump ]\n" unless @ARGV; foreach my $id ( @ARGV ) { @@ -110,37 +112,79 @@ foreach my $id ( @ARGV ) { print "Active jobs [", scalar @active, "]\n",join("\n\n", @active) if @active; print "Queued jobs [", scalar @queued, "]\n",join("\n\n", @queued) if @queued; - } else { + } elsif ( $introspect ) { - warn "injecting some tests commands\n"; + $q->enqueue( 'GetRPCMethods' ); # XXX not supported by ZTE - $q->enqueue( 'GetRPCMethods' ); + $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.', 1 ] ); - # $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.LANDevice.', 1 ] ); +# $q->enqueue( 'GetRPCMethods' ); # XXX not supported by ZTE + + $q->enqueue( 'GetParameterValues', [ + 'InternetGatewayDevice.', + ]); - # $q->enqueue( 'GetParameterValues', [ - # 'InternetGatewayDevice.', - # ]); - # $q->enqueue( 'GetParameterNames', [ '.ExternalIPAddress', 1 ] ); +# $q->enqueue( 'GetParameterNames', [ '.ExternalIPAddress', 1 ] ); - # $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.', 1 ] ); - # $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.DeviceInfo.', 1 ] ); - # $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.DeviceConfig.', 1 ] ); - # $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.ManagementServer.', 1 ] ); - # $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.Services.', 1 ] ); - # $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.LANDevice.', 1 ] ); + $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.', 1 ] ); +# $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.DeviceInfo.', 1 ] ); +# $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.DeviceConfig.', 1 ] ); +# $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.ManagementServer.', 1 ] ); +# $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.Services.', 1 ] ); +# $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.LANDevice.', 1 ] ); $q->enqueue( 'GetParameterNames', [ 'InternetGatewayDevice.', 0 ] ); $q->enqueue( 'GetParameterValues', [ - 'InternetGatewayDevice.', + #'InternetGatewayDevice.', # too big for ZTE + 'InternetGatewayDevice.DeviceConfig.', + 'InternetGatewayDevice.DeviceInfo.', + 'InternetGatewayDevice.DeviceSummary', + 'InternetGatewayDevice.ManagementServer.', ]); + $q->enqueue( 'GetParameterValues' => [ $_ ] ) foreach ( qw/ +InternetGatewayDevice.IPPingDiagnostics. +InternetGatewayDevice.LANConfigSecurity. +InternetGatewayDevice.LANDevice. +InternetGatewayDevice.Layer2Bridging. +InternetGatewayDevice.Layer3Forwarding. +InternetGatewayDevice.ManagementServer. +InternetGatewayDevice.QueueManagement. +InternetGatewayDevice.Time. +InternetGatewayDevice.UserInterface. +InternetGatewayDevice.WANDevice. + / ); + $q->enqueue( 'GetParameterAttributes', [ 'InternetGatewayDevice.DeviceInfo.SerialNumber', + 'InternetGatewayDevice.DeviceInfo.SoftwareVersion', ]); # $q->enqueue( 'SetParameterAttributes', [ ' + + } else { + + warn "injecting some tests commands\n"; + + # turn on periodic reporting to ACS server + +# $q->enqueue( 'GetParameterValues', [ 'InternetGatewayDevice.ManagementServer.' ] ); + $q->enqueue( 'SetParameterValues', { + 'InternetGatewayDevice.DeviceInfo.ProvisioningCode' => 'perl-cwmp provision', + } ); + $q->enqueue( 'SetParameterValues', { + 'InternetGatewayDevice.ManagementServer.PeriodicInformInterval' => 15, # s + } ); + $q->enqueue( 'SetParameterValues', { + 'InternetGatewayDevice.ManagementServer.PeriodicInformEnable' => 1, + } ); + + $q->enqueue( 'GetParameterValues', [ + 'InternetGatewayDevice.ManagementServer.', + 'InternetGatewayDevice.DeviceInfo.ProvisioningCode', + ] ); + } }