| 1 | package SNMP::Insight::Session; | ||
| 2 | |||
| 3 | #ABSTRACT: Role for SNMP client implementantions | ||
| 4 | 4 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 4 | our $VERSION = '0.002'; #TRIAL VERSION: | |
| 7 | |||
| 8 | 4 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 4 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 4 | ▶ | use Moose::Util::TypeConstraints; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 4 | enum 'SnmpVersion' => [qw(1 2c 3)]; | |
| 14 | 4 | ▶ | no Moose::Util::TypeConstraints; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | 4 | requires | |
| 17 | 'get_scalar', | ||
| 18 | 'get_subtree'; | ||
| 19 | |||
| 20 | 4 | has hostname => ( | |
| 21 | is => 'ro', | ||
| 22 | isa => 'Str', | ||
| 23 | required => 1, | ||
| 24 | ); | ||
| 25 | |||
| 26 | 4 | has port => ( | |
| 27 | is => 'ro', | ||
| 28 | isa => 'Int', | ||
| 29 | default => '161' | ||
| 30 | ); | ||
| 31 | |||
| 32 | 4 | has localaddr => ( | |
| 33 | is => 'ro', | ||
| 34 | isa => 'Str', | ||
| 35 | ); | ||
| 36 | |||
| 37 | 4 | has localport => ( | |
| 38 | is => 'ro', | ||
| 39 | isa => 'Int', | ||
| 40 | ); | ||
| 41 | |||
| 42 | 4 | has version => ( | |
| 43 | is => 'ro', | ||
| 44 | isa => 'SnmpVersion', | ||
| 45 | required => 1, | ||
| 46 | ); | ||
| 47 | |||
| 48 | 4 | has 'timeout' => ( | |
| 49 | is => 'ro', | ||
| 50 | isa => 'Int', | ||
| 51 | default => 5 | ||
| 52 | ); | ||
| 53 | |||
| 54 | 4 | has 'retries' => ( | |
| 55 | is => 'ro', | ||
| 56 | isa => 'Int', | ||
| 57 | default => 5 | ||
| 58 | ); | ||
| 59 | |||
| 60 | 4 | has 'community' => ( | |
| 61 | is => 'ro', | ||
| 62 | isa => 'Str', | ||
| 63 | ); | ||
| 64 | |||
| 65 | 4 | has 'username' => ( | |
| 66 | is => 'ro', | ||
| 67 | isa => 'Str', | ||
| 68 | ); | ||
| 69 | |||
| 70 | 4 | has 'authkey' => ( | |
| 71 | is => 'ro', | ||
| 72 | isa => 'Str', | ||
| 73 | ); | ||
| 74 | |||
| 75 | 4 | has 'authpassword' => ( | |
| 76 | is => 'ro', | ||
| 77 | isa => 'Str', | ||
| 78 | ); | ||
| 79 | |||
| 80 | 4 | has 'authprotocol' => ( | |
| 81 | is => 'ro', | ||
| 82 | isa => 'Str', | ||
| 83 | ); | ||
| 84 | |||
| 85 | 4 | has 'privkey' => ( | |
| 86 | is => 'ro', | ||
| 87 | isa => 'Str', | ||
| 88 | ); | ||
| 89 | |||
| 90 | 4 | has 'privpassword' => ( | |
| 91 | is => 'ro', | ||
| 92 | isa => 'Str', | ||
| 93 | ); | ||
| 94 | |||
| 95 | 4 | has 'privprotocol' => ( | |
| 96 | is => 'ro', | ||
| 97 | isa => 'Str', | ||
| 98 | ); | ||
| 99 | |||
| 100 | 4 | 1; | |
| 101 | |||
| 102 | # Local Variables: | ||
| 103 | # mode: cperl | ||
| 104 | # indent-tabs-mode: nil | ||
| 105 | # cperl-indent-level: 4 | ||
| 106 | # cperl-indent-parens-as-block: t | ||
| 107 | # End: | ||
| 108 | |||
| 109 | __END__ | ||