[collectd] [PATCH] Interface option for network plugin
Florian Forster
octo at verplant.org
Tue Mar 9 18:17:35 CET 2010
Hi Max,
thanks for your patch :)
On Fri, Feb 26, 2010 at 12:49:02PM +0100, Max Henkel wrote:
> +#if KERNEL_LINUX
> + struct ip_mreqn mreq;
> +#else
> + struct ip_mreq mreq;
> +#endif
As far as I see, the only difference between the two structs is the
"imr_address", which you later set to INADDR_ANY. Couldn't we remove the
#if altogether and use "struct ip_mreq" on all platforms?
> + if (! IN_MULTICAST (ntohl (addr->sin_addr.s_addr)))
> + return (0);
Doesn't it make sense to be able to set the interface in unicast mode,
too? For example if the host has multiple default gateways. The
socket(7) option "SO_BINDTODEVICE" could be used for this I guess.
> @@ -2842,6 +2929,8 @@ static int network_config (oconfig_item_t *ci) /* {{{ */
> network_config_add_server (child);
> else if (strcasecmp ("TimeToLive", child->key) == 0)
> network_config_set_ttl (child);
> + else if (strcasecmp ("Interface", child->key) == 0)
> + network_config_set_interface (child);
> else if (strcasecmp ("MaxPacketSize", child->key) == 0)
> network_config_set_buffer_size (child);
> else if (strcasecmp ("Forward", child->key) == 0)
Starting with the signing and encryption option, we have <Server> and
<Listen> blocks that take socket specific options. It'd be kind of
inconsistent with the "TimeToLive" and other options, but maybe adding
this to those blocks would be even better. It would enable to forward
data from one multicast group on interface-0 to the *same* multicast
group on interface-1, which I guess could be useful. But maybe it's an
academic case, I dunno.. Thoughts, anyone?
Best regards,
—octo
--
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20100309/73e9bd0f/attachment.pgp
More information about the collectd
mailing list