[collectd] [PATCH] Interface option for network plugin

Max Henkel henkel at gmx.at
Sun Mar 14 12:54:21 CET 2010


Hello list!

On Tue, Mar 09, 2010 at 08:07:20PM +0100, Max Henkel wrote:
> On Tue, Mar 09, 2010 at 06:17:35PM +0100, Florian Forster wrote:
> [...]
> > On Fri, Feb 26, 2010 at 12:49:02PM +0100, Max Henkel wrote:
[...]
> > > @@ -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?
> 
> I've already thought about that, but I've expected that this style
> is expected in the config file (Apache style ;-) and thus the patch
> resembles this behaviour. If this is not the case I'm going to
> correct this and move the global variable whith to the sockent_t as
> well.

Sorry, I haven't got your point. The forwarding from interface-0 to
interface-1 is actually possible with this style of option setting, if
you specify the interface each time before the corresponding Server
and Listen statements. BUT you're not able to join the same multicast
group on multiple interfaces on *one* socket.
Another point is the readability. IMHO it is easier to read (and
understand) the "Interface" option, if it is inside a closed block.
Are there any thoughts about that?

Best regards,

Max
-- 
< henkel at gmx dot at >



More information about the collectd mailing list