line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Lyskom::StaticSession; |
2
|
1
|
|
|
1
|
|
7
|
use base qw{Net::Lyskom::Object}; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
89
|
|
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use Net::Lyskom::Util qw{:all}; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
144
|
|
7
|
1
|
|
|
1
|
|
7
|
use Net::Lyskom::Time; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
285
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Net::Lyskom::StaticSession - static session information object |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
print "This session came from the host ", $obj->hostname, ".\n"; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head1 DESCRIPTION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=over |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=item ->username() |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
The name of the "real" user. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=item ->hostname() |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
The hostname the connection came from. |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=item ->ident_user() |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
The username as given by the client host ident daemon. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=item ->connection_time() |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
The time when the connection was initiated. Returns a |
36
|
|
|
|
|
|
|
C object. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=back |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
0
|
1
|
|
sub username {my $s = shift; return $s->{username}} |
|
0
|
|
|
|
|
|
|
43
|
0
|
|
|
0
|
1
|
|
sub hostname {my $s = shift; return $s->{hostname}} |
|
0
|
|
|
|
|
|
|
44
|
0
|
|
|
0
|
1
|
|
sub ident_user {my $s = shift; return $s->{ident_user}} |
|
0
|
|
|
|
|
|
|
45
|
0
|
|
|
0
|
1
|
|
sub connection_time {my $s = shift; return $s->{connection_time}} |
|
0
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub new_from_stream { |
48
|
0
|
|
|
0
|
0
|
|
my $s = {}; |
49
|
0
|
|
|
|
|
|
my $class = shift; |
50
|
0
|
|
|
|
|
|
my $ref = shift; |
51
|
|
|
|
|
|
|
|
52
|
0
|
0
|
|
|
|
|
$class = ref($class) if ref($class); |
53
|
0
|
|
|
|
|
|
bless $s,$class; |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
$s->{username} = shift @{$ref}; |
|
0
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
$s->{hostname} = shift @{$ref}; |
|
0
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
$s->{ident_user} = shift @{$ref}; |
|
0
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
$s->{connection_time} = Net::Lyskom::Time->new_from_stream($ref); |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
return $s; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |