/[cwmp]/google/trunk/bin/acs.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 /google/trunk/bin/acs.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 178 by dpavlin, Sun Oct 28 19:47:30 2007 UTC revision 221 by dpavlin, Fri Nov 23 21:14:54 2007 UTC
# Line 8  use strict; Line 8  use strict;
8    
9  use lib './lib';  use lib './lib';
10  use CWMP::Server;  use CWMP::Server;
11    use CWMP::Session;
12    use CWMP::Vendor;
13  use Getopt::Long;  use Getopt::Long;
14    use Data::Dump qw/dump/;
15    use File::Find;
16    
17    use Devel::LeakTrace::Fast;
18    
19  my $port = 3333;  my $port = 3333;
20  my $debug = 0;  my $debug = 0;
21  my $store_path = './';  my $store_path = './';
22  my $store_plugin = 'YAML';  my $store_plugin = 'YAML';
23    my $create_dump = 1;
24    
25  GetOptions(  GetOptions(
26          'debug+' => \$debug,          'debug+' => \$debug,
27          'port=i' => \$port,          'port=i' => \$port,
28          'store-path=s' => \$store_path,          'store-path=s' => \$store_path,
29          'store-plugin=s' => \$store_plugin,          'store-plugin=s' => \$store_plugin,
30            'create_dump!' => \$create_dump,
31  );  );
32    
33    if ( $create_dump ) {
34            warn "## cleaning dump directory\n" if $debug;
35            find({
36                    wanted => sub {
37                            my $path = $File::Find::name;
38                            return if -d $path;
39                            unlink($path) || die "can't remove $path: $!";
40                            warn "## removed $path\n" if $debug;
41                    },
42                    no_chdir => 1,
43            }, 'dump/' );
44    }
45    
46  my $server = CWMP::Server->new({  my $server = CWMP::Server->new({
47          port => $port,          port => $port,
48          store => {          session => {
49                  module => $store_plugin,                  store => {
50                  path => $store_path,                          module => $store_plugin,
51                  debug => $debug,                          path => $store_path,
52                            debug => $debug,
53                    },
54                    create_dump => $create_dump,
55          },          },
56          debug => $debug,          debug => $debug,
         default_queue => [  
                 'GetRPCMethods',  
                 'GetParameterNames',  
 #               [ 'GetParameterNames', 'InternetGatewayDevice.DeviceInfo.SerialNumber', 0 ],  
 #               [ 'GetParameterNames', 'InternetGatewayDevice.DeviceInfo.', 1 ],  
                 [ 'GetParameterValues',  
                         'InternetGatewayDevice.DeviceInfo.SerialNumber',  
                         'InternetGatewayDevice.DeviceInfo.VendorConfigFile.',  
                         'InternetGatewayDevice.DeviceInfo.X_000E50_Country',  
                 ],  
                 [ 'SetParameterValues',  
                         'InternetGatewayDevice.DeviceInfo.ProvisioningCode' => 'test provision',  
 #                       'InternetGatewayDevice.DeviceInfo.X_000E50_Country' => 1,  
                 ],  
 #               'Reboot',  
         ],  
57  });  });
58    
59    CWMP::Vendor->add_triggers;
60    
61  $server->run();  $server->run();
62    

Legend:
Removed from v.178  
changed lines
  Added in v.221

  ViewVC Help
Powered by ViewVC 1.1.26