From: Dobrica Pavlinusic Date: Mon, 26 Nov 2007 00:28:54 +0000 (+0000) Subject: r287@brr: dpavlin | 2007-11-26 01:28:00 +0100 X-Git-Url: http://git.rot13.org/?p=perl-cwmp.git;a=commitdiff_plain;h=f755333ab3304fb6a1a375bb0b8b06c532184f29 r287@brr: dpavlin | 2007-11-26 01:28:00 +0100 implemented parsing into $state->{ParameterAttribute} git-svn-id: https://perl-cwmp.googlecode.com/svn/trunk@237 836a5e1a-633d-0410-964b-294494ad4392 --- diff --git a/lib/CWMP/Request.pm b/lib/CWMP/Request.pm index 4ca8d45..99770fa 100644 --- a/lib/CWMP/Request.pm +++ b/lib/CWMP/Request.pm @@ -108,9 +108,20 @@ push @$rules, =cut push @$rules, - 'GetParameterAttributesResponse' => sub { + 'ParameterAttributeStruct' => sub { my ($tag_name, $tag_hash, $context, $parent_data) = @_; warn dump( $tag_name, $tag_hash, $context ); + + confess "need state" unless ( $state ); # don't remove! + + my $name = _tag($tag_hash, 'Name', '_content'); + + + $state->{ParameterAttribute}->{$name} = { + Notification => _tag($tag_hash, 'Notification', '_content' ), + AccessList => _tag($tag_hash, 'AccessList', 'string' ), + }; + $state->{_trigger} = 'GetParameterAttributesResponse'; }; diff --git a/t/30-server.t b/t/30-server.t index 94a2245..2360584 100755 --- a/t/30-server.t +++ b/t/30-server.t @@ -4,7 +4,7 @@ use warnings; my $debug = shift @ARGV; -use Test::More tests => 144; +use Test::More tests => 153; use Data::Dump qw/dump/; use Cwd qw/abs_path/; use File::Find; diff --git a/t/dump/BANT-R/7.4.1.7/GetParameterAttributesResponse b/t/dump/BANT-R/7.4.1.7/GetParameterAttributesResponse new file mode 100644 index 0000000..0ad6d43 --- /dev/null +++ b/t/dump/BANT-R/7.4.1.7/GetParameterAttributesResponse @@ -0,0 +1,27 @@ +POST / HTTP/1.1 +Host: 10.0.0.100 +User-Agent: Thomson_cwmp-engine/r7.4.1.7 +Content-Length: 1184 +Content-Type: text/xml; charset=ISO-8859-1 +Cookie: $Version="0"; ID=11_THOM_TR69_ID;$Path=/ +SOAPAction: + + + +11_THOM_TR69_ID + + + InternetGatewayDevice.DeviceInfo.SerialNumber + 0 + subscriber + + + InternetGatewayDevice.DeviceInfo.SoftwareVersion + 0 + subscriber + + + + + + diff --git a/t/dump/BANT-R/7.4.1.7/GetParameterAttributesResponse.yml b/t/dump/BANT-R/7.4.1.7/GetParameterAttributesResponse.yml new file mode 100644 index 0000000..fe97b43 --- /dev/null +++ b/t/dump/BANT-R/7.4.1.7/GetParameterAttributesResponse.yml @@ -0,0 +1,12 @@ +--- +ID: 11_THOM_TR69_ID +ParameterAttribute: + InternetGatewayDevice.DeviceInfo.SerialNumber: + AccessList: + - subscriber + Notification: 0 + InternetGatewayDevice.DeviceInfo.SoftwareVersion: + AccessList: + - subscriber + Notification: 0 +_trigger: GetParameterAttributesResponse