File Coverage

blib/lib/XDR/RPC/Call.pm
Criterion Covered Total %
statement 32 32 100.0
branch n/a
condition n/a
subroutine 12 12 100.0
pod 0 6 0.0
total 44 50 88.0


line stmt bran cond sub pod time code
1             # Call.pm - SunRPC call packets
2             # Copyright (C) 2000 Mountain View Data, Inc.
3             # Written by Gordon Matzigkeit , 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::Call;
23             # [guilt]
24             # [maint
25             # File: Call.pm
26             # Summary: SunRPC call packets
27             # Package: Perl XDR
28             # Owner: Mountain View Data, Inc.
29             # Years: 2000
30             # Author: Gordon Matzigkeit
31             # Contact:
32             # Date: 2000-12-18
33             # License: GPL]
34             # [clemency]
35              
36 2     2   14 use strict;
  2         4  
  2         108  
37              
38 2     2   13 use vars qw(@ISA);
  2         4  
  2         157  
39             @ISA = qw(XDR::RPC);
40              
41 2     2   10 use XDR::Decode;
  2         5  
  2         55  
42 2     2   11 use XDR::RPC;
  2         4  
  2         2720  
43              
44              
45             sub finish_decode
46             {
47 7     7 0 10 my ($type, $dec, $xid) = @_;
48              
49 7         25 my ($rpcvers, $prog, $vers, $proc, $cred, $verf) =
50             ($dec->unsigned,
51             $dec->unsigned,
52             $dec->unsigned,
53             $dec->unsigned,
54             $dec->opaque_auth,
55             $dec->opaque_auth);
56              
57 7         28 my ($args) = $dec->buffer (1);
58 7         41 return $type->new($xid, [$rpcvers, $prog, $vers, $proc], $args,
59             $cred, $verf);
60             }
61              
62              
63             sub rpcvers
64             {
65 5     5 0 9 my ($self) = @_;
66 5         19 return $self->private->[0];
67             }
68              
69              
70             sub prog
71             {
72 5     5 0 7 my ($self) = @_;
73 5         13 return $self->private->[1];
74             }
75              
76              
77             sub vers
78             {
79 5     5 0 8 my ($self) = @_;
80 5         546 return $self->private->[2];
81             }
82              
83              
84             sub proc
85             {
86 5     5 0 8 my ($self) = @_;
87 5         12 return $self->private->[3];
88             }
89              
90              
91             # Simple support for replying to an RPC.
92 2     2   22 use XDR::Encode qw(reply_packet);
  2         4  
  2         173  
93 2     2   12 use XDR qw(MSG_ACCEPTED SUCCESS);
  2         3  
  2         276  
94             sub reply
95             {
96 3     3 0 8 my ($self, $result) = @_;
97 3         9 return reply_packet ($self->xid, MSG_ACCEPTED, SUCCESS, $result);
98             }
99              
100              
101             1;