/[cwmp]/google/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

Annotation of /google/acs.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11 - (hide annotations)
Sat May 19 20:46:42 2007 UTC (17 years ago) by dpavlin
File MIME type: text/plain
File size: 1459 byte(s)
use local version of SOAP::Lite
1 dpavlin 2 #!/usr/bin/perl
2    
3     use warnings;
4     use strict;
5    
6 dpavlin 11 use lib 'lib';
7 dpavlin 2 use SOAP::Transport::HTTP +trace => 'debug';
8    
9     # Eh...
10     $SOAP::Constants::DO_NOT_CHECK_MUSTUNDERSTAND = 1;
11    
12     $SIG{PIPE} = $SIG{INT} = 'IGNORE'; # don't want to die on 'Broken pipe' or Ctrl-C
13    
14     # change LocalPort to 81 if you want to test it with soapmark.pl
15    
16     my $daemon = SOAP::Transport::HTTP::Daemon->new(
17     #LocalAddr => 'localhost',
18     LocalPort => 3333,
19     Reuse => 1,
20     #'Listen' => 128,
21     )
22     ->dispatch_with({ 'urn:dslforum-org:cwmp-1-0' => 'CWMP'})
23     ;
24    
25    
26     print "Contact to ACS server at ", $daemon->url, "\n";
27     $daemon->handle;
28    
29     package CWMP;
30     use strict;
31    
32     use Data::Dump qw/dump/;
33 dpavlin 7 use Carp qw/cluck/;
34 dpavlin 2
35     sub new {
36     bless {}, shift;
37     }
38    
39     # Server methods Calling Responding
40     # GetRPCMethods Optional Required
41     # Inform Required Required
42     # TransferComplete Required Required
43     # RequestDownload Optional Optional
44     # Kicked Optional Optional
45    
46     sub Inform {
47 dpavlin 7 my ($self, $DeviceId, $Event, $MaxEnvelopes, $CurrentTime, $RetryCount, $ParameterList, $headers) = @_;
48 dpavlin 2
49     my $p;
50    
51 dpavlin 7 #cluck dump( $daemon );
52     #warn dump( $headers );
53    
54     my $ID = ( grep { $_->name eq 'ID' } @$headers )[0]->value;
55    
56 dpavlin 2 foreach ( @$ParameterList ) {
57     $p->{ $_->{Name} } = $_->{Value};
58     }
59    
60 dpavlin 7 warn "request $ID from ", dump( $DeviceId ), " with events ",dump( $Event ), "maxEnvelopes: $MaxEnvelopes on $CurrentTime retry $RetryCount params ", dump( $p );
61 dpavlin 2
62 dpavlin 7 return SOAP::Data->name('MaxEnvelopes' => $MaxEnvelopes);
63 dpavlin 2 }

Properties

Name Value
svn:executable

  ViewVC Help
Powered by ViewVC 1.1.26