size_t time_stamp;
char mac[6], *enterprise_oid = NULL, c, mac_info[31], mac_flag = 0;
struct in_addr agent_addr;
- char enterprise[] = { 0x2b, 0x06, 1, 4, 1, 0x83, 0x1a, 1, 1 };
- char *generic_traps[8] = { "ColdStart",
+ char enterprise_410[] = { 0x2b, 0x06, 1, 4, 1, 0x83, 0x1a, 1, 1 };
+ char enterprise_12350[] = { 0x2b, 0x06, 1, 4, 1, 0xe0, 0x3e, 1, 1 };
+ char *generic_traps[8] = {
+ "ColdStart",
"WarmStart",
"LinkDown",
"LinkUp",
enterprise_oid[start[1]] = '\0';
start += start[1] + 2;
memcpy(&agent_addr.s_addr, start + 2, 4);
- if (memcmp(enterprise_oid, enterprise, sizeof(enterprise))) {
+ if (memcmp(enterprise_oid, enterprise_410, sizeof(enterprise_410)) &&
+ memcmp(enterprise_oid, enterprise_12350, sizeof(enterprise_12350)))
+ {
syslog(LOG_INFO,
_
("Received unknown SNMP ver %d trap. From %s:%d. Agent: %s. Community: %s."),
}
syslog(LOG_INFO,
_
- ("Agent:v%d %s (%s@%s:%d) %s%s%s. SysUptime %d:%02d:%02d.%02d"),
+ ("Agent:v%d %s (%s@%s:%d) Trap %i: %s%s%s. "
+ "SysUptime %d:%02d:%02d.%02d"),
snmp_version + 1, inet_ntoa(agent_addr),
community, inet_ntoa(client.sin_addr), ntohs(client.sin_port),
- (generic_trap ==
- 6) ? (atmel_ap_type == 1) ? specific_traps[specific_trap-1] : specific_traps_sb[specific_trap-1] :
+ (generic_trap == 6) ? specific_trap: generic_trap + 1,
+ (generic_trap == 6) ?
+ (atmel_ap_type == 1) ? specific_traps_sb[specific_trap-1] : specific_traps[specific_trap-1] :
generic_traps[generic_trap], (mac_flag) ? " " : "",
(mac_flag) ? mac_info : "", time_stamp, min, sec, hand);
}