#include <rtl.h>
BOOL snmp_trap (
U8* man_ip, /* Pointer to the IP address of Trap Manager. */
U8 gen_trap, /* Generic Trap value. */
U8 spec_trap, /* Specific Trap value. */
U16* obj_list ); /* Pointer to the list of objects. */
Description
The snmp_trap function sends a trap message to the Trap
Manager. Parameter man_ip specifies the IP address of the Trap
server, where the trap message is destined to. If the IP address of
the Trap Manager is not specified (parameter man_ip is
NULL), the IP address of Trap Server configured in Net_Config.c is used instead.
Parameter gen_trap specifies the generic trap
type:
Type
Description
0
coldStart trap
1
warmStart trap
2
linkDown trap
3
linkUp trap
4
authenticationFailure trap
5
egpNeighborLoss trap
6
enterpriseSpecific trap
Parameter spec_trap specifies the specific trap
type. It must be set to 0 for all generic traps from 0 to 5. It
defines a specific trap type for generic enterpriseSpecific
trap.
Parameter obj_list specifies the objects from the
MIB table, which will be included in the trap message
variable-bindings. This parameter is a pointer to the
object list array. This array is of variable size. The first
element specifies the count of objects in the object list
array, followed by the object MIB index values.
Array Index
Array Value
obj[0]
number of objects n
obj[1]
MIB index of first object
obj[2]
MIB index of second object
..
..
obj[n]
MIB index of last object
If obj_list parameter is NULL, or obj[0] = 0,
no object values will be binded to the trap message.
The snmp_trap function is a system function that is in the
RL-TCPnet library. The prototype is defined in net_config.h.
The maximum number of objects that can be binded to the trap
message is limited to 20 objects.
Return Value
The snmp_trap function returns __TRUE when the SNMP trap
message has been sent successfully. On error, this function returns
__FALSE.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.