added --protocol-dump flag to acs which include part of protocol that we implement
[perl-cwmp.git] / bin / acs.pl
1 #!/usr/bin/perl -w
2
3 # acs.pl
4 #
5 # 06/18/07 09:19:54 CEST Dobrica Pavlinusic <dpavlin@rot13.org>
6
7 use strict;
8
9 use lib './lib';
10 use CWMP::Server;
11 use Getopt::Long;
12
13 my $port = 3333;
14 my $debug = 0;
15 my $store_path = './';
16 my $store_plugin = 'YAML';
17 my $protocol_dump = 0;
18
19 GetOptions(
20         'debug+' => \$debug,
21         'port=i' => \$port,
22         'store-path=s' => \$store_path,
23         'store-plugin=s' => \$store_plugin,
24         'protocol-dump!' => \$protocol_dump,
25 );
26
27 my $queue;
28
29 if ( $protocol_dump ) {
30
31         warn "generating dump of xml protocol with CPE\n";
32
33         $queue = [
34                         'GetRPCMethods',
35                         'GetParameterNames',
36 #                       [ 'GetParameterNames', 'InternetGatewayDevice.DeviceInfo.SerialNumber', 0 ],
37 #                       [ 'GetParameterNames', 'InternetGatewayDevice.DeviceInfo.', 1 ],
38                         [ 'GetParameterValues',
39                                 'InternetGatewayDevice.DeviceInfo.SerialNumber',
40                                 'InternetGatewayDevice.DeviceInfo.VendorConfigFile.',
41                                 'InternetGatewayDevice.DeviceInfo.X_000E50_Country',
42                         ],
43                         [ 'SetParameterValues',
44                                 'InternetGatewayDevice.DeviceInfo.ProvisioningCode' => 'test provision',
45 #                       'InternetGatewayDevice.DeviceInfo.X_000E50_Country' => 1,
46                         ],
47 #                       'Reboot',
48         ];
49 };
50
51
52 my $server = CWMP::Server->new({
53         port => $port,
54         store => {
55                 module => $store_plugin,
56                 path => $store_path,
57                 debug => $debug,
58         },
59         debug => $debug,
60         default_queue => [ $queue ],
61 });
62 $server->run();
63