line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Net::OBEX::Packet::Headers::ByteSeq; |
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
1221
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
103
|
|
5
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
113
|
|
6
|
3
|
|
|
3
|
|
13
|
use Carp; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
186
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
13
|
use base 'Net::OBEX::Packet::Headers::Base'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
1211
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '1.001001'; # VERSION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my %Header_HI_For = ( |
13
|
|
|
|
|
|
|
type => "\x42", |
14
|
|
|
|
|
|
|
time => "\x44", |
15
|
|
|
|
|
|
|
target => "\x46", |
16
|
|
|
|
|
|
|
http => "\x47", |
17
|
|
|
|
|
|
|
body => "\x48", |
18
|
|
|
|
|
|
|
end_of_body => "\x49", |
19
|
|
|
|
|
|
|
who => "\x4A", |
20
|
|
|
|
|
|
|
app_params => "\x4C", |
21
|
|
|
|
|
|
|
auth_challenge => "\x4D", |
22
|
|
|
|
|
|
|
auth_response => "\x4E", |
23
|
|
|
|
|
|
|
object_class => "\x4F", |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub new { |
28
|
11
|
|
|
11
|
1
|
16
|
my ( $class, $name, $value ) = @_; |
29
|
|
|
|
|
|
|
|
30
|
11
|
50
|
|
|
|
19
|
croak "Missing header name or HI identifier" |
31
|
|
|
|
|
|
|
unless defined $name; |
32
|
|
|
|
|
|
|
|
33
|
11
|
50
|
|
|
|
32
|
$name = $Header_HI_For{ lc $name } |
34
|
|
|
|
|
|
|
if exists $Header_HI_For{ lc $name }; |
35
|
|
|
|
|
|
|
|
36
|
11
|
50
|
|
|
|
15
|
$value = '' |
37
|
|
|
|
|
|
|
unless defined $value; |
38
|
|
|
|
|
|
|
|
39
|
11
|
|
|
|
|
56
|
return bless { |
40
|
|
|
|
|
|
|
value => $value, |
41
|
|
|
|
|
|
|
hi => $name, |
42
|
|
|
|
|
|
|
}, $class; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub make { |
46
|
11
|
|
|
11
|
1
|
11
|
my $self = shift; |
47
|
|
|
|
|
|
|
|
48
|
11
|
|
|
|
|
39
|
my $value = $self->value; |
49
|
11
|
50
|
|
|
|
24
|
unless ( length $value ) { |
50
|
0
|
|
|
|
|
0
|
return $self->hi . "\x00\x03"; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
11
|
|
|
|
|
27
|
my $header = $self->hi; # header code |
54
|
11
|
|
|
|
|
22
|
$header .= pack 'n', 3 + length $value; |
55
|
11
|
|
|
|
|
12
|
$header .= $value; |
56
|
11
|
|
|
|
|
33
|
return $self->header($header); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
__END__ |