File Coverage

blib/lib/Protocol/Sys/Virt/KeepAlive/XDR.pm
Criterion Covered Total %
statement 20 29 68.9
branch 0 8 0.0
condition n/a
subroutine 7 9 77.7
pod 0 2 0.0
total 27 48 56.2


line stmt bran cond sub pod time code
1             ####################################################################
2             #
3             # This file was generated using XDR::Parse version v1.0.1,
4             # XDR::Gen version 1.1.2 and LibVirt version v12.1.0
5             #
6             # Don't edit this file, use the source template instead
7             #
8             # ANY CHANGES HERE WILL BE LOST !
9             #
10             ####################################################################
11              
12             package Protocol::Sys::Virt::KeepAlive::XDR v12.1.0;
13              
14 1     1   10 use v5.14;
  1         3  
15 1     1   24 use warnings FATAL => 'uninitialized';
  1         2  
  1         49  
16 1     1   4 use Config;
  1         2  
  1         32  
17 1     1   4 use Carp qw(croak);
  1         1  
  1         37  
18 1     1   5 use constant PROGRAM => 1801807216; # 0x6b656570
  1         1  
  1         83  
19 1     1   5 use constant PROTOCOL_VERSION => 1; # 1
  1         2  
  1         45  
20             # Define elements from enum 'procedure'
21             use constant {
22 1         247 PROC_PING => 1,
23             PROC_PONG => 2,
24 1     1   5 };
  1         1  
25             # @_: ($class, $value, $index, $input) = @_;
26             sub deserialize_procedure {
27 0     0 0   my $input_length = length $_[3];
28             # my ($class, $value, $index, $input) = @_;
29 0 0         die "Input buffer too short"
30             if ($input_length - $_[2]) < 4;
31 0           $_[1] = unpack("l>", substr( $_[3], $_[2] ) );
32 0 0         die "Out of range enum value supplied: $_[1]"
33             unless vec(state $m = pack('H*', '06'),
34             $_[1], 1);
35 0           $_[2] += 4;
36             }
37             # @_: ($class, $value, $index, $output) = @_;
38             sub serialize_procedure {
39             # my ($class, $value, $index, $output) = @_;
40 0 0   0 0   croak "Missing required input 'enum' value"
41             unless defined $_[1];
42 0 0         die "Out of range enum value: $_[1]"
43             unless vec(state $m = pack('H*', '06'),
44             $_[1], 1);
45 0           substr( $_[3], $_[2] ) = pack("l>", $_[1]);
46 0           $_[2] += 4;
47             }
48              
49              
50             1;
51              
52             __END__