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.
|