Class SnmpMessageExtension
- Namespace
- Lextm.SharpSnmpLib.Messaging
- Assembly
- SharpSnmpLib.dll
Extension methods for ISnmpMessage.
public static class SnmpMessageExtension
- Inheritance
-
SnmpMessageExtension
- Inherited Members
Properties
IsRunningOnIOS
Gets a value indicating whether it is running on iOS.
public static bool IsRunningOnIOS { get; }
Property Value
- bool
true
if is running on iOS; otherwise,false
.
IsRunningOnMac
Gets a value indicating whether it is running on macOS.
public static bool IsRunningOnMac { get; }
Property Value
- bool
true
if is running on macOS; otherwise,false
.
IsRunningOnWindows
Gets a value indicating whether it is running on Windows.
public static bool IsRunningOnWindows { get; }
Property Value
- bool
true
if is running on Windows; otherwise,false
.
Methods
Community(ISnmpMessage)
Community name.
public static OctetString Community(this ISnmpMessage message)
Parameters
message
ISnmpMessageThe ISnmpMessage.
Returns
GetResponse(ISnmpMessage, int, IPEndPoint)
Sends this ISnmpMessage and handles the response from agent.
public static ISnmpMessage GetResponse(this ISnmpMessage request, int timeout, IPEndPoint receiver)
Parameters
request
ISnmpMessageThe ISnmpMessage.
timeout
intThe time-out value, in milliseconds. The default value is 0, which indicates an infinite time-out period. Specifying -1 also indicates an infinite time-out period.
receiver
IPEndPointPort number.
Returns
GetResponse(ISnmpMessage, int, IPEndPoint, UserRegistry)
Sends this ISnmpMessage and handles the response from agent.
public static ISnmpMessage GetResponse(this ISnmpMessage request, int timeout, IPEndPoint receiver, UserRegistry registry)
Parameters
request
ISnmpMessageThe ISnmpMessage.
timeout
intThe time-out value, in milliseconds. The default value is 0, which indicates an infinite time-out period. Specifying -1 also indicates an infinite time-out period.
receiver
IPEndPointPort number.
registry
UserRegistryUser registry.
Returns
GetResponse(ISnmpMessage, int, IPEndPoint, UserRegistry, Socket)
Sends an ISnmpMessage and handles the response from agent.
public static ISnmpMessage GetResponse(this ISnmpMessage request, int timeout, IPEndPoint receiver, UserRegistry registry, Socket udpSocket)
Parameters
request
ISnmpMessageThe ISnmpMessage.
timeout
intThe time-out value, in milliseconds. The default value is 0, which indicates an infinite time-out period. Specifying -1 also indicates an infinite time-out period.
receiver
IPEndPointAgent.
registry
UserRegistryThe user registry.
udpSocket
SocketThe UDP Socket to use to send/receive.
Returns
GetResponse(ISnmpMessage, int, IPEndPoint, Socket)
Sends this ISnmpMessage and handles the response from agent.
public static ISnmpMessage GetResponse(this ISnmpMessage request, int timeout, IPEndPoint receiver, Socket udpSocket)
Parameters
request
ISnmpMessageThe ISnmpMessage.
timeout
intThe time-out value, in milliseconds. The default value is 0, which indicates an infinite time-out period. Specifying -1 also indicates an infinite time-out period.
receiver
IPEndPointAgent.
udpSocket
SocketThe UDP Socket to use to send/receive.
Returns
GetResponseAsync(ISnmpMessage, IPEndPoint)
Sends this ISnmpMessage and handles the response from agent.
public static Task<ISnmpMessage> GetResponseAsync(this ISnmpMessage request, IPEndPoint receiver)
Parameters
request
ISnmpMessageThe ISnmpMessage.
receiver
IPEndPointPort number.
Returns
GetResponseAsync(ISnmpMessage, IPEndPoint, UserRegistry)
Sends this ISnmpMessage and handles the response from agent.
public static Task<ISnmpMessage> GetResponseAsync(this ISnmpMessage request, IPEndPoint receiver, UserRegistry registry)
Parameters
request
ISnmpMessageThe ISnmpMessage.
receiver
IPEndPointPort number.
registry
UserRegistryUser registry.
Returns
GetResponseAsync(ISnmpMessage, IPEndPoint, UserRegistry, Socket)
Sends an ISnmpMessage and handles the response from agent.
public static Task<ISnmpMessage> GetResponseAsync(this ISnmpMessage request, IPEndPoint receiver, UserRegistry registry, Socket udpSocket)
Parameters
request
ISnmpMessageThe ISnmpMessage.
receiver
IPEndPointAgent.
registry
UserRegistryThe user registry.
udpSocket
SocketThe UDP Socket to use to send/receive.
Returns
GetResponseAsync(ISnmpMessage, IPEndPoint, UserRegistry, Socket, CancellationToken)
Sends an ISnmpMessage and handles the response from agent.
public static Task<ISnmpMessage> GetResponseAsync(this ISnmpMessage request, IPEndPoint receiver, UserRegistry registry, Socket udpSocket, CancellationToken token)
Parameters
request
ISnmpMessageThe ISnmpMessage.
receiver
IPEndPointAgent.
registry
UserRegistryThe user registry.
udpSocket
SocketThe UDP Socket to use to send/receive.
token
CancellationTokenThe cancellation token.
Returns
GetResponseAsync(ISnmpMessage, IPEndPoint, UserRegistry, CancellationToken)
Sends this ISnmpMessage and handles the response from agent.
public static Task<ISnmpMessage> GetResponseAsync(this ISnmpMessage request, IPEndPoint receiver, UserRegistry registry, CancellationToken token)
Parameters
request
ISnmpMessageThe ISnmpMessage.
receiver
IPEndPointPort number.
registry
UserRegistryUser registry.
token
CancellationTokenThe cancellation token.
Returns
GetResponseAsync(ISnmpMessage, IPEndPoint, Socket)
Sends this ISnmpMessage and handles the response from agent.
public static Task<ISnmpMessage> GetResponseAsync(this ISnmpMessage request, IPEndPoint receiver, Socket udpSocket)
Parameters
request
ISnmpMessageThe ISnmpMessage.
receiver
IPEndPointAgent.
udpSocket
SocketThe UDP Socket to use to send/receive.
Returns
GetResponseAsync(ISnmpMessage, IPEndPoint, Socket, CancellationToken)
Sends this ISnmpMessage and handles the response from agent.
public static Task<ISnmpMessage> GetResponseAsync(this ISnmpMessage request, IPEndPoint receiver, Socket udpSocket, CancellationToken token)
Parameters
request
ISnmpMessageThe ISnmpMessage.
receiver
IPEndPointAgent.
udpSocket
SocketThe UDP Socket to use to send/receive.
token
CancellationTokenThe cancellation token.
Returns
GetResponseAsync(ISnmpMessage, IPEndPoint, CancellationToken)
Sends this ISnmpMessage and handles the response from agent.
public static Task<ISnmpMessage> GetResponseAsync(this ISnmpMessage request, IPEndPoint receiver, CancellationToken token)
Parameters
request
ISnmpMessageThe ISnmpMessage.
receiver
IPEndPointPort number.
token
CancellationTokenThe cancellation token.
Returns
IsRunningOnMono()
Tests if running on Mono.
public static bool IsRunningOnMono()
Returns
MessageId(ISnmpMessage)
Gets the message ID.
public static int MessageId(this ISnmpMessage message)
Parameters
message
ISnmpMessageThe ISnmpMessage.
Returns
- int
The message ID.
Remarks
For v3, message ID is different from request ID. For v1 and v2c, they are the same.
Pdu(ISnmpMessage)
PDU.
public static ISnmpPdu Pdu(this ISnmpMessage message)
Parameters
message
ISnmpMessageThe ISnmpMessage.
Returns
RequestId(ISnmpMessage)
Request ID.
public static int RequestId(this ISnmpMessage message)
Parameters
message
ISnmpMessageThe ISnmpMessage.
Returns
Send(ISnmpMessage, EndPoint)
Sends an ISnmpMessage.
public static void Send(this ISnmpMessage message, EndPoint manager)
Parameters
message
ISnmpMessageThe ISnmpMessage.
manager
EndPointManager
Send(ISnmpMessage, EndPoint, Socket)
Sends an ISnmpMessage.
public static void Send(this ISnmpMessage message, EndPoint manager, Socket socket)
Parameters
message
ISnmpMessageThe ISnmpMessage.
manager
EndPointManager
socket
SocketThe socket.
SendAsync(ISnmpMessage, EndPoint)
Sends an ISnmpMessage.
public static Task SendAsync(this ISnmpMessage message, EndPoint manager)
Parameters
message
ISnmpMessageThe ISnmpMessage.
manager
EndPointManager
Returns
SendAsync(ISnmpMessage, EndPoint, Socket)
Sends an ISnmpMessage.
public static Task SendAsync(this ISnmpMessage message, EndPoint manager, Socket socket)
Parameters
message
ISnmpMessageThe ISnmpMessage.
manager
EndPointManager
socket
SocketThe socket.
Returns
SendAsync(ISnmpMessage, EndPoint, Socket, CancellationToken)
Sends an ISnmpMessage.
public static Task SendAsync(this ISnmpMessage message, EndPoint manager, Socket socket, CancellationToken token)
Parameters
message
ISnmpMessageThe ISnmpMessage.
manager
EndPointManager
socket
SocketThe socket.
token
CancellationTokenThe cancellation token.
Returns
SendAsync(ISnmpMessage, EndPoint, CancellationToken)
Sends an ISnmpMessage.
public static Task SendAsync(this ISnmpMessage message, EndPoint manager, CancellationToken token)
Parameters
message
ISnmpMessageThe ISnmpMessage.
manager
EndPointManager
token
CancellationTokenThe cancellation token.
Returns
TypeCode(ISnmpMessage)
Gets the SnmpType.
public static SnmpType TypeCode(this ISnmpMessage message)
Parameters
message
ISnmpMessageThe ISnmpMessage.
Returns
Variables(ISnmpMessage)
Variables.
public static IList<Variable> Variables(this ISnmpMessage message)
Parameters
message
ISnmpMessageThe ISnmpMessage.