'Add a rule to the table.
This is just like what you\'d feed to iptables, just without
the \'-A <chain name>\' bit at the start.
However, if you need to jump to one of your wrapped chains,
prepend its name with a \'$\' which will ensure the wrapping
is applied correctly.'

def add_rule(self, chain, rule, wrap=True, top=False):

    if (wrap and (chain not in self.chains)):
        raise ValueError((_('Unknown    chain:    %r') % chain))
    if ('$' in rule):
        rule = '    '.join(map(self._wrap_target_chain, rule.split('    ')))
    rule_obj = IptablesRule(chain, rule, wrap, top)
    if (rule_obj in self.rules):
        LOG.debug('Skipping    duplicate    iptables    rule    addition.    %(rule)r    already    in    %(rules)r', {'rule': rule_obj, 'rules': self.rules})
    else:
        self.rules.append(IptablesRule(chain, rule, wrap, top))
        self.dirty = True
