diff --git a/src/traffic.c b/src/traffic.c
index 59b59e8347f1dea5725ad538c79a20db586445da..a7b70c5875a6d3946964b5896013437da3afa437 100644 (file)
--- a/src/traffic.c
+++ b/src/traffic.c
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
+ * Free Software Foundation; only version 2 of the License is applicable.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
# include <ifaddrs.h>
#endif
# include <ifaddrs.h>
#endif
-#define MODULE_NAME "traffic"
-
/*
* Various people have reported problems with `getifaddrs' and varying versions
* of `glibc'. That's why it's disabled by default. Since more statistics are
/*
* Various people have reported problems with `getifaddrs' and varying versions
* of `glibc'. That's why it's disabled by default. Since more statistics are
# define TRAFFIC_HAVE_READ 0
#endif
# define TRAFFIC_HAVE_READ 0
#endif
-#define BUFSIZE 512
-
/*
* (Module-)Global variables
*/
/*
* (Module-)Global variables
*/
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
-
- /* FIXME: do this globally */
- if (gethostname (vl.host, sizeof (vl.host)) != 0)
- {
- syslog (LOG_ERR, "load plugin: gethostname failed: %s",
- strerror (errno));
- return;
- }
+ strcpy (vl.host, hostname);
strcpy (vl.plugin, "interface");
strcpy (vl.plugin_instance, "");
strncpy (vl.type_instance, dev, sizeof (vl.type_instance));
strcpy (vl.plugin, "interface");
strcpy (vl.plugin_instance, "");
strncpy (vl.type_instance, dev, sizeof (vl.type_instance));
plugin_register_read ("interface", traffic_read);
#endif
}
plugin_register_read ("interface", traffic_read);
#endif
}
-
-#undef BUFSIZE
-#undef MODULE_NAME