Class: Snmpjr::ConfigurationV3

Inherits:
Configuration show all
Defined in:
lib/snmpjr/configuration_v3.rb

Defined Under Namespace

Modules: SecurityLevels

Instance Attribute Summary collapse

Attributes inherited from Configuration

#host, #max_oids_per_request, #port, #retries, #timeout

Instance Method Summary collapse

Constructor Details

#initializeConfigurationV3

Returns a new instance of ConfigurationV3.



17
18
19
20
# File 'lib/snmpjr/configuration_v3.rb', line 17

def initialize
  @context = ''
  super
end

Instance Attribute Details

#authentication_keyObject (readonly)

Returns the value of attribute authentication_key.



15
16
17
# File 'lib/snmpjr/configuration_v3.rb', line 15

def authentication_key
  @authentication_key
end

#authentication_protocolObject (readonly)

Returns the value of attribute authentication_protocol.



15
16
17
# File 'lib/snmpjr/configuration_v3.rb', line 15

def authentication_protocol
  @authentication_protocol
end

#contextObject

Returns the value of attribute context.



14
15
16
# File 'lib/snmpjr/configuration_v3.rb', line 14

def context
  @context
end

#privacy_keyObject (readonly)

Returns the value of attribute privacy_key.



15
16
17
# File 'lib/snmpjr/configuration_v3.rb', line 15

def privacy_key
  @privacy_key
end

#privacy_protocolObject (readonly)

Returns the value of attribute privacy_protocol.



15
16
17
# File 'lib/snmpjr/configuration_v3.rb', line 15

def privacy_protocol
  @privacy_protocol
end

#userObject

Returns the value of attribute user.



14
15
16
# File 'lib/snmpjr/configuration_v3.rb', line 14

def user
  @user
end

Instance Method Details

#authentication(protocol, key) ⇒ Object



28
29
30
31
# File 'lib/snmpjr/configuration_v3.rb', line 28

def authentication protocol, key
  @authentication_protocol = protocol
  @authentication_key = key
end

#create_pduObject



46
47
48
# File 'lib/snmpjr/configuration_v3.rb', line 46

def create_pdu
  Snmpjr::PduV3.new context
end

#create_sessionObject



42
43
44
# File 'lib/snmpjr/configuration_v3.rb', line 42

def create_session
  Snmpjr::SessionV3.new self
end

#create_targetObject



38
39
40
# File 'lib/snmpjr/configuration_v3.rb', line 38

def create_target
  Snmpjr::TargetV3.new.create self
end

#privacy(protocol, key) ⇒ Object



33
34
35
36
# File 'lib/snmpjr/configuration_v3.rb', line 33

def privacy protocol, key
  @privacy_protocol = protocol
  @privacy_key = key
end

#security_levelObject



22
23
24
25
26
# File 'lib/snmpjr/configuration_v3.rb', line 22

def security_level
  return SecurityLevels::AuthPriv if authentication_protocol && privacy_protocol
  return SecurityLevels::AuthNoPriv if authentication_protocol
  SecurityLevels::NoAuthNoPriv
end