def compare_bdd(bdd1, operator, bdd2): """Compare two ROBDD""" res = compare(bdd1, operator, bdd2) if operator == Bdd.IMPL: return res <= 2 elif operator == Bdd.AND: return not res <= 2
def delete_rule_by_spec(acl, rule): test = False for r in [a for a in acl.rules]: if compare(r.toBDD(), Bdd.BIIMPL, rule.toBDD()) <= 2 and r.action.chain == rule.action.chain: acl.rules.remove(r) test = True return test