| 1 | package Net::Lyskom::StaticSession; | ||||||||||
| 2 | 1 | ▶ | use base qw{Net::Lyskom::Object}; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use Net::Lyskom::Util qw{:all}; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use Net::Lyskom::Time; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 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<Net::Lyskom::Time> object. | ||||||||||
| 37 | |||||||||||
| 38 | =back | ||||||||||
| 39 | |||||||||||
| 40 | =cut | ||||||||||
| 41 | |||||||||||
| 42 | 0 | ▶ | sub username {my $s = shift; return $s->{username}} | ||||||||
|
Subroutine
username: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 43 | 0 | ▶ | sub hostname {my $s = shift; return $s->{hostname}} | ||||||||
|
Subroutine
hostname: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 44 | 0 | ▶ | sub ident_user {my $s = shift; return $s->{ident_user}} | ||||||||
|
Subroutine
ident_user: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 45 | 0 | ▶ | sub connection_time {my $s = shift; return $s->{connection_time}} | ||||||||
|
Subroutine
connection_time: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 46 | |||||||||||
| 47 | 0 | ▶ | sub new_from_stream { | ||||||||
|
Subroutine
new_from_stream: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 48 | 0 | my $s = {}; | |||||||||
| 49 | 0 | my $class = shift; | |||||||||
| 50 | 0 | my $ref = shift; | |||||||||
| 51 | |||||||||||
| 52 | 0 | ▶ | $class = ref($class) if ref($class); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 53 | 0 | bless $s,$class; | |||||||||
| 54 | |||||||||||
| 55 | 0 | $s->{username} = shift @{$ref}; | |||||||||
| 56 | 0 | $s->{hostname} = shift @{$ref}; | |||||||||
| 57 | 0 | $s->{ident_user} = shift @{$ref}; | |||||||||
| 58 | 0 | $s->{connection_time} = Net::Lyskom::Time->new_from_stream($ref); | |||||||||
| 59 | |||||||||||
| 60 | 0 | return $s; | |||||||||
| 61 | } | ||||||||||
| 62 | |||||||||||
| 63 | 1 | 1; | |||||||||