diff -Nurd net-snmp-5.6.1/agent/mibgroup/agentx/master_admin.c net-snmp-5.6.1-new/agent/mibgroup/agentx/master_admin.c --- net-snmp-5.6.1/agent/mibgroup/agentx/master_admin.c 2010-01-24 06:41:03.000000000 -0500 +++ net-snmp-5.6.1-new/agent/mibgroup/agentx/master_admin.c 2011-05-25 17:55:07.000000000 -0400 @@ -58,7 +58,7 @@ open_agentx_session(netsnmp_session * session, netsnmp_pdu *pdu) { netsnmp_session *sp; - struct timeval now; + struct timeval now; DEBUGMSGTL(("agentx/master", "open %8p\n", session)); sp = (netsnmp_session *) malloc(sizeof(netsnmp_session)); @@ -99,7 +99,7 @@ sp->securityAuthProtoLen = pdu->variables->name_length; sp->securityName = strdup((char *) pdu->variables->val.string); gettimeofday(&now, NULL); - sp->engineTime = calculate_sectime_diff(&now, netsnmp_get_agent_starttime()); + sp->engineTime = calculate_sectime_diff(&now, (const struct timeval*)netsnmp_get_agent_starttime()); sp->subsession = session; /* link back to head */ sp->flags |= SNMP_FLAGS_SUBSESSION; diff -Nurd net-snmp-5.6.1/agent/mibgroup/hardware/memory/memory_darwin.c net-snmp-5.6.1-new/agent/mibgroup/hardware/memory/memory_darwin.c --- net-snmp-5.6.1/agent/mibgroup/hardware/memory/memory_darwin.c 2007-06-18 17:12:35.000000000 -0400 +++ net-snmp-5.6.1-new/agent/mibgroup/hardware/memory/memory_darwin.c 2011-05-25 16:43:27.000000000 -0400 @@ -5,10 +5,20 @@ #include #include +#include +#include #include +#include +#include +#include #include #include +#ifdef HAVE_VM_REGION_64 +#define VM_REGION_FUNC vm_region_64 +#else +#define VM_REGION_FUNC vm_region +#endif /* * Retained from UCD implementation @@ -75,7 +85,7 @@ for (address = 0;; address += size) { /* Get memory region. */ count = VM_REGION_EXTENDED_INFO_COUNT; - if (vm_region(tasks[j], &address, &size, VM_REGION_EXTENDED_INFO, (vm_region_extended_info_t)&info, &count, &object_name) != KERN_SUCCESS) { + if (VM_REGION_FUNC(tasks[j], &address, &size, VM_REGION_EXTENDED_INFO, (int*)&info, &count, &object_name) != KERN_SUCCESS) { /* No more memory regions. */ break; } diff -Nurd net-snmp-5.6.1/agent/mibgroup/host/hr_swrun.c net-snmp-5.6.1-new/agent/mibgroup/host/hr_swrun.c --- net-snmp-5.6.1/agent/mibgroup/host/hr_swrun.c 2010-07-29 10:58:47.000000000 -0400 +++ net-snmp-5.6.1-new/agent/mibgroup/host/hr_swrun.c 2011-05-24 17:34:07.000000000 -0400 @@ -39,9 +39,6 @@ #if HAVE_SYS_PROC_H #include #endif -#if HAVE_KVM_H -#include -#endif #if HAVE_SYS_SYSCTL_H #include #endif diff -Nurd net-snmp-5.6.1/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c net-snmp-5.6.1-new/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c --- net-snmp-5.6.1/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c 2006-09-14 13:15:32.000000000 -0400 +++ net-snmp-5.6.1-new/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c 2011-05-25 15:14:01.000000000 -0400 @@ -127,7 +127,7 @@ /* * do we have a corresponding row? */ - ip4if_rrc = CONTAINER_FIND(c, ift_rrc); + ip4if_rrc = (ifTable_rowreq_ctx*)CONTAINER_FIND(c, ift_rrc); if (NULL == ip4if_rrc) { /* * no corresponding row. should we have one? diff -Nurd net-snmp-5.6.1/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c net-snmp-5.6.1-new/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c --- net-snmp-5.6.1/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c 2010-10-27 14:35:26.000000000 -0400 +++ net-snmp-5.6.1-new/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c 2011-05-25 15:04:11.000000000 -0400 @@ -489,7 +489,7 @@ { int rc = SNMP_ERR_NOERROR; ipv4InterfaceTable_rowreq_ctx *rowreq_ctx = - netsnmp_container_table_row_extract(requests); + (ipv4InterfaceTable_rowreq_ctx*)netsnmp_container_table_row_extract(requests); DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_object_lookup", "called\n")); @@ -580,7 +580,7 @@ netsnmp_request_info *requests) { ipv4InterfaceTable_rowreq_ctx *rowreq_ctx = - netsnmp_container_table_row_extract(requests); + (ipv4InterfaceTable_rowreq_ctx*)netsnmp_container_table_row_extract(requests); netsnmp_table_request_info *tri; u_char *old_string; void (*dataFreeHook) (void *); @@ -745,7 +745,7 @@ netsnmp_request_info *requests) { ipv4InterfaceTable_rowreq_ctx *rowreq_ctx = - netsnmp_container_table_row_extract(requests); + (ipv4InterfaceTable_rowreq_ctx*)netsnmp_container_table_row_extract(requests); netsnmp_table_request_info *tri; int rc; @@ -829,7 +829,7 @@ { int rc; ipv4InterfaceTable_rowreq_ctx *rowreq_ctx = - netsnmp_container_table_row_extract(requests); + (ipv4InterfaceTable_rowreq_ctx*)netsnmp_container_table_row_extract(requests); DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_undo_setup", "called\n")); @@ -891,7 +891,7 @@ netsnmp_request_info *requests) { ipv4InterfaceTable_rowreq_ctx *rowreq_ctx = - netsnmp_container_table_row_extract(requests); + (ipv4InterfaceTable_rowreq_ctx*)netsnmp_container_table_row_extract(requests); int rc; DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_undo_cleanup", "called\n")); @@ -971,7 +971,7 @@ netsnmp_request_info *requests) { ipv4InterfaceTable_rowreq_ctx *rowreq_ctx = - netsnmp_container_table_row_extract(requests); + (ipv4InterfaceTable_rowreq_ctx*)netsnmp_container_table_row_extract(requests); netsnmp_table_request_info *tri; int rc = SNMP_ERR_NOERROR; @@ -1019,7 +1019,7 @@ { int rc; ipv4InterfaceTable_rowreq_ctx *rowreq_ctx = - netsnmp_container_table_row_extract(requests); + (ipv4InterfaceTable_rowreq_ctx*)netsnmp_container_table_row_extract(requests); DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_commit", "called\n")); @@ -1053,7 +1053,7 @@ { int rc; ipv4InterfaceTable_rowreq_ctx *rowreq_ctx = - netsnmp_container_table_row_extract(requests); + (ipv4InterfaceTable_rowreq_ctx*)netsnmp_container_table_row_extract(requests); DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_undo_commit", "called\n")); @@ -1132,7 +1132,7 @@ { int rc; ipv4InterfaceTable_rowreq_ctx *rowreq_ctx = - netsnmp_container_table_row_extract(requests); + (ipv4InterfaceTable_rowreq_ctx*)netsnmp_container_table_row_extract(requests); netsnmp_table_request_info *tri; DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_undo_values", "called\n")); @@ -1187,7 +1187,7 @@ netsnmp_request_info *requests) { ipv4InterfaceTable_rowreq_ctx *rowreq_ctx = - netsnmp_container_table_row_extract(requests); + (ipv4InterfaceTable_rowreq_ctx*)netsnmp_container_table_row_extract(requests); DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_irreversible:commit", "called\n")); @@ -1303,7 +1303,7 @@ return NULL; rowreq_ctx = - CONTAINER_FIND(ipv4InterfaceTable_if_ctx.container, &oid_idx); + (ipv4InterfaceTable_rowreq_ctx*)CONTAINER_FIND(ipv4InterfaceTable_if_ctx.container, &oid_idx); return rowreq_ctx; } diff -Nurd net-snmp-5.6.1/agent/mibgroup/mibII/at.c net-snmp-5.6.1-new/agent/mibgroup/mibII/at.c --- net-snmp-5.6.1/agent/mibgroup/mibII/at.c 2010-10-28 13:43:00.000000000 -0400 +++ net-snmp-5.6.1-new/agent/mibgroup/mibII/at.c 2011-05-25 15:22:49.000000000 -0400 @@ -696,7 +696,7 @@ if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) snmp_log_perror("route-sysctl-estimate"); else { - if ((at = malloc(needed ? needed : 1)) == NULL) + if ((at = (char*)malloc(needed ? needed : 1)) == NULL) snmp_log_perror("malloc"); else { if (sysctl(mib, 6, at, &needed, NULL, 0) < 0) diff -Nurd net-snmp-5.6.1/agent/mibgroup/mibII/ipAddr.c net-snmp-5.6.1-new/agent/mibgroup/mibII/ipAddr.c --- net-snmp-5.6.1/agent/mibgroup/mibII/ipAddr.c 2010-01-23 10:07:35.000000000 -0500 +++ net-snmp-5.6.1-new/agent/mibgroup/mibII/ipAddr.c 2011-05-25 18:16:15.000000000 -0400 @@ -774,7 +774,7 @@ if (sysctl(mib, 6, 0, &len, 0, 0) < 0) return; - ifbuf = malloc(len); + ifbuf = (char*)malloc(len); if (ifbuf == 0) return; if (sysctl(mib, 6, ifbuf, &len, 0, 0) < 0) { diff -Nurd net-snmp-5.6.1/agent/mibgroup/mibII/tcpTable.c net-snmp-5.6.1-new/agent/mibgroup/mibII/tcpTable.c --- net-snmp-5.6.1/agent/mibgroup/mibII/tcpTable.c 2010-10-20 09:12:08.000000000 -0400 +++ net-snmp-5.6.1-new/agent/mibgroup/mibII/tcpTable.c 2011-05-25 16:06:37.000000000 -0400 @@ -849,7 +849,7 @@ */ len = 0; if (sysctl(sname, 4, 0, &len, 0, 0) < 0 || - (tcpcb_buf = malloc(len)) == NULL) + (tcpcb_buf = (char*)malloc(len)) == NULL) return -1; if (sysctl(sname, 4, tcpcb_buf, &len, 0, 0) < 0) { free(tcpcb_buf); diff -Nurd net-snmp-5.6.1/agent/mibgroup/mibII/udpTable.c net-snmp-5.6.1-new/agent/mibgroup/mibII/udpTable.c --- net-snmp-5.6.1/agent/mibgroup/mibII/udpTable.c 2010-03-08 18:07:20.000000000 -0500 +++ net-snmp-5.6.1-new/agent/mibgroup/mibII/udpTable.c 2011-05-25 16:15:51.000000000 -0400 @@ -628,7 +628,7 @@ */ len = 0; if (sysctl(sname, 4, 0, &len, 0, 0) < 0 || - (udpcb_buf = malloc(len)) == NULL) + (udpcb_buf = (char*)malloc(len)) == NULL) return -1; if (sysctl(sname, 4, udpcb_buf, &len, 0, 0) < 0) { free(udpcb_buf); diff -Nurd net-snmp-5.6.1/agent/mibgroup/mibII/var_route.c net-snmp-5.6.1-new/agent/mibgroup/mibII/var_route.c --- net-snmp-5.6.1/agent/mibgroup/mibII/var_route.c 2010-06-22 04:37:26.000000000 -0400 +++ net-snmp-5.6.1-new/agent/mibgroup/mibII/var_route.c 2011-05-25 19:11:46.000000000 -0400 @@ -1786,7 +1786,7 @@ if (len > rtbuflen) { char *newbuf; - newbuf = realloc(rtbuf, len); + newbuf = (char*)realloc(rtbuf, len); if (newbuf == 0) return -1; rtbuf = newbuf; diff -Nurd net-snmp-5.6.1/agent/mibgroup/ucd-snmp/dlmod.c net-snmp-5.6.1-new/agent/mibgroup/ucd-snmp/dlmod.c --- net-snmp-5.6.1/agent/mibgroup/ucd-snmp/dlmod.c 2010-06-16 17:34:42.000000000 -0400 +++ net-snmp-5.6.1-new/agent/mibgroup/ucd-snmp/dlmod.c 2011-05-25 15:35:03.000000000 -0400 @@ -182,7 +182,7 @@ return; } snprintf(sym_init, sizeof(sym_init), "init_%s", dlm->name); - dl_init = dlsym(dlm->handle, sym_init); + dl_init = (int (*)())dlsym(dlm->handle, sym_init); if (dl_init == NULL) { dlclose(dlm->handle); snprintf(dlm->error, sizeof(dlm->error), @@ -206,13 +206,13 @@ return; snprintf(sym_deinit, sizeof(sym_deinit), "deinit_%s", dlm->name); - dl_deinit = dlsym(dlm->handle, sym_deinit); + dl_deinit = (int (*)())dlsym(dlm->handle, sym_deinit); if (dl_deinit) { DEBUGMSGTL(("dlmod", "Calling deinit_%s()\n", dlm->name)); dl_deinit(); } else { snprintf(sym_deinit, sizeof(sym_deinit), "shutdown_%s", dlm->name); - dl_deinit = dlsym(dlm->handle, sym_deinit); + dl_deinit = (int (*)())dlsym(dlm->handle, sym_deinit); if (dl_deinit) { DEBUGMSGTL(("dlmod", "Calling shutdown_%s()\n", dlm->name)); dl_deinit(); diff -Nurd net-snmp-5.6.1/agent/mibgroup/ucd-snmp/memory_darwin7.c net-snmp-5.6.1-new/agent/mibgroup/ucd-snmp/memory_darwin7.c --- net-snmp-5.6.1/agent/mibgroup/ucd-snmp/memory_darwin7.c 2008-10-21 17:10:43.000000000 -0400 +++ net-snmp-5.6.1-new/agent/mibgroup/ucd-snmp/memory_darwin7.c 2011-05-24 17:34:07.000000000 -0400 @@ -48,6 +48,12 @@ #include "memory.h" #include "memory_darwin7.h" +#ifdef HAVE_VM_REGION_64 +#define VM_REGION_FUNC vm_region_64 +#else +#define VM_REGION_FUNC vm_region +#endif + /* * * Swap info * */ @@ -387,7 +393,7 @@ for (address = 0;; address += size) { /* Get memory region. */ count = VM_REGION_EXTENDED_INFO_COUNT; - if (vm_region(tasks[j], &address, &size, VM_REGION_EXTENDED_INFO, (vm_region_extended_info_t)&info, &count, &object_name) != KERN_SUCCESS) { + if (VM_REGION_FUNC(tasks[j], &address, &size, VM_REGION_EXTENDED_INFO, (vm_region_extended_info_t)&info, &count, &object_name) != KERN_SUCCESS) { /* No more memory regions. */ break; } diff -Nurd net-snmp-5.6.1/agent/mibgroup/utilities/iquery.c net-snmp-5.6.1-new/agent/mibgroup/utilities/iquery.c --- net-snmp-5.6.1/agent/mibgroup/utilities/iquery.c 2010-01-06 03:00:28.000000000 -0500 +++ net-snmp-5.6.1-new/agent/mibgroup/utilities/iquery.c 2011-05-25 14:34:48.000000000 -0400 @@ -184,7 +184,7 @@ memdup( &(ss->community), secName, strlen(secName)); ss->community_len = strlen(secName); } - ss->myvoid = netsnmp_check_outstanding_agent_requests; + ss->myvoid = (void*)netsnmp_check_outstanding_agent_requests; ss->flags |= SNMP_FLAGS_RESP_CALLBACK | SNMP_FLAGS_DONT_PROBE; } #endif diff -Nurd net-snmp-5.6.1/configure.d/config_os_functions net-snmp-5.6.1-new/configure.d/config_os_functions --- net-snmp-5.6.1/configure.d/config_os_functions 2010-12-06 17:08:12.000000000 -0500 +++ net-snmp-5.6.1-new/configure.d/config_os_functions 2011-05-24 17:34:07.000000000 -0400 @@ -95,7 +95,8 @@ [sigprocmask ] dnl [statfs statvfs stime ] dnl [strncasecmp system ] dnl - [uname usleep ] ) + [uname usleep ] dnl + [vm_region vm_region_64 ] ) # Apps: AC_CHECK_FUNCS([getdtablesize ] dnl diff -Nurd net-snmp-5.6.1/configure.d/config_os_progs net-snmp-5.6.1-new/configure.d/config_os_progs --- net-snmp-5.6.1/configure.d/config_os_progs 2010-11-16 03:01:46.000000000 -0500 +++ net-snmp-5.6.1-new/configure.d/config_os_progs 2011-05-25 19:17:34.000000000 -0400 @@ -207,6 +207,7 @@ ;; esac +LD_NO_UNDEFINED=-no-undefined AC_SUBST(LD_NO_UNDEFINED) @@ -404,12 +405,7 @@ # Flat Namespace linking (Mac OS/X) # AC_MSG_CHECKING([whether darwin ld might need -flat_namespace]) - if test -z "$MACOSX_DEPLOYMENT_TARGET"; then - LDFLAGS="-flat_namespace $LDFLAGS" - AC_MSG_RESULT([yes]) - else AC_MSG_RESULT([no]) - fi ;; *) diff -Nurd net-snmp-5.6.1/configure.d/config_project_perl_python net-snmp-5.6.1-new/configure.d/config_project_perl_python --- net-snmp-5.6.1/configure.d/config_project_perl_python 2010-07-29 11:47:40.000000000 -0400 +++ net-snmp-5.6.1-new/configure.d/config_project_perl_python 2011-05-24 17:34:07.000000000 -0400 @@ -87,7 +87,7 @@ if test "xenable_perl_cc_checks" != "xno" ; then AC_MSG_CHECKING([for Perl cc]) changequote(, ) - PERLCC=`$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\/]+).;\s*/$1/);'` + PERLCC=`$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\.\/]+).;\s*/$1/);'` changequote([, ]) if test "x$PERLCC" != "x" ; then AC_MSG_RESULT([$PERLCC]) @@ -192,7 +192,7 @@ # if test "x$embed_perl" != "xno" ; then AC_MSG_CHECKING([for Perl CFLAGS]) - perlcflags=`$myperl -MExtUtils::Embed -e ccopts` + perlcflags=`$myperl -MExtUtils::Embed -e ccopts | /usr/bin/sed -e 's,-arch [^ ]*,,g'` if test "x$perlcflags" != "x" ; then AC_MSG_RESULT([$perlcflags]) CFLAGS="$CFLAGS $perlcflags" @@ -209,7 +209,7 @@ # if test "x$embed_perl" != "xno" ; then AC_MSG_CHECKING([for Perl LDFLAGS]) - netsnmp_perlldopts=`$myperl -MExtUtils::Embed -e ldopts` + netsnmp_perlldopts=`$myperl -MExtUtils::Embed -e ldopts | /usr/bin/sed -e 's,-arch [^ ]*,,g'` if test "x$netsnmp_perlldopts" != "x" ; then AC_MSG_RESULT([$netsnmp_perlldopts]) else @@ -228,7 +228,7 @@ # AC_MSG_CHECKING([for Perl CCDLFLAGS]) changequote(, ) - netsnmp_perlccdlflags=`$myperl -V:ccdlflags | $myperl -n -e 'print $1 '"if (/^\s*ccdlflags='([^']+)';/);"` + netsnmp_perlccdlflags=`$myperl -V:ccdlflags | /usr/bin/sed -e 's,-arch [^ ]*,,g'` changequote([, ]) AC_MSG_RESULT([$netsnmp_perlccdlflags]) PERLLDOPTS_FOR_APPS="$netsnmp_perlccdlflags" diff -Nurd net-snmp-5.6.1/net-snmp-config.in net-snmp-5.6.1-new/net-snmp-config.in --- net-snmp-5.6.1/net-snmp-config.in 2010-10-13 05:58:34.000000000 -0400 +++ net-snmp-5.6.1-new/net-snmp-config.in 2011-05-24 17:34:07.000000000 -0400 @@ -57,7 +57,7 @@ NSC_SRCDIR=@srcdir@ NSC_INCDIR=${NSC_PREFIX}/include NSC_BASE_SUBAGENT_LIBS="-lnetsnmpagent -lnetsnmp" -NSC_BASE_AGENT_LIBS="-lnetsnmpagent -lnetsnmpmibs -lnetsnmp" +NSC_BASE_AGENT_LIBS="-lnetsnmpagent -lnetsnmpmibs -lnetsnmp -lnetsnmphelpers" NSC_SRC_LIBDIRS="agent/.libs snmplib/.libs" NSC_SRC_LIBDEPS="agent/.libs/libnetsnmpmibs.a agent/.libs/libnetsnmpagent.a snmplib/.libs/libnetsnmp.a" diff -Nurd net-snmp-5.6.1/snmplib/md5.c net-snmp-5.6.1-new/snmplib/md5.c --- net-snmp-5.6.1/snmplib/md5.c 2010-05-27 11:15:43.000000000 -0400 +++ net-snmp-5.6.1-new/snmplib/md5.c 2011-05-25 15:05:30.000000000 -0400 @@ -195,7 +195,7 @@ { register unsigned int tmp, A, B, C, D; /* hpux sysv sun */ #ifdef WORDS_BIGENDIAN - MDreverse(X); + MDreverse((unsigned int*)X); #endif A = MDp->buffer[0]; B = MDp->buffer[1]; @@ -275,7 +275,7 @@ MDp->buffer[2] += C; MDp->buffer[3] += D; #ifdef WORDS_BIGENDIAN - MDreverse(X); + MDreverse((unsigned int*)X); #endif } diff -Nurd net-snmp-5.6.1/snmplib/system.c net-snmp-5.6.1-new/snmplib/system.c --- net-snmp-5.6.1/snmplib/system.c 2010-07-29 10:58:47.000000000 -0400 +++ net-snmp-5.6.1-new/snmplib/system.c 2011-05-24 17:34:27.000000000 -0400 @@ -149,6 +149,7 @@ #if defined(darwin9) #include /* for _NSGetArgv() */ +#include /* for _NSGetExecutablePath() */ #endif #if HAVE_PWD_H