def _repr_rule(iptc_rule, ipv6=False):
    """ Return a string representation of an iptc_rule """
    s = ''
    if ipv6==False and iptc_rule.src != '0.0.0.0/0.0.0.0':
        s += 'src {} '.format(iptc_rule.src)
    elif ipv6==True and iptc_rule.src != '::/0':
        s += 'src {} '.format(iptc_rule.src)
    if ipv6==False and iptc_rule.dst != '0.0.0.0/0.0.0.0':
        s += 'dst {} '.format(iptc_rule.dst)
    elif ipv6==True and iptc_rule.dst != '::/0':
        s += 'dst {} '.format(iptc_rule.dst)
    if iptc_rule.protocol != 'ip':
        s += 'protocol {} '.format(iptc_rule.protocol)
    if iptc_rule.in_interface is not None:
        s += 'in {} '.format(iptc_rule.in_interface)
    if iptc_rule.out_interface is not None:
        s += 'out {} '.format(iptc_rule.out_interface)
    if ipv6 == False and iptc_rule.fragment:
        s += 'fragment '
    for m in iptc_rule.matches:
        s += '{} {} '.format(m.name, m.get_all_parameters())
    if iptc_rule.target and iptc_rule.target.name and len(iptc_rule.target.get_all_parameters()):
        s += '-j {} '.format(iptc_rule.target.get_all_parameters())
    elif iptc_rule.target and iptc_rule.target.name:
        s += '-j {} '.format(iptc_rule.target.name)
    return s