pkgsrc/net/net-snmp/patches/patch-al

38 lines
1.4 KiB
Text
Raw Normal View History

$NetBSD: patch-al,v 1.4 2006/01/24 22:16:55 adam Exp $
--- agent/mibgroup/host/hr_network.c.orig 2005-10-28 20:49:36.000000000 +0200
+++ agent/mibgroup/host/hr_network.c
@@ -193,6 +193,10 @@ static netsnmp_interface_entry *HRN_ifne
static char HRN_name[MAX_PHYSADDR_LEN];
static nmapi_phystat HRN_ifnet;
#define M_Interface_Scan_Next(a, b, c, d) Interface_Scan_Next(a, b, c)
+#elif defined darwin
+static char HRN_name[IFNAMSIZ];
+static struct if_msghdr HRN_ifnet;
+#define M_Interface_Scan_Next(a, b, c, d) Interface_Scan_Next(a, b, c, d)
#else /* hpux11 */
static char HRN_name[16];
#ifndef WIN32
@@ -222,7 +226,7 @@ int
Get_Next_HR_Network(void)
{
short HRN_index;
-#if !defined( solaris2) && ! defined( WIN32 )
+#if !defined(solaris2) && !defined(darwin) && !defined(WIN32)
if (M_Interface_Scan_Next(&HRN_index, HRN_name, &HRN_ifnet, NULL) == 0)
HRN_index = -1;
#else
@@ -245,7 +249,11 @@ Save_HR_Network_Info(void)
HRN_savedFlags = HRN_ifnet.if_entry.ifOper;
HRN_savedErrors = HRN_ifnet.if_entry.ifInErrors +
HRN_ifnet.if_entry.ifOutErrors;
-#else /* hpux11 */
+#elif defined(__APPLE__)
+ HRN_savedFlags = HRN_ifnet.ifm_flags;
+ HRN_savedFlags = HRN_ifnet.ifm_data.ifi_ierrors +
+ HRN_ifnet.ifm_data.ifi_oerrors;
+#else
#ifndef WIN32
HRN_savedFlags = HRN_ifnet.if_flags;
HRN_savedErrors = HRN_ifnet.if_ierrors + HRN_ifnet.if_oerrors;