From 342b9b05015e6a009d9dbccf559ae66334298b1f Mon Sep 17 00:00:00 2001 From: Sapan Bhatia Date: Wed, 16 Sep 2009 14:02:56 +0000 Subject: [PATCH] Implemented terminal rules --- sfatables/runtime.py | 33 +++------------------------------ sfatables/sfatables | 2 +- 2 files changed, 4 insertions(+), 31 deletions(-) diff --git a/sfatables/runtime.py b/sfatables/runtime.py index 0dab15d3..dc9e7cbf 100644 --- a/sfatables/runtime.py +++ b/sfatables/runtime.py @@ -26,6 +26,8 @@ class SFATablesRules: intermediate_rspec = rspec for rule in self.sorted_rule_list: intermediate_rspec = rule.apply_interpreted(intermediate_rspec) + if (rule.terminal): + break return intermediate_rspec @@ -33,37 +35,8 @@ def main(): incoming = SFATablesRules('INCOMING') outgoing = SFATablesRules('OUTGOING') - rspec = """ - - - plc.princeton.sapan - + rspec = open(sys.argv[1]).read() - - - hrn - plc - - - whitelist - plc.princeton - - - blacklist - plc.tp - - - - - - - - - - - - - """ print "%d rules loaded for INCOMING chain\n"%len(incoming.sorted_rule_list) diff --git a/sfatables/sfatables b/sfatables/sfatables index 9abcf6cd..7f61a3f0 100755 --- a/sfatables/sfatables +++ b/sfatables/sfatables @@ -91,7 +91,7 @@ def main(): match_parser = create_parser_xml_ext(match_dict) matches_str = ",".join(match_dict.keys()) match_parser.add_option('-m','--match',dest='name',help='Match name (one of %s)'%matches_str, metavar = 'MATCH') - match_parser.add_option('-n','--negate',dest='negate',help='Negate result',action=store_true) + match_parser.add_option('-n','--negate',dest='negate',help='Negate result',action='store_true') (match_options, args) = match_parser.parse_args(pargs[1]) try: name = match_options.name -- 2.43.0