Hello, I got an error message while compiling 5.1.1 on my
Mac OS X 10.3.4:
/bin/sh ../../libtool --mode=compile gcc -I../../include -I../../
include -I. -I../.. -I. -I./../.. -I./../../snmplib -I./.. -I.. -I/Users/inoue/
include -Ddarwin7 -c -o mibII/tcpTable.lo mibII/tcpTable.c
rm -f mibII/.libs/tcpTable.lo
gcc -I../../include -I../../include -I. -I../.. -I. -I./../.. -I./../../snmplib -I./
.. -I.. -I/Users/inoue/include -Ddarwin7 -c mibII/tcpTable.c -
fno-common -DPIC -o mibII/.libs/tcpTable.lo
mibII/tcpTable.c: In function `tcpTable_load':
mibII/tcpTable.c:737: error: structure has no member named
`xt_tp'
mibII/tcpTable.c:741: error: structure has no member named
`xt_inp'
make[2]: *** [mibII/tcpTable.lo] Error 1
make[1]: *** [subdirs] Error 1
make: *** [subdirs] Error 1
I read README.osX which suggested to use option --with-
out-mib-modules="ucd-snmp/diskio mibII/tcpTable mibII/
udpTable", but I want to compile with these modules.
Logged In: NO
Applying patch-freebsd5-tcpTable as
#if defined(freebsd4) || defined(freebsd5) || defined(darwin7)
#define NS_ELEM struct xtcpcb
#else
/* this is the original value */
#define NS_ELEM struct xinpcb
#endif
and adding
--- snmp_vars.h.org Tue Mar 16 08:27:45 2004
+++ snmp_vars.h Sun Jun 6 15:15:19 2004
@@ -72,7 +72,7 @@
netsnmp_variable_list * vbp);
-
+#include <stdint.h>
extern long long_return;
extern uint32_t ipaddr_return;
extern u_char return_buf[];
EOF
makes it possible to compile on Mac OS X well. I gave configure
option like this:
./configure --with-libwrap --with-defaults --with-persistent-
directory=/var/db/ucd-snmp \ --with-mib-modules="host disman/event-mib mibII/
mta_sendmail" \ --with-perl-modules --enable-shared --enable-embedded-
perl
Nothing needs as README.osX saids.
Logged In: YES
user_id=88697
try adding the #include <stdint.h> to
include/net-snmp/system/darwin.h
Does that work without the snmp_vars.h change ?
Logged In: YES
user_id=88697
Study the changes that were made for 5.1.2-pre2
(current CVS today). The change was refined since
your attempt, and it may now work for you.
Please advise ASAP.
Logged In: YES
user_id=564069
exploring the changes/workarounds here, building net-snmp-5.1.2.pre3 on
Mac OSX 10.3.4
changes as follows:
=============================================
(EDITOR) agent/mibgroup/mibII/tcpTable.c
@ 698
--- #if defined(freebsd4)
+++ #if defined(freebsd4) || defined(freebsd5) || defined(darwin7)
#define NS_ELEM struct xtcpcb
#else
/* this is the original value */
#define NS_ELEM struct xinpcb
#endif
=============================================
=============================================
(EDITOR) include/net-snmp/agent
@ 76
struct nlist;
+++ #include <stdint.h>
extern long long_return;
extern uint32_t ipaddr_return;
extern u_char return_buf[];
=============================================
./configure \ --prefix=/usr/local \ --with-openssl=/usr/local/ssl \ --with-default-snmp-version=3 \ --with-logfile="/var/log/snmpd.log" \ --with-transports="UDP TCP Unix TCPIPv6 UDPIPv6 Callback" \ --with-mib-modules="host disman/event-mib mibII/mta_sendmail" \ --with-persistent-directory=/var/db/ucd-snmp \ --disable-ipv6 \ --with-libwrap \ --with-defaults \ --with-perl-modules --enable-shared \ --enable-embedded-perl
configure reports success with:
---------------------------------------------------------
Net-SNMP configuration summary:
---------------------------------------------------------
Net-SNMP Version: 5.1.2.0.3
Building for: darwin7
Network transport support: UDP TCP Unix TCPIPv6 UDPIPv6 Callback
SNMPv3 Security Modules: usm
Agent MIB code: mibII ucd_snmp snmpv3mibs notification target
agent_mibs agentx utilities host disman/event-mib mibII/mta_sendmail
SNMP Perl modules: building -- embeddable
Embedded perl support: enabled
Authentication support: MD5 SHA1
Encryption support: DES AES128 AES192 AES256
---------------------------------------------------------
make still fails at:
/usr/ports/net-snmp-5.1.2.pre3> make
making all in /usr/ports/net-snmp-5.1.2.pre3/snmplib
making all in /usr/ports/net-snmp-5.1.2.pre3/agent
making all in /usr/ports/net-snmp-5.1.2.pre3/agent/helpers
making all in /usr/ports/net-snmp-5.1.2.pre3/agent/mibgroup
/bin/sh ../../libtool --mode=compile gcc -I../../include -I../../include -I. -I../..
-I. -I./../.. -I./../../snmplib -I./.. -I.. -I/usr/local/ssl/include -pipe -fno-
common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/
include -I/System/Library/Perl/5.8.4/darwin-thread-multi-2level/CORE -g
-O2 -Ddarwin7 -c -o mibII/udpTable.lo mibII/udpTable.c
rm -f mibII/.libs/udpTable.lo
gcc -I../../include -I../../include -I. -I../.. -I. -I./../.. -I./../../snmplib -I./.. -I..
-I/usr/local/ssl/include -pipe -fno-common -DPERL_DARWIN -no-cpp-
precomp -fno-strict-aliasing -I/usr/local/include -I/System/Library/Perl/5.8.4/
darwin-thread-multi-2level/CORE -g -O2 -Ddarwin7 -c mibII/udpTable.c
-fno-common -DPIC -o mibII/.libs/udpTable.lo
mibII/udpTable.c: In function `udpTable_next_entry':
mibII/udpTable.c:371: error: structure has no member named `inp_next'
mibII/udpTable.c: In function `udpTable_free':
mibII/udpTable.c:381: error: structure has no member named `inp_next'
mibII/udpTable.c: In function `udpTable_load':
mibII/udpTable.c:630: error: incompatible type for argument 2 of `memcpy'
mibII/udpTable.c:631: error: structure has no member named `next'
make[2]: *** [mibII/udpTable.lo] Error 1
make[1]: *** [subdirs] Error 1
make: *** [subdirs] Error 1
/usr/ports/net-snmp-5.1.2.pre3>
Logged In: YES
user_id=76242
I've applied the intent of the patch mentioned below. Let me know if it
helps with 5.1.2.rc1
Logged In: YES
user_id=564069
configure now completes successfully with:
./configure \ --prefix=/usr/local \ --enable-shared \ --with-libwrap \ --with-defaults \ --disable-ipv6 \ --with-default-snmp-version=3 \ --with-persistent-directory=/var/db/ucd-snmp \ --with-openssl=/usr/local/ssl \ --with-sys-contact=postmaster@presence-group.net \ --with-logfile="/var/log/snmpd.log" \ --with-transports="UDP TCP Unix TCPIPv6 UDPIPv6 Callback" \ --with-mib-modules="host disman/event-mib mibII/mta_sendmail" \ --with-perl-modules --enable-embedded-perl
---------------------------------------------------------
Net-SNMP configuration summary:
---------------------------------------------------------
SNMP Versions Supported: 1 2c 3
Net-SNMP Version: 5.2.dev
Building for: darwin7
Network transport support: UDP TCP Unix TCPIPv6 UDPIPv6 Callback
SNMPv3 Security Modules: usm
Agent MIB code: mibII ucd_snmp snmpv3mibs notification target
agent_mibs agentx utilities host disman/event-mib mibII/mta_sendmail
SNMP Perl modules: building -- embeddable
Embedded perl support: enabled
Authentication support: MD5 SHA1
Encryption support: DES AES
---------------------------------------------------------
but make failes subsequently with new errors ...
trying a reconfigure/remake 1st with the osx "--with-out-mib-
modules="mibII/tcpTable mibII/udpTable"" options
will file a reponse with new info ...
richard