Hello,

Is there anyone who got NOTIFICATION-LOG-MIB support in snmptrapd
working on Win32 ? Even after having fixed a few compile time and
run-time errors, a MIB walk on OID 1.3.6.1.2.1.92 (notificationLogMIB)
still returns zero varbinds. Any advice is welcome.

The patch below fixes the following issues related to
NOTIFICATION-LOG-MIB support on Win32:
* SOCK_STARTUP is now called before AgentX registration happens
instead of after AgentX registration.
* Added #define USING_NOTIFICATION_LOG_MIB_NOTIFICATION_LOG_MODULE 1.
* Moved the source file
agent/mibgroup/notification-log-mib/notification_log.c from the
libnetsnmptrapd project to the netsnmpmibssdk in order to rid of a
linker error.

Bart.

Index: apps/snmptrapd.c
===================================================================
--- apps/snmptrapd.c    (revision 8048)
+++ apps/snmptrapd.c    (working copy)
@@ -1072,6 +1072,8 @@
         }
     }

+    SOCK_STARTUP;
+
     /*
      * I'm being lazy here, and not checking the
      * return value from these registration calls.
@@ -1289,8 +1291,6 @@
         snmp_log(LOG_WARNING, "-s and -S options are deprecated; use
-Ls <facility> instead\n");
     }

-    SOCK_STARTUP;
-
     if (listen_ports)
         cp = listen_ports;
     else
Index: snmplib/winpipe.c
===================================================================
--- snmplib/winpipe.c   (revision 8048)
+++ snmplib/winpipe.c   (working copy)
@@ -32,6 +32,7 @@

 #ifdef WIN32

+#include <assert.h>
 #include <io.h>
 #include <winsock.h>

@@ -42,6 +43,7 @@

        if( (*sock = socket(AF_INET, SOCK_DGRAM, 0)) == SOCKET_ERROR)
        {
+               assert(GetLastError() != WSANOTINITIALISED);
                return -1;
        }
        socketaddress->sin_family = AF_INET;
Index: win32/netsnmpmibssdk/netsnmpmibssdk.dsp
===================================================================
--- win32/netsnmpmibssdk/netsnmpmibssdk.dsp     (revision 8048)
+++ win32/netsnmpmibssdk/netsnmpmibssdk.dsp     (working copy)
@@ -193,6 +193,10 @@
 # End Source File
 # Begin Source File

+SOURCE=..\..\agent\mibgroup\notification-log-mib\notification_log.c
+# End Source File
+# Begin Source File
+
 
SOURCE=..\..\agent\mibgroup\snmp-notification-mib\snmpNotifyFilterTable\snmpNotifyFilterTable.c
 # End Source File
 # Begin Source File
Index: win32/net-snmp/agent/mib_module_config.h
===================================================================
--- win32/net-snmp/agent/mib_module_config.h    (revision 8048)
+++ win32/net-snmp/agent/mib_module_config.h    (working copy)
@@ -15,6 +15,9 @@
 /* Define if compiling with the notification module files.  */
 #define USING_NOTIFICATION_MODULE 1

+/* Define if compiling with the notification-log-mib module files. */
+#define USING_NOTIFICATION_LOG_MIB_NOTIFICATION_LOG_MODULE 1
+
 /* Define if compiling with the target module files.  */
 #define USING_TARGET_MODULE 1

@@ -133,7 +136,7 @@

 /* Define if compiling with the snmpv3/usmUser module files.  */
 #define USING_SNMPV3_USMUSER_MODULE 1
-
+
 /* Define if compiling with the notification/snmpNotifyTable module files.  */
 #define USING_NOTIFICATION_SNMPNOTIFYTABLE_MODULE 1

Index: win32/libnetsnmptrapd/libnetsnmptrapd.dsp
===================================================================
--- win32/libnetsnmptrapd/libnetsnmptrapd.dsp   (revision 8048)
+++ win32/libnetsnmptrapd/libnetsnmptrapd.dsp   (working copy)
@@ -99,10 +99,6 @@

 SOURCE=..\..\apps\snmptrapd_auth.c
 # End Source File
-# Begin Source File
-
-SOURCE=..\..\agent\mibgroup\notification-log-mib\notification_log.c
-# End Source File
 # End Group
 # Begin Group "Header Files"

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to