@staticmethod
    def read_simple_rules(chain=None):
        assert chain is None or RULE_CHAINS in chain
        rules = []
        ipt = Iptables.load()
        # rfw originated rules may have only DROP/ACCEPT/REJECT targets and do not specify protocol and do not have extra args like ports
        if chain == 'INPUT' or chain is None:
            input_rules = ipt.find({'target': RULE_TARGETS, 'chain': ['INPUT'], 'destination': ['0.0.0.0/0'], 'out': ['*'], 'prot': ['all'], 'extra': ['']})
            rules.extend(input_rules)
        if chain == 'OUTPUT' or chain is None:
            output_rules = ipt.find({'target': RULE_TARGETS, 'chain': ['OUTPUT'], 'source': ['0.0.0.0/0'], 'inp': ['*'], 'prot': ['all'], 'extra': ['']})
            rules.extend(output_rules)
        if chain == 'FORWARD' or chain is None:
            forward_rules = ipt.find({'target': RULE_TARGETS, 'chain': ['FORWARD'], 'prot': ['all'], 'extra': ['']})
            rules.extend(forward_rules)
        return rules

    # find is a non-static method as it should be called after instantiation with Iptables.load()
dataset/ETHPy150Open securitykiss-com/rfw/rfw/iptables.py/Iptables.read_simple_rules/swapped operands of `in`