func newConfig(v string) (config, error) {
	idx := strings.IndexByte(v, '=')
	if idx == -1 {
		return config{Config: v}, nil
	}
	cond := strings.TrimSpace(v[:idx])
	conf := strings.TrimSpace(v[idx+1:])
	c := config{Config: conf}
	if _, ipnet, err := net.ParseCIDR(cond); err == nil {
		c.Prefix = ipnet
	} else if mac, err := net.ParseMAC(cond); err == nil {
		c.MAC = mac
	} else {
		return config{}, fmt.Errorf("%s: invalid condition format", cond)
	}
	return c, nil
}
newConfig parses a configuration id with an optional condition.
package config
import (
	"bytes"
	"fmt"
	"net"
	"strings"
)
type config struct {
	Config string
	Prefix *net.IPNet
	MAC    net.HardwareAddr
}