XDR/RPC/Reply.pm

filter: Statementstmt 86.4% 32 / 37 Branchbran 16.6% 2 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 4 totaltotal 69.3% 43 / 62 CC 7 SCAR 21.0
CC
7
Cov
69%
finish_decode
16.4
BEGIN
1.0
BEGIN
1.0
CRAP 8.2
« XDR/CallReply.pm ↑ Summary XDR/RPC.pm »
1 # Reply.pm - SunRPC reply packets
2 # Copyright (C) 2000 Mountain View Data, Inc.
3 # Written by Gordon Matzigkeit <gord@fig.org>, 2000-12-18
4 #
5 # This file is part of Perl XDR.
6 #
7 # Perl XDR is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # Perl XDR is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 # USA
21  
22 package XDR::RPC::Reply;
23 # [guilt]
24 # [maint
25 # File: Reply.pm
26 # Summary: SunRPC reply packets
27 # Package: Perl XDR
28 # Owner: Mountain View Data, Inc.
29 # Years: 2000
30 # Author: Gordon Matzigkeit
31 # Contact: <gord@fig.org>
32 # Date: 2000-12-18
33 # License: GPL]
34 # [clemency]
35  
36 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
37  
38 2 ▶use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
39 2 @ISA = qw(XDR::RPC);
40  
41 2 ▶use XDR::Decode;
Subroutine BEGIN: called CC=1 SCAR=0.0
42 2 ▶use XDR::RPC;
Subroutine BEGIN: called CC=1 SCAR=0.0
43 2 ▶use XDR qw(:reply_stat :accept_stat :reject_stat);
Subroutine BEGIN: called CC=1 SCAR=0.0
44  
45  
46 sub finish_decode
47 3 ▶{
Subroutine finish_decode: called CC=7 SCAR=28.0
Pod undocumented
48 3 my ($type, $dec, $xid) = @_;
49  
50 3 my (@priv, $verf, $result, $reason);
51 3 my ($status) = $dec->unsigned;
52 3 ▶ if ($status == MSG_ACCEPTED)
Branch: 2 branches
BranchTrueFalseTotal
if ($status == 0) { } 3 0 3
elsif ($status == 1) { } 0 0 0
53 {
54 3 $verf = $dec->opaque_auth;
55 3 $reason = $dec->unsigned;
56 3 ▶ if ($reason == SUCCESS)
Branch: 2 branches
BranchTrueFalseTotal
if ($reason == 0) { } 3 0 3
elsif ($reason == 2) { } 0 0 0
57 {
58 3 $result = $dec->buffer (1);
59 }
60 elsif ($reason == PROG_MISMATCH)
61 {
62 # low, high
63 0 push @priv, ($dec->unsigned, $dec->unsigned);
64 }
65 }
66 elsif ($status == MSG_DENIED)
67 {
68 0 $reason = $dec->unsigned;
69 0 ▶ if ($reason == RPC_MISMATCH)
Branch: 2 branches
BranchTrueFalseTotal
if ($reason == 0) { } 0 0 0
elsif ($reason == 1) { } 0 0 0
70 {
71 # low, high
72 0 push @priv, ($dec->unsigned, $dec->unsigned);
73 }
74 elsif ($reason == AUTH_ERROR)
75 {
76 # auth_stat
77 0 push @priv, $dec->unsigned;
78 }
79 }
80  
81 3 return $type->new($xid, [$status, $reason, @priv], $result,
82 undef, $verf);
83 }
84  
85  
86 sub status
87 1 ▶{
Subroutine status: called CC=1 SCAR=0.0
Pod undocumented
88 1 my ($self) = @_;
89 1 return $self->private->[0];
90 }
91  
92  
93 sub reason
94 1 ▶{
Subroutine reason: called CC=1 SCAR=0.0
Pod undocumented
95 1 my ($self) = @_;
96 1 return $self->private->[1];
97 }
98  
99  
100 sub result
101 1 ▶{
Subroutine result: called CC=1 SCAR=0.0
Pod undocumented
102 1 my ($self) = @_;
103 1 return $self->args ();
104 }
105  
106  
107 2 1;
« XDR/CallReply.pm ↑ Summary XDR/RPC.pm »