# include <ifaddrs.h>
#endif
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
/*
* Various people have reported problems with `getifaddrs' and varying versions
* of `glibc'. That's why it's disabled by default. Since more statistics are
# endif /* !COLLECT_GETIFADDRS */
#endif /* KERNEL_LINUX */
-#if HAVE_GETIFADDRS || KERNEL_LINUX || HAVE_LIBKSTAT || HAVE_LIBSTATGRAB
-# define INTERFACE_HAVE_READ 1
-#else
-# define INTERFACE_HAVE_READ 0
+#if !HAVE_GETIFADDRS && !KERNEL_LINUX && !HAVE_LIBKSTAT && !HAVE_LIBSTATGRAB
+# error "No applicable input method."
#endif
/*
#if HAVE_LIBKSTAT
static int interface_init (void)
{
-#if HAVE_LIBKSTAT
kstat_t *ksp_chain;
unsigned long long val;
continue;
ksp[numif++] = ksp_chain;
}
-#endif /* HAVE_LIBKSTAT */
return (0);
} /* int interface_init */
return (1 - if_list_action);
} /* int check_ignore_if */
-#if INTERFACE_HAVE_READ
static void if_submit (const char *dev, const char *type,
unsigned long long rx,
unsigned long long tx)
unsigned long long tx;
if (kc == NULL)
- return;
+ return (-1);
for (i = 0; i < numif; i++)
{
return (0);
} /* int interface_read */
-#endif /* INTERFACE_HAVE_READ */
void module_register (void)
{
#if HAVE_LIBKSTAT
plugin_register_init ("interface", interface_init);
#endif
-#if INTERFACE_HAVE_READ
plugin_register_read ("interface", interface_read);
-#endif
} /* void module_register */