diff options
6 files changed, 178 insertions, 6 deletions
diff --git a/net-mgmt/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_diskio.c b/net-mgmt/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_diskio.c new file mode 100644 index 0000000..e41c703 --- /dev/null +++ b/net-mgmt/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_diskio.c @@ -0,0 +1,59 @@ +--- agent/mibgroup/ucd-snmp/diskio.c.orig Fri Mar 28 12:58:32 2003 ++++ agent/mibgroup/ucd-snmp/diskio.c Fri Mar 28 13:21:04 2003 +@@ -47,7 +47,11 @@ + #endif /* bsdi */ + + #if defined (freebsd4) || defined(freebsd5) ++#include <sys/param.h> ++#if __FreeBSD_version < 500101 + #include <sys/dkstat.h> ++#endif ++#include <sys/resource.h> + #include <devstat.h> + #endif /* freebsd */ + +@@ -318,7 +322,11 @@ + } + memset(stat->dinfo, 0, sizeof(struct devinfo)); + ++#if __FreeBSD_version > 500106 ++ if ((devstat_getdevs(NULL, stat)) == -1){ ++#else + if ((getdevs(stat)) == -1){ ++#endif + fprintf (stderr,"Can't get devices:%s\n", devstat_errbuf); + return 1; + } +@@ -370,16 +378,32 @@ + *var_len = strlen(stat->dinfo->devices[indx].device_name); + return (u_char *) stat->dinfo->devices[indx].device_name; + case DISKIO_NREAD: ++#if __FreeBSD_version > 500106 ++ long_ret = (signed long) stat->dinfo->devices[indx].bytes[DSM_TOTAL_BYTES_READ]; ++#else + long_ret = (signed long) stat->dinfo->devices[indx].bytes_read; ++#endif + return (u_char *) & long_ret; + case DISKIO_NWRITTEN: ++#if __FreeBSD_version > 500106 ++ long_ret = (signed long) stat->dinfo->devices[indx].bytes[DSM_TOTAL_BYTES_WRITE]; ++#else + long_ret = (signed long) stat->dinfo->devices[indx].bytes_written; ++#endif + return (u_char *) & long_ret; + case DISKIO_READS: ++#if __FreeBSD_version > 500106 ++ long_ret = (signed long) stat->dinfo->devices[indx].operations[DSM_TOTAL_TRANSFERS_READ]; ++#else + long_ret = (signed long) stat->dinfo->devices[indx].num_reads; ++#endif + return (u_char *) & long_ret; + case DISKIO_WRITES: ++#if __FreeBSD_version > 500106 ++ long_ret = (signed long) stat->dinfo->devices[indx].operations[DSM_TOTAL_TRANSFERS_WRITE]; ++#else + long_ret = (signed long) stat->dinfo->devices[indx].num_writes; ++#endif + return (u_char *) & long_ret; + + default: diff --git a/net-mgmt/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_vmstat_freebsd2.c b/net-mgmt/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_vmstat_freebsd2.c new file mode 100644 index 0000000..15b1b69 --- /dev/null +++ b/net-mgmt/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_vmstat_freebsd2.c @@ -0,0 +1,17 @@ +--- agent/mibgroup/ucd-snmp/vmstat_freebsd2.c.orig Fri Mar 28 13:15:48 2003 ++++ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c Fri Mar 28 13:16:31 2003 +@@ -8,11 +8,14 @@ + #include <sys/param.h> + #include <sys/time.h> + #include <sys/proc.h> ++#if __FreeBSD_version < 500101 + #include <sys/dkstat.h> ++#endif + #ifdef freebsd5 + #include <sys/bio.h> + #endif + #include <sys/buf.h> ++#include <sys/resource.h> + #include <sys/uio.h> + #include <sys/namei.h> + #include <sys/malloc.h> diff --git a/net-mgmt/net-snmp4/files/patch-memory_freebsd2.c b/net-mgmt/net-snmp4/files/patch-memory_freebsd2.c index e06a326..e49eb0d 100644 --- a/net-mgmt/net-snmp4/files/patch-memory_freebsd2.c +++ b/net-mgmt/net-snmp4/files/patch-memory_freebsd2.c @@ -1,6 +1,16 @@ ---- agent/mibgroup/ucd-snmp/memory_freebsd2.c.orig Mon Sep 17 06:16:16 2001 -+++ agent/mibgroup/ucd-snmp/memory_freebsd2.c Mon Mar 4 10:00:56 2002 -@@ -232,7 +232,7 @@ +--- agent/mibgroup/ucd-snmp/memory_freebsd2.c.orig Sun Sep 16 17:16:16 2001 ++++ agent/mibgroup/ucd-snmp/memory_freebsd2.c Fri Mar 28 13:18:19 2003 +@@ -9,7 +9,9 @@ + #include <sys/param.h> + #include <sys/time.h> + #include <sys/proc.h> ++#if __FreeBSD_version < 500101 + #include <sys/dkstat.h> ++#endif + #ifdef freebsd5 + #include <sys/bio.h> + #endif +@@ -232,7 +234,7 @@ size_t total_size = sizeof (total); int total_mib[] = { CTL_VM, VM_METER }; diff --git a/net/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_diskio.c b/net/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_diskio.c new file mode 100644 index 0000000..e41c703 --- /dev/null +++ b/net/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_diskio.c @@ -0,0 +1,59 @@ +--- agent/mibgroup/ucd-snmp/diskio.c.orig Fri Mar 28 12:58:32 2003 ++++ agent/mibgroup/ucd-snmp/diskio.c Fri Mar 28 13:21:04 2003 +@@ -47,7 +47,11 @@ + #endif /* bsdi */ + + #if defined (freebsd4) || defined(freebsd5) ++#include <sys/param.h> ++#if __FreeBSD_version < 500101 + #include <sys/dkstat.h> ++#endif ++#include <sys/resource.h> + #include <devstat.h> + #endif /* freebsd */ + +@@ -318,7 +322,11 @@ + } + memset(stat->dinfo, 0, sizeof(struct devinfo)); + ++#if __FreeBSD_version > 500106 ++ if ((devstat_getdevs(NULL, stat)) == -1){ ++#else + if ((getdevs(stat)) == -1){ ++#endif + fprintf (stderr,"Can't get devices:%s\n", devstat_errbuf); + return 1; + } +@@ -370,16 +378,32 @@ + *var_len = strlen(stat->dinfo->devices[indx].device_name); + return (u_char *) stat->dinfo->devices[indx].device_name; + case DISKIO_NREAD: ++#if __FreeBSD_version > 500106 ++ long_ret = (signed long) stat->dinfo->devices[indx].bytes[DSM_TOTAL_BYTES_READ]; ++#else + long_ret = (signed long) stat->dinfo->devices[indx].bytes_read; ++#endif + return (u_char *) & long_ret; + case DISKIO_NWRITTEN: ++#if __FreeBSD_version > 500106 ++ long_ret = (signed long) stat->dinfo->devices[indx].bytes[DSM_TOTAL_BYTES_WRITE]; ++#else + long_ret = (signed long) stat->dinfo->devices[indx].bytes_written; ++#endif + return (u_char *) & long_ret; + case DISKIO_READS: ++#if __FreeBSD_version > 500106 ++ long_ret = (signed long) stat->dinfo->devices[indx].operations[DSM_TOTAL_TRANSFERS_READ]; ++#else + long_ret = (signed long) stat->dinfo->devices[indx].num_reads; ++#endif + return (u_char *) & long_ret; + case DISKIO_WRITES: ++#if __FreeBSD_version > 500106 ++ long_ret = (signed long) stat->dinfo->devices[indx].operations[DSM_TOTAL_TRANSFERS_WRITE]; ++#else + long_ret = (signed long) stat->dinfo->devices[indx].num_writes; ++#endif + return (u_char *) & long_ret; + + default: diff --git a/net/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_vmstat_freebsd2.c b/net/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_vmstat_freebsd2.c new file mode 100644 index 0000000..15b1b69 --- /dev/null +++ b/net/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_vmstat_freebsd2.c @@ -0,0 +1,17 @@ +--- agent/mibgroup/ucd-snmp/vmstat_freebsd2.c.orig Fri Mar 28 13:15:48 2003 ++++ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c Fri Mar 28 13:16:31 2003 +@@ -8,11 +8,14 @@ + #include <sys/param.h> + #include <sys/time.h> + #include <sys/proc.h> ++#if __FreeBSD_version < 500101 + #include <sys/dkstat.h> ++#endif + #ifdef freebsd5 + #include <sys/bio.h> + #endif + #include <sys/buf.h> ++#include <sys/resource.h> + #include <sys/uio.h> + #include <sys/namei.h> + #include <sys/malloc.h> diff --git a/net/net-snmp4/files/patch-memory_freebsd2.c b/net/net-snmp4/files/patch-memory_freebsd2.c index e06a326..e49eb0d 100644 --- a/net/net-snmp4/files/patch-memory_freebsd2.c +++ b/net/net-snmp4/files/patch-memory_freebsd2.c @@ -1,6 +1,16 @@ ---- agent/mibgroup/ucd-snmp/memory_freebsd2.c.orig Mon Sep 17 06:16:16 2001 -+++ agent/mibgroup/ucd-snmp/memory_freebsd2.c Mon Mar 4 10:00:56 2002 -@@ -232,7 +232,7 @@ +--- agent/mibgroup/ucd-snmp/memory_freebsd2.c.orig Sun Sep 16 17:16:16 2001 ++++ agent/mibgroup/ucd-snmp/memory_freebsd2.c Fri Mar 28 13:18:19 2003 +@@ -9,7 +9,9 @@ + #include <sys/param.h> + #include <sys/time.h> + #include <sys/proc.h> ++#if __FreeBSD_version < 500101 + #include <sys/dkstat.h> ++#endif + #ifdef freebsd5 + #include <sys/bio.h> + #endif +@@ -232,7 +234,7 @@ size_t total_size = sizeof (total); int total_mib[] = { CTL_VM, VM_METER }; |