/[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

Contents of /google/acs.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:executable

  ViewVC Help
Powered by ViewVC 1.1.26