C# 클래스 SnmpSharpNet.UTarget

USM security SNMP version 3 target class.
상속: ITarget
파일 보기 프로젝트 열기: griffina/SnmpSharpNet

보호된 프로퍼티들

프로퍼티 타입 설명
_address IpAddress
_authenticationProtocol AuthenticationDigests
_authenticationSecret MutableByte
_contextEngineId OctetString
_contextName OctetString
_engineBoots Integer32
_engineId OctetString
_engineTime Integer32
_engineTimeStamp System.DateTime
_maxMessageSize Integer32
_port int
_privacyProtocol PrivacyProtocols
_privacySecret MutableByte
_reportable bool
_retry int
_securityName OctetString
_timeout int
_version SnmpVersion

공개 메소드들

메소드 설명
GetCurrentEngineTime ( ) : int

Calculates and returns current agents engine time. ValidateEngineTime is called prior to calculation to make sure current engine time is timely enough to use. EngineTime is calculated as last received engine time + difference in seconds between the time stamp saved when last time value was received and current time (using the internal GMT clock).

PreparePacketForTransmission ( SnmpPacket packet ) : bool

Prepare packet for transmission by filling target specific information in the packet.

Reset ( ) : void

Reset the class. Initialize all member values to class defaults.

UTarget ( ) : System

Constructor

UpdateDiscoveryValues ( SnmpPacket packet ) : void

Update class values with SNMP version 3 discovery values from the supplied SnmpV3Packet class. Values updated are EngineId, EngineTime and EngineBoots.

UpdateTimeStamp ( ) : void

Updates engine time timestamp. This value is used to determine if agents engine time stored in this class is valid. Timestamp is saved as DateTime class by default initialized to DateTime.MinValue. Timestamp value is stored in GMT to make it portable (if it is saved on one computer and loaded on another that uses a different time zone).

Valid ( ) : bool

Checks validity of the class.

ValidateEngineTime ( ) : bool

Validate agents engine time. Valid engine time value is time that has been initialized to a value other then default (DateTime.MinValue is default set in the constructor) and that has been updated in the last 10 times the SNMP v3 timely window (150 seconds). In other words, valid time is any time value in the last 1500 seconds (or 25 minutes).

ValidateReceivedPacket ( SnmpPacket packet ) : bool

Validate received reply

비공개 메소드들

메소드 설명
EngineTimeStamp ( ) : System.DateTime

Get engine time stamp value (last time engine boots and time values were retrieved from the SNMP agent).

메소드 상세

GetCurrentEngineTime() 공개 메소드

Calculates and returns current agents engine time. ValidateEngineTime is called prior to calculation to make sure current engine time is timely enough to use. EngineTime is calculated as last received engine time + difference in seconds between the time stamp saved when last time value was received and current time (using the internal GMT clock).
public GetCurrentEngineTime ( ) : int
리턴 int

PreparePacketForTransmission() 공개 메소드

Prepare packet for transmission by filling target specific information in the packet.
public PreparePacketForTransmission ( SnmpPacket packet ) : bool
packet SnmpPacket SNMP packet class for the required version
리턴 bool

Reset() 공개 메소드

Reset the class. Initialize all member values to class defaults.
public Reset ( ) : void
리턴 void

UTarget() 공개 메소드

Constructor
public UTarget ( ) : System
리턴 System

UpdateDiscoveryValues() 공개 메소드

Update class values with SNMP version 3 discovery values from the supplied SnmpV3Packet class. Values updated are EngineId, EngineTime and EngineBoots.
Thrown when SNMP packet class other then version 3 /// is passed as parameter
public UpdateDiscoveryValues ( SnmpPacket packet ) : void
packet SnmpPacket class cast as
리턴 void

UpdateTimeStamp() 공개 메소드

Updates engine time timestamp. This value is used to determine if agents engine time stored in this class is valid. Timestamp is saved as DateTime class by default initialized to DateTime.MinValue. Timestamp value is stored in GMT to make it portable (if it is saved on one computer and loaded on another that uses a different time zone).
public UpdateTimeStamp ( ) : void
리턴 void

Valid() 공개 메소드

Checks validity of the class.
public Valid ( ) : bool
리턴 bool

ValidateEngineTime() 공개 메소드

Validate agents engine time. Valid engine time value is time that has been initialized to a value other then default (DateTime.MinValue is default set in the constructor) and that has been updated in the last 10 times the SNMP v3 timely window (150 seconds). In other words, valid time is any time value in the last 1500 seconds (or 25 minutes).
public ValidateEngineTime ( ) : bool
리턴 bool

ValidateReceivedPacket() 공개 메소드

Validate received reply
Thrown on following errors with ErrorCode: /// * ErrorCode = 0: SecureAgentParameters was updated after request was made but before reply was received (this is not allowed) /// * SnmpException.InvalidAuthoritativeEngineId: engine id in the reply does not match request /// * SnmpException.InvalidSecurityName: security name mismatch between request and reply packets /// * SnmpException.ReportOnNoReports: report packet received when we had reportable set to false in the request /// * SnmpException.UnsupportedNoAuthPriv: noAuthPriv is not supported /// Thrown when configured privacy passwords in this class and in the packet class do not match Thrown when configured authentication passwords in this class and in the packet class do not match
public ValidateReceivedPacket ( SnmpPacket packet ) : bool
packet SnmpPacket Received SNMP packet
리턴 bool

프로퍼티 상세

_address 보호되어 있는 프로퍼티

Target IP address
protected IpAddress,SnmpSharpNet _address
리턴 IpAddress

_authenticationProtocol 보호되어 있는 프로퍼티

Authentication digest to use in authNoPriv and authPriv security combinations. For available authentication digests, see AuthenticationDigests enumeration.
protected AuthenticationDigests _authenticationProtocol
리턴 AuthenticationDigests

_authenticationSecret 보호되어 있는 프로퍼티

Authentication secret (or authentication password)
protected MutableByte _authenticationSecret
리턴 MutableByte

_contextEngineId 보호되어 있는 프로퍼티

Context engine id. By default, this value is set to authoritative engine id value unless specifically set to a different value here.
protected OctetString _contextEngineId
리턴 OctetString

_contextName 보호되어 있는 프로퍼티

Context name. By default this value is a 0 length string (no context name). Set this value if you require it to be defined in ScopedPdu.
protected OctetString _contextName
리턴 OctetString

_engineBoots 보호되어 있는 프로퍼티

Authoritative engine boots value
protected Integer32 _engineBoots
리턴 Integer32

_engineId 보호되어 있는 프로퍼티

Authoritative engine id
protected OctetString _engineId
리턴 OctetString

_engineTime 보호되어 있는 프로퍼티

Authoritative engine time value
protected Integer32 _engineTime
리턴 Integer32

_engineTimeStamp 보호되어 있는 프로퍼티

Time stamp when authoritative engine time value was last refreshed with data from the agent. This value is used to calculate up to date authoritative agent time value without having to repeat discovery process every 150 seconds.
protected DateTime,System _engineTimeStamp
리턴 System.DateTime

_maxMessageSize 보호되어 있는 프로퍼티

Maximum message size. This value is by default set to 64KB and then updated by the maximum message size value in the response from the agent. This value should be the smallest message size supported by both the agent and manager.
protected Integer32 _maxMessageSize
리턴 Integer32

_port 보호되어 있는 프로퍼티

Target port number
protected int _port
리턴 int

_privacyProtocol 보호되어 있는 프로퍼티

Privacy protocol to use. For available protocols, see PrivacyProtocols enumeration.
protected PrivacyProtocols _privacyProtocol
리턴 PrivacyProtocols

_privacySecret 보호되어 있는 프로퍼티

Privacy secret (or privacy password)
protected MutableByte _privacySecret
리턴 MutableByte

_reportable 보호되어 있는 프로퍼티

Reportable option flag. Set to true by default. This flag controls if reportable flag will be set in the packet. When this flag is set in the packet, agent will respond to invalid requests with Report packets. Without this flag being set, all invalid requests are silently dropped by the agent.
protected bool _reportable
리턴 bool

_retry 보호되어 있는 프로퍼티

Target maximum retry count
protected int _retry
리턴 int

_securityName 보호되어 있는 프로퍼티

Security name value, or user name.
protected OctetString _securityName
리턴 OctetString

_timeout 보호되어 있는 프로퍼티

Target request timeout period in milliseconds
protected int _timeout
리턴 int

_version 보호되어 있는 프로퍼티

Target SNMP version number
protected SnmpVersion _version
리턴 SnmpVersion