Send SNMP Trap notification

Namespace:  SnmpSharpNet
Assembly:  SnmpSharpNet (in SnmpSharpNet.dll) Version: 0.5.2.0 (0.5.2.0)

Syntax

C#
public static void SendTrap(
	SnmpPacket packet,
	IpAddress peer,
	int port
)
Visual Basic (Declaration)
Public Shared Sub SendTrap ( _
	packet As SnmpPacket, _
	peer As IpAddress, _
	port As Integer _
)
Visual C++
public:
static void SendTrap(
	SnmpPacket^ packet, 
	IpAddress^ peer, 
	int port
)

Parameters

packet
Type: SnmpSharpNet..::.SnmpPacket
SNMP trap packet
peer
Type: SnmpSharpNet..::.IpAddress
Manager (receiver) IP address
port
Type: System..::.Int32
Manager (receiver) UDP port number

Remarks

Helper function to allow for seamless sending of SNMP notifications for all protocol versions. packet parameter should be appropriately formatted SNMP notification in SnmpV1TrapPacket, SnmpV2Packet or SnmpV3Packet class cast as SnmpPacket class. Function will determine which version of the notification is to be used by checking the type of the packet parameter and call appropriate TrapAgent member function to send it.

See Also