C# Класс SnmpSharpNet.UdpTarget

Transport class for IPv4 using UDP
InternetProtocol version 4 User Datagram Protocol (IP/UDP) transport protocol implementation for use with SNMP versions 1, 2 and 3.
Наследование: UdpTransport, IDisposable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_address System.Net.IPAddress
_agentParameters IAgentParameters
_port int
_retry int
_timeout int

Открытые методы

Метод Описание
Discovery ( SecureAgentParameters param ) : bool

Perform SNMP version 3 discovery operation. This is the first operation that needs to be performed on a newly accessed agent to retrieve agentId, agentBoots and agentTime values, critical for further authentication and privacy operations.

DiscoveryAsync ( SecureAgentParameters param, SnmpAsyncResponse callback ) : bool

Make an async discovery request for protocol version 3.

Request ( Pdu pdu, IAgentParameters agentParameters ) : SnmpPacket

Make SNMP Request

Make SNMP request. With this method you can make blocked SNMP version 1, 2 and 3 requests of type GET, GET-NEXT, GET-BULK, SET and REPORT (request types have to compatible with the SNMP protocol version you are using). This method will pass through any exceptions thrown by parsing classes/methods so see individual packet classes, ASN.1 type classes, authentication, privacy, etc. classes for exceptions thrown.

RequestAsync ( Pdu pdu, IAgentParameters agentParameters, SnmpAsyncResponse responseCallback ) : bool

Make SNMP request. With this method you can make blocked SNMP version 1, 2 and 3 requests of type GET, GET-NEXT, GET-BULK, SET and REPORT (request types have to compatible with the SNMP protocol version you are using). This method will pass through any exceptions thrown by parsing classes/methods so see individual packet classes, ASN.1 type classes, authentication, privacy, etc. classes for exceptions thrown.

UdpTarget ( IPAddress peer ) : System

Constructor

Initializes the class with defaults for timeout (2000ms = 2 seconds), retry (two) and agent UDP port number (161).

UdpTarget ( IPAddress peer, int port, int timeout, int retry ) : System

Constructor.

Приватные методы

Метод Описание
AsyncResponse ( AsyncRequestResult result, IPEndPoint peer, byte buffer, int buflen ) : void

Описание методов

Discovery() публичный Метод

Perform SNMP version 3 discovery operation. This is the first operation that needs to be performed on a newly accessed agent to retrieve agentId, agentBoots and agentTime values, critical for further authentication and privacy operations.
public Discovery ( SecureAgentParameters param ) : bool
param SecureAgentParameters class instance that will be updated /// with discovered agent values. This class with be reset to its defaults prior to agent /// discovered values so do not store any critical information in it prior to calling the /// discovery method
Результат bool

DiscoveryAsync() публичный Метод

Make an async discovery request for protocol version 3.
public DiscoveryAsync ( SecureAgentParameters param, SnmpAsyncResponse callback ) : bool
param SecureAgentParameters Agent parameters
callback SnmpAsyncResponse Callback method
Результат bool

Request() публичный Метод

Make SNMP Request
Make SNMP request. With this method you can make blocked SNMP version 1, 2 and 3 requests of type GET, GET-NEXT, GET-BULK, SET and REPORT (request types have to compatible with the SNMP protocol version you are using). This method will pass through any exceptions thrown by parsing classes/methods so see individual packet classes, ASN.1 type classes, authentication, privacy, etc. classes for exceptions thrown.
Thrown on SNMPv3 requests when authentication password /// is not specified on authNoPriv or authPriv requests in SecureAgentParameters or if incoming packet /// authentication check failed. /// /// With SNMP ver1 and ver2c, authentication check fails when invalid community name is parsed in the reply. Thrown on SNMPv3 requests when privacy password is not /// specified in SecureAgentParameters on authPriv requests. Thrown in following cases: /// /// * IAgentParameters.Valid() returned false. SnmpException.ErrorCode is set to SnmpException.InvalidIAgentParameters /// * No data received on request. SnmpException.ErrorCode is set to SnmpException.NoDataReceived /// * Invalid RequestId in reply. SnmpException.ErrorCode is set to SnmpException.InvalidRequestId ///
public Request ( Pdu pdu, IAgentParameters agentParameters ) : SnmpPacket
pdu Pdu Pdu class (do not pass ScopedPdu)
agentParameters IAgentParameters Security information for the request. Use /// for SNMP versions 1 and 2 requests. Use for SNMP version 3 /// requests.
Результат SnmpPacket

RequestAsync() публичный Метод

Make SNMP request. With this method you can make blocked SNMP version 1, 2 and 3 requests of type GET, GET-NEXT, GET-BULK, SET and REPORT (request types have to compatible with the SNMP protocol version you are using). This method will pass through any exceptions thrown by parsing classes/methods so see individual packet classes, ASN.1 type classes, authentication, privacy, etc. classes for exceptions thrown.
public RequestAsync ( Pdu pdu, IAgentParameters agentParameters, SnmpAsyncResponse responseCallback ) : bool
pdu Pdu Pdu class (do not pass ScopedPdu)
agentParameters IAgentParameters Security information for the request. Use /// for SNMP versions 1 and 2 requests. Use for SNMP version 3 /// requests.
responseCallback SnmpAsyncResponse Callback that receives the result of the async operation.
Результат bool

UdpTarget() публичный Метод

Constructor
Initializes the class with defaults for timeout (2000ms = 2 seconds), retry (two) and agent UDP port number (161).
public UdpTarget ( IPAddress peer ) : System
peer System.Net.IPAddress Agent IP address
Результат System

UdpTarget() публичный Метод

Constructor.
public UdpTarget ( IPAddress peer, int port, int timeout, int retry ) : System
peer System.Net.IPAddress SNMP peer IP address
port int SNMP peer UDP port number
timeout int SNMP peer timeout in milliseconds
retry int SNMP peer maximum retires setting. Value of 0 will result in a single request with no retries.
Результат System

Описание свойств

_address защищенное свойство

SNMP request target host IP address
protected IPAddress,System.Net _address
Результат System.Net.IPAddress

_agentParameters защищенное свойство

Internal storage of the agent parameters information passed to the async request member function.
protected IAgentParameters _agentParameters
Результат IAgentParameters

_port защищенное свойство

SNMP target UDP port number
protected int _port
Результат int

_retry защищенное свойство

Maximum number of retries. Value of 0 (zero) will result in a single request without retries.
protected int _retry
Результат int

_timeout защищенное свойство

SNMP request timeout value in milliseconds
protected int _timeout
Результат int