Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

156 wiersze
5.6 KiB

Index: agent/auto_nlist.c
--- agent/auto_nlist.c.orig 2002-05-15 14:53:01 +0200
+++ agent/auto_nlist.c 2004-08-07 20:15:11 +0200
@@ -57,6 +57,7 @@
}
if (*ptr == 0) {
*ptr = (struct autonlist *) malloc(sizeof(struct autonlist));
+ memset(*ptr, 0, sizeof(struct autonlist));
it = *ptr;
it->left = 0;
it->right = 0;
Index: agent/mibgroup/mibII/tcp.c
--- agent/mibgroup/mibII/tcp.c.orig 2004-06-04 09:20:03 +0200
+++ agent/mibgroup/mibII/tcp.c 2004-08-07 20:16:20 +0200
@@ -68,7 +68,7 @@
* But only define it under FreeBSD, since it
* breaks other systems (notable AIX)
*/
-#if defined (freebsd4)
+#if defined (freebsd4) || defined (__NetBSD__)
int hz = 1000;
#endif
Index: agent/mibgroup/mibII/tcpTable.c
--- agent/mibgroup/mibII/tcpTable.c.orig 2004-07-21 08:26:18 +0200
+++ agent/mibgroup/mibII/tcpTable.c 2004-08-07 20:21:16 +0200
@@ -96,6 +96,11 @@
#define TCPTABLE_REMOTEPORT pcb.inp_fport
#define TCPTABLE_IS_LINKED_LIST
+#if defined(__FreeBSD__)
+#undef INP_NEXT_SYMBOL
+#define INP_NEXT_SYMBOL inp_next
+#endif
+
#endif /* linux */
#endif /* WIN32 */
#endif /* solaris2 */
@@ -736,12 +741,17 @@
nnew = SNMP_MALLOC_TYPEDEF(netsnmp_inpcb);
if (!nnew)
break;
+#if defined(__FreeBSD__)
+ memcpy(&(nnew->pcb), &(((struct xinpcb *) xig)->xi_inp),
+ sizeof(struct inpcb));
+#else
nnew->state = StateMap[((NS_ELEM *) xig)->xt_tp.t_state];
if (nnew->state == 5 /* established */ ||
nnew->state == 8 /* closeWait */ )
tcp_estab++;
memcpy(&(nnew->pcb), &(((NS_ELEM *) xig)->xt_inp),
sizeof(struct inpcb));
+#endif
nnew->inp_next = tcp_head;
tcp_head = nnew;
Index: agent/mibgroup/ucd-snmp/diskio.c
--- agent/mibgroup/ucd-snmp/diskio.c.orig 2004-06-29 13:57:08 +0200
+++ agent/mibgroup/ucd-snmp/diskio.c 2004-08-07 20:15:11 +0200
@@ -474,6 +474,20 @@
case DISKIO_DEVICE:
*var_len = strlen(stat->dinfo->devices[indx].device_name);
return (u_char *) stat->dinfo->devices[indx].device_name;
+#if defined(freebsd5) && (__FreeBSD_version >= 500107)
+ case DISKIO_NREAD:
+ long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_READ];
+ return (u_char *) & long_ret;
+ case DISKIO_NWRITTEN:
+ long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE];
+ return (u_char *) & long_ret;
+ case DISKIO_READS:
+ long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_READ];
+ return (u_char *) & long_ret;
+ case DISKIO_WRITES:
+ long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_WRITE];
+ return (u_char *) & long_ret;
+#else
case DISKIO_NREAD:
#if defined(freebsd5) && __FreeBSD_version >= 500107
long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_READ];
@@ -502,6 +516,7 @@
long_ret = (signed long) stat->dinfo->devices[indx].num_writes;
#endif
return (u_char *) & long_ret;
+#endif
default:
ERROR_MSG("diskio.c: don't know how to handle this request.");
Index: agent/mibgroup/ucd-snmp/memory_solaris2.c
--- agent/mibgroup/ucd-snmp/memory_solaris2.c.orig 2004-01-29 14:53:59 +0100
+++ agent/mibgroup/ucd-snmp/memory_solaris2.c 2004-08-07 20:15:11 +0200
@@ -1,3 +1,4 @@
+#undef _FILE_OFFSET_BITS /* swapctl doesn't support 64bit off_t */
#include <net-snmp/net-snmp-config.h> /* local SNMP configuration details */
#if HAVE_STRING_H
#include <string.h>
Index: agent/mibgroup/ucd-snmp/proc.c
--- agent/mibgroup/ucd-snmp/proc.c.orig 2004-02-17 06:40:43 +0100
+++ agent/mibgroup/ucd-snmp/proc.c 2004-08-07 20:15:11 +0200
@@ -1,3 +1,6 @@
+#ifdef solaris2
+#undef _FILE_OFFSET_BITS /* solaris procfs doesn't support 64bit off_t */
+#endif
#include <net-snmp/net-snmp-config.h>
#ifdef solaris2
Index: agent/mibgroup/util_funcs.c
--- agent/mibgroup/util_funcs.c.orig 2004-06-18 14:58:24 +0200
+++ agent/mibgroup/util_funcs.c 2004-08-07 20:15:20 +0200
@@ -391,6 +391,9 @@
int fd[2][2], i, cnt;
char ctmp[STRMAX], *cptr1, *cptr2, argvs[STRMAX], **argv,
**aptr;
+
+ *pid = -1; /* open_persist_pipe ignores return code but checks *pid */
+
/*
* Setup our pipes
*/
Index: include/net-snmp/library/system.h
--- include/net-snmp/library/system.h.orig 2003-11-30 23:31:42 +0100
+++ include/net-snmp/library/system.h 2004-08-07 20:15:20 +0200
@@ -114,7 +114,8 @@
char *strdup(const char *);
#endif
#ifndef HAVE_SETENV
- int setenv(const char *, const char *, int);
+ int __netsnmp_setenv(const char *, const char *, int);
+# define setenv(a,b,c) __netsnmp_setenv(a,b,c)
#endif
int calculate_time_diff(struct timeval *,
Index: include/net-snmp/system/freebsd.h
--- include/net-snmp/system/freebsd.h.orig 2004-03-05 02:11:29 +0100
+++ include/net-snmp/system/freebsd.h 2004-08-07 20:15:20 +0200
@@ -6,7 +6,7 @@
* udp_inpcb list symbol
*/
#undef INP_NEXT_SYMBOL
-#define INP_NEXT_SYMBOL inp_next
+#define INP_NEXT_SYMBOL inp_list.le_next
#undef TCP_TTL_SYMBOL
#define TCP_TTL_SYMBOL "ip_defttl"
Index: snmplib/system.c
--- snmplib/system.c.orig 2004-05-20 03:02:09 +0200
+++ snmplib/system.c 2004-08-07 20:15:20 +0200
@@ -866,7 +866,7 @@
#ifndef HAVE_SETENV
int
-setenv(const char *name, const char *value, int overwrite)
+__netsnmp_setenv(const char *name, const char *value, int overwrite)
{
char *cp;
int ret;