Pktsrc prefix separator (Re: [JIRA] (BIT-1267) packet source prefix separator in node.cfg breaks broctl)

(Taking this to bro-dev for discussion.)

On Wed, Oct 01, 2014 at 22:31 -0500, Daniel wrote for
https://bro-tracker.atlassian.net/browse/BIT-1267:

Using a different class (instead of SafeConfigParser) from the
ConfigParser module seems to fix the problem.

Seems I hit another prefix separator that already had a meaning. :slight_smile:

SafeConfigParser implements some interpolation features using % as the
control character. I don't think we're using that anywhere, so it
might be fine; on the other hand the docs say:

    Derived class of ConfigParser that implements a more-sane variant
    of the magical interpolation feature. This implementation is more
    predictable as well. New applications should prefer this version
    if they don’t need to be compatible with older versions of
    Python."

So we can either ignore that, or change the prefix separator once
more. If we did the latter, any idea what would be a good one? As a
reminder, the problem is specifying the packet source plugin to use
with an interface, e.g., currently you'd say "-i netmap%eth1" to
monitor eth1 via the netmap plugin. It used to be "-i netmap:eth1" but
that conflicts with some BPF devices that use the colon already. So,
what would be better than ':' or '%', both visually and in terms of
not conflicting with existing interface naming conventions?

Robin

Just out of curiosity, I'm wondering why it was implemented as a
prefix to the interface name, as opposed to just specifying
the packet source with a different cmd-line option?
(for example: bro --pktsrc netmap -i eth0)

Is it expected that someone will want to do something
like this: bro -i netmap:eth0 -i pcap:eth1

I wouldn't call it "expected", but I don't want to rule it out either.
I see the plugin through which an interface gets routed as a property
of the interface itself. A global setting saying "all interfaces are
to go through netmap" feels to coarse to me.

Robin

How about a double colon: netmap::eth0

I like that actually.

Robin

Me too! Looks like a namespace. :slight_smile:

  .Seth