| Example |
void send_alarm (void) {
/* Send a trap message when alarm input is activated.*/
U16 obj[2];
/* Change the community to "private". */
snmp_set_community ("private");
/* Add "KeyIn" value to trap message. */
obj[0] = 1;
obj[1] = 8; /* Index of "KeyIn" entry in MIB table. */
snmp_trap (NULL, 6, 1, obj);
/* Restore the community to "public". */
snmp_set_community ("public");
}
|