~ubuntu-branches/ubuntu/trusty/libnet-openssh-perl/trusty

« back to all changes in this revision

Viewing changes to lib/Net/OpenSSH/Constants.pm

  • Committer: Package Import Robot
  • Author(s): Florian Schlichting
  • Date: 2012-02-22 23:35:55 UTC
  • Revision ID: package-import@ubuntu.com-20120222233555-j839vhem3058ewpx
Tags: upstream-0.57
ImportĀ upstreamĀ versionĀ 0.57

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package Net::OpenSSH::Constants;
 
2
 
 
3
our $VERSION = '0.51_07';
 
4
 
 
5
use strict;
 
6
use warnings;
 
7
use Carp;
 
8
 
 
9
require Exporter;
 
10
our @ISA = qw(Exporter);
 
11
our %EXPORT_TAGS = (error => []);
 
12
 
 
13
my %error = ( OSSH_MASTER_FAILED => 1,
 
14
              OSSH_SLAVE_FAILED => 2,
 
15
              OSSH_SLAVE_PIPE_FAILED => 3,
 
16
              OSSH_SLAVE_TIMEOUT => 4,
 
17
              OSSH_SLAVE_CMD_FAILED => 5,
 
18
              OSSH_SLAVE_SFTP_FAILED => 6,
 
19
              OSSH_ENCODING_ERROR => 7
 
20
            );
 
21
 
 
22
for my $key (keys %error) {
 
23
    no strict 'refs';
 
24
    my $value = $error{$key};
 
25
    *{$key} = sub () { $value };
 
26
    push @{$EXPORT_TAGS{error}}, $key
 
27
}
 
28
 
 
29
our @EXPORT_OK = map { @{$EXPORT_TAGS{$_}} } keys %EXPORT_TAGS;
 
30
$EXPORT_TAGS{all} = [@EXPORT_OK];
 
31
 
 
32
1;
 
33
 
 
34
__END__
 
35
 
 
36
=head1 NAME
 
37
 
 
38
Net::OpenSSH::Constants - Constant definitions for Net::OpenSSH
 
39
 
 
40
=head1 SYNOPSIS
 
41
 
 
42
  use Net::OpenSSH::Constants qw(:error);
 
43
 
 
44
=head1 DESCRIPTION
 
45
 
 
46
This module exports the following constants:
 
47
 
 
48
=over 4
 
49
 
 
50
=item :error
 
51
 
 
52
  OSSH_MASTER_FAILED - some error related to the master SSH connection happened
 
53
  OSSH_SLAVE_FAILED - some error related to a slave SSH connection happened
 
54
  OSSH_SLAVE_PIPE_FAILED - unable to create pipe to communicate with slave process
 
55
  OSSH_SLAVE_TIMEOUT - slave process timeout
 
56
  OSSH_SLAVE_CMD_FAILED - child process exited with a non zero status
 
57
  OSSH_SLAVE_SFTP_FAILED - creation of SFTP client failed
 
58
  OSS_ENCODING_ERROR - some error related to the encoding/decoding of strings happened
 
59
 
 
60
=back
 
61
 
 
62
=head1 COPYRIGHT AND LICENSE
 
63
 
 
64
Copyright (C) 2008, 2009 by Salvador FandiE<ntilde>o (sfandino@yahoo.com)
 
65
 
 
66
This library is free software; you can redistribute it and/or modify
 
67
it under the same terms as Perl itself, either Perl version 5.10.0 or,
 
68
at your option, any later version of Perl 5 you may have available.
 
69
 
 
70
=cut