aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt
diff options
context:
space:
mode:
authorkuriyama <kuriyama@FreeBSD.org>2008-05-27 10:08:01 +0800
committerkuriyama <kuriyama@FreeBSD.org>2008-05-27 10:08:01 +0800
commit98876cccb7919762a1ec30ea7f42c0bfbffdeac5 (patch)
treeeb4d4c449a5166f5792283f7a89e54949c6c50f9 /net-mgmt
parentb47e6423076c3ddf8814b531e06acabc3c64542a (diff)
downloadfreebsd-ports-gnome-98876cccb7919762a1ec30ea7f42c0bfbffdeac5.tar.gz
freebsd-ports-gnome-98876cccb7919762a1ec30ea7f42c0bfbffdeac5.tar.zst
freebsd-ports-gnome-98876cccb7919762a1ec30ea7f42c0bfbffdeac5.zip
o Resurrect UCD-SNMP-MIB::memBuffer MIB [1].
o Add WITH_MFD_REWRITES knob [2] PR: ports/123073 [1] Submitted by: valerio.daelli@gmail.com [1], "Chris" <chris@chrysalisnet.org> via email [2]
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/net-snmp-devel/Makefile8
-rw-r--r--net-mgmt/net-snmp-devel/files/patch-memory_freebsd.c39
-rw-r--r--net-mgmt/net-snmp/Makefile8
-rw-r--r--net-mgmt/net-snmp/files/patch-memory_freebsd.c39
4 files changed, 92 insertions, 2 deletions
diff --git a/net-mgmt/net-snmp-devel/Makefile b/net-mgmt/net-snmp-devel/Makefile
index 36df177ccd4c..811a72845f89 100644
--- a/net-mgmt/net-snmp-devel/Makefile
+++ b/net-mgmt/net-snmp-devel/Makefile
@@ -7,7 +7,7 @@
PORTNAME= snmp
PORTVERSION= 5.4.1
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= net-mgmt ipv6
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= net-snmp
@@ -94,6 +94,12 @@ NET_SNMP_PERSISTENTDIR?=/var/net-snmp
NET_SNMP_MIB_MODULES?= ${NET_SNMP_MIB_MODULE_LIST}
NET_SNMP_MIB_MODULE_LIST=host disman/event-mib smux mibII/mta_sendmail mibII/tcpTable ucd-snmp/diskio
+
+.if defined(WITH_MFD_REWRITES)
+CONFIGURE_ARGS+=--enable-mfd-rewrites
+NET_SNMP_MIB_MODULE_LIST+= if-mib
+.endif
+
_NET_SNMP_MIB_MODULES=
.for module1 in ${NET_SNMP_MIB_MODULE_LIST}
_module1=${module1}
diff --git a/net-mgmt/net-snmp-devel/files/patch-memory_freebsd.c b/net-mgmt/net-snmp-devel/files/patch-memory_freebsd.c
new file mode 100644
index 000000000000..69e3f6617257
--- /dev/null
+++ b/net-mgmt/net-snmp-devel/files/patch-memory_freebsd.c
@@ -0,0 +1,39 @@
+--- agent/mibgroup/hardware/memory/memory_freebsd.c.orig 2006-03-06 17:23:52.000000000 +0100
++++ agent/mibgroup/hardware/memory/memory_freebsd.c 2008-04-14 16:45:19.000000000 +0200
+@@ -47,6 +47,9 @@
+ int phys_mem_mib[] = { CTL_HW, HW_PHYSMEM };
+ int user_mem_mib[] = { CTL_HW, HW_USERMEM };
+
++ long bufspace;
++
++
+ /*
+ * Retrieve the memory information from the underlying O/S...
+ */
+@@ -54,6 +57,7 @@
+ sysctl(phys_mem_mib, 2, &phys_mem, &mem_size, NULL, 0);
+ sysctl(user_mem_mib, 2, &user_mem, &mem_size, NULL, 0);
+ auto_nlist(SUM_SYMBOL, (char *) &vmem, sizeof(vmem));
++ auto_nlist(BUFSPACE_SYMBOL, (char *) &bufspace, sizeof(bufspace));
+ #ifndef freebsd4
+ pagesize = 1024;
+ #else
+@@ -129,6 +133,18 @@
+ mem->free = -1;
+ }
+
++ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_MBUF, 1 );
++ if (!mem) {
++ snmp_log_perror("No Memory Buffer info entry");
++ } else {
++ if (!mem->descr)
++ mem->descr = strdup("Memory Buffer");
++ mem->units = pagesize;
++ mem->size = bufspace/pagesize;
++ mem->free = -1;
++ }
++
++
+ nswap = swapmode(pagesize);
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 1 );
+ if (!mem) {
diff --git a/net-mgmt/net-snmp/Makefile b/net-mgmt/net-snmp/Makefile
index 36df177ccd4c..811a72845f89 100644
--- a/net-mgmt/net-snmp/Makefile
+++ b/net-mgmt/net-snmp/Makefile
@@ -7,7 +7,7 @@
PORTNAME= snmp
PORTVERSION= 5.4.1
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= net-mgmt ipv6
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= net-snmp
@@ -94,6 +94,12 @@ NET_SNMP_PERSISTENTDIR?=/var/net-snmp
NET_SNMP_MIB_MODULES?= ${NET_SNMP_MIB_MODULE_LIST}
NET_SNMP_MIB_MODULE_LIST=host disman/event-mib smux mibII/mta_sendmail mibII/tcpTable ucd-snmp/diskio
+
+.if defined(WITH_MFD_REWRITES)
+CONFIGURE_ARGS+=--enable-mfd-rewrites
+NET_SNMP_MIB_MODULE_LIST+= if-mib
+.endif
+
_NET_SNMP_MIB_MODULES=
.for module1 in ${NET_SNMP_MIB_MODULE_LIST}
_module1=${module1}
diff --git a/net-mgmt/net-snmp/files/patch-memory_freebsd.c b/net-mgmt/net-snmp/files/patch-memory_freebsd.c
new file mode 100644
index 000000000000..69e3f6617257
--- /dev/null
+++ b/net-mgmt/net-snmp/files/patch-memory_freebsd.c
@@ -0,0 +1,39 @@
+--- agent/mibgroup/hardware/memory/memory_freebsd.c.orig 2006-03-06 17:23:52.000000000 +0100
++++ agent/mibgroup/hardware/memory/memory_freebsd.c 2008-04-14 16:45:19.000000000 +0200
+@@ -47,6 +47,9 @@
+ int phys_mem_mib[] = { CTL_HW, HW_PHYSMEM };
+ int user_mem_mib[] = { CTL_HW, HW_USERMEM };
+
++ long bufspace;
++
++
+ /*
+ * Retrieve the memory information from the underlying O/S...
+ */
+@@ -54,6 +57,7 @@
+ sysctl(phys_mem_mib, 2, &phys_mem, &mem_size, NULL, 0);
+ sysctl(user_mem_mib, 2, &user_mem, &mem_size, NULL, 0);
+ auto_nlist(SUM_SYMBOL, (char *) &vmem, sizeof(vmem));
++ auto_nlist(BUFSPACE_SYMBOL, (char *) &bufspace, sizeof(bufspace));
+ #ifndef freebsd4
+ pagesize = 1024;
+ #else
+@@ -129,6 +133,18 @@
+ mem->free = -1;
+ }
+
++ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_MBUF, 1 );
++ if (!mem) {
++ snmp_log_perror("No Memory Buffer info entry");
++ } else {
++ if (!mem->descr)
++ mem->descr = strdup("Memory Buffer");
++ mem->units = pagesize;
++ mem->size = bufspace/pagesize;
++ mem->free = -1;
++ }
++
++
+ nswap = swapmode(pagesize);
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 1 );
+ if (!mem) {