On 15/01/07, Thomas Anders <[EMAIL PROTECTED]> wrote:
thanks for the Wiki feedback. Do you care to propose a specific patch what
*exactly* you'd like to drop w.r.t. the third issue?
Appended.
Dave
Index: apps/snmptrapd.c
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/apps/snmptrapd.c,v
retrieving revision 5.79
diff -u -r5.79 snmptrapd.c
--- apps/snmptrapd.c 22 Nov 2006 12:58:20 -0000 5.79
+++ apps/snmptrapd.c 16 Jan 2007 09:13:21 -0000
@@ -138,7 +138,6 @@
char *logfile = 0;
int SyslogTrap = 0;
-int Event = 0;
int dropauth = 0;
int reconfig = 0;
char ddefault_port[] = "udp:162"; /* Default default port */
@@ -202,7 +201,7 @@
#define SNMPTRAPD_RUNNING 1
#define SNMPTRAPD_STOPPED 0
int trapd_status = SNMPTRAPD_STOPPED;
-/* app_name_long used for Event Log (syslog), SCM, registry etc */
+/* app_name_long used for SCM, registry etc */
LPTSTR app_name_long = _T("Net-SNMP Trap Handler"); /* Application Name */
#endif
@@ -228,72 +227,6 @@
extern void subagent_init(void);
#endif
-void
-event_input(netsnmp_variable_list * vp)
-{
- int eventid = 0;
- oid variable[MAX_OID_LEN];
- int variablelen = 0;
- u_long destip = 0;
- int sampletype = 0;
- int value = 0;
- int threshold = 0;
- int i;
- int nvars = 0;
-
- netsnmp_variable_list *vp2 = vp;
-
- oid *op = NULL;
-
- /* Make sure there are 5 variables. Otherwise, don't bother */
- for (i=1; i <= 5; i++) {
- vp2 = vp2->next_variable;
- if (!vp2) {
- nvars = -1;
- break;
- }
- }
-
- if (nvars != -1)
- {
- vp = vp->next_variable; /* skip sysUptime */
- if (vp->val_len != sizeof(risingAlarm) ||
- !memcmp(vp->val.objid, risingAlarm, sizeof(risingAlarm)))
- eventid = 1;
- else if (vp->val_len != sizeof(risingAlarm) ||
- !memcmp(vp->val.objid, fallingAlarm, sizeof(fallingAlarm)))
- eventid = 2;
- else if (vp->val_len != sizeof(risingAlarm) ||
- !memcmp(vp->val.objid, unavailableAlarm, sizeof(unavailableAlarm)))
- eventid = 3;
- else {
- fprintf(stderr, "unknown event\n");
- eventid = 0;
- }
-
- vp = vp->next_variable;
- memmove(variable, vp->val.objid, vp->val_len * sizeof(oid));
- variablelen = vp->val_len;
- op = vp->name + 22;
- destip = 0;
- destip |= (*op++) << 24;
- destip |= (*op++) << 16;
- destip |= (*op++) << 8;
- destip |= *op++;
-
- vp = vp->next_variable;
- sampletype = *vp->val.integer;
-
- vp = vp->next_variable;
- value = *vp->val.integer;
-
- vp = vp->next_variable;
- threshold = *vp->val.integer;
- }
- printf("%d: 0x%02lX %d %d %d\n", eventid, destip, sampletype, value,
- threshold);
-}
-
void
usage(void)
@@ -315,8 +248,6 @@
" -C\t\t\tdo not read the default configuration files\n");
fprintf(stderr, " -d\t\t\tdump sent and received SNMP packets\n");
fprintf(stderr, " -D\t\t\tturn on debugging output\n");
- fprintf(stderr,
- " -e\t\t\tprint event # (rising/falling alarm, etc.)\n");
fprintf(stderr, " -f\t\t\tdo not fork from the shell\n");
fprintf(stderr,
" -F FORMAT\t\tuse specified format for logging to standard error\n");
@@ -1077,24 +1008,6 @@
traph->authtypes = TRAP_AUTH_LOG;
}
- if (Event) {
- traph = netsnmp_add_traphandler(event_handler, risingAlarm,
- OID_LENGTH(risingAlarm));
- traph->authtypes = TRAP_AUTH_LOG;
-
- traph = netsnmp_add_traphandler(event_handler, fallingAlarm,
- OID_LENGTH(fallingAlarm));
- traph->authtypes = TRAP_AUTH_LOG;
-
- traph = netsnmp_add_traphandler(event_handler, unavailableAlarm,
- OID_LENGTH(unavailableAlarm));
- traph->authtypes = TRAP_AUTH_LOG;
- /* XXX - might be worth setting some "magic data"
- * in the traphandler structure that 'event_handler'
- * can use to avoid checking the trap OID values.
- */
- }
-
#if defined(USING_AGENTX_SUBAGENT_MODULE) && !defined(SNMPTRAPD_DISABLE_AGENTX)
/*
* we're an agentx subagent?
Index: apps/snmptrapd_handlers.c
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/apps/snmptrapd_handlers.c,v
retrieving revision 5.39
diff -u -r5.39 snmptrapd_handlers.c
--- apps/snmptrapd_handlers.c 15 Oct 2006 21:44:14 -0000 5.39
+++ apps/snmptrapd_handlers.c 16 Jan 2007 09:13:21 -0000
@@ -925,23 +925,6 @@
/*
- * Trap handler for doing something with "event" traps
- * (not entirely clear what this is about ???)
- */
- /* XXX - in snmptrapd.c */
-void event_input(netsnmp_variable_list * vp);
-
-int event_handler( netsnmp_pdu *pdu,
- netsnmp_transport *transport,
- netsnmp_trapd_handler *handler)
-{
- DEBUGMSGTL(( "snmptrapd", "event_handler\n"));
- event_input(pdu->variables);
- return NETSNMPTRAPD_HANDLER_OK;
-}
-
-
-/*
* Trap handler for forwarding to the AgentX master agent
*/
int axforward_handler( netsnmp_pdu *pdu,
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders