From d491716e0bc3f8b8d87bc16f708f21f806718cdf Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Tue, 30 Oct 2007 15:26:41 +0000 Subject: [PATCH] added a pod documentation git-svn-id: https://perl-cwmp.googlecode.com/svn/trunk@185 836a5e1a-633d-0410-964b-294494ad4392 --- lib/CWMP/Request.pm | 71 +++++++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 29 deletions(-) diff --git a/lib/CWMP/Request.pm b/lib/CWMP/Request.pm index eb1b577..4ded128 100644 --- a/lib/CWMP/Request.pm +++ b/lib/CWMP/Request.pm @@ -10,7 +10,7 @@ use Carp qw/confess cluck/; =head1 NAME -CWMP::Request - parse SOAP request +CWMP::Request - parse SOAP request metods =head1 METHODS @@ -45,6 +45,26 @@ sub _tag { } } +=head2 parse + + my $state = CWMP::Request->parse( "request" ); + +=cut + +sub parse { + my $self = shift; + + my $xml = shift || confess "no xml?"; + + $state = {}; + $parser->parsestring( $xml ); + return $state; +} + +=head1 CPE metods + +=cut + our $state; # FIXME check this! my $tree = CWMP::Tree->new({ debug => 0 }); @@ -70,9 +90,13 @@ my $parser = XML::Rules->new( my ($tag_name, $tag_hash, $context, $parent_data) = @_; $state->{ID} = $tag_hash->{_content}; }, - # - # Inform - # + +=head2 Inform + +Generate InformResponse to CPE + +=cut + 'Inform' => sub { $state->{_dispatch} = 'InformResponse'; # what reponse to call }, @@ -99,17 +123,20 @@ my $parser = XML::Rules->new( my $value = (grep( /value/i, keys %$tag_hash ))[0]; $state->{Parameter}->{ _tag($tag_hash, 'Name', '_content') } = _tag($tag_hash, 'Value', '_content' ); }, - # - # GetRPCMethodsResponse - # + +=head2 GetRPCMethodsResponse + +=cut qr/^(?:^\w+:)*string$/ => 'content array', 'MethodList' => sub { my ($tag_name, $tag_hash, $context, $parent_data) = @_; $state->{MethodList} = _tag( $tag_hash, 'string' ); }, - # - # GetParameterNamesResponse - # + +=head2 GetParameterNamesResponse + +=cut + 'ParameterInfoStruct' => sub { my ($tag_name, $tag_hash, $context, $parent_data) = @_; my $name = _tag($tag_hash, 'Name', '_content'); @@ -124,9 +151,11 @@ my $parser = XML::Rules->new( #warn "## state = dump( $state ), "\n"; }, - # - # Fault - # + +=head2 Fault + +=cut + 'Fault' => sub { my ($tag_name, $tag_hash, $context, $parent_data) = @_; $state->{Fault} = { @@ -138,20 +167,4 @@ my $parser = XML::Rules->new( ] ); -=head2 parse - - my $state = CWMP::Request->parse( "request" ); - -=cut - -sub parse { - my $self = shift; - - my $xml = shift || confess "no xml?"; - - $state = {}; - $parser->parsestring( $xml ); - return $state; -} - 1; -- 2.20.1