line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Buffer.pm,v 1.12 2005/01/16 21:36:56 dbrobins Exp $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Net::SFTP::Buffer; |
4
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
67
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
10690
|
use Net::SSH::Perl::Buffer; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use base qw( Net::SSH::Perl::Buffer ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use Net::SSH::Perl::Util qw( :ssh2mp ); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
|
|
|
|
|
|
return shift->SUPER::new(@_, MP => 'SSH2'); |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub get_int64 { |
16
|
|
|
|
|
|
|
my $buf = shift; |
17
|
|
|
|
|
|
|
my $off = defined $_[0] ? shift : $buf->{offset}; |
18
|
|
|
|
|
|
|
$buf->{offset} += 8; |
19
|
|
|
|
|
|
|
bin2mp( $buf->bytes($off, 8) ); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub put_int64 { |
23
|
|
|
|
|
|
|
my $buf = shift; |
24
|
|
|
|
|
|
|
$buf->{buf} .= mp2bin($_[0], 8); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub get_attributes { |
28
|
|
|
|
|
|
|
my $buf = shift; |
29
|
|
|
|
|
|
|
Net::SFTP::Attributes->new(Buffer => $buf); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub put_attributes { |
33
|
|
|
|
|
|
|
my $buf = shift; |
34
|
|
|
|
|
|
|
$buf->{buf} .= $_[0]->as_buffer->bytes; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |