- def call(self, command_options, match_options, target_options):
- filename = match_dir + "/"+match_options.name+".xml"
+ def getnextfilename(self,type,chain):
+ dir = sfatables_config + "/"+chain;
+ last_rule_number = 0
+
+ for (root, dirs, files) in os.walk(dir):
+ for file in files:
+ if (file.startswith('sfatables-') and file.endswith(type)):
+ number_str = file.split('-')[1]
+ number = int(number_str)
+ if (number>last_rule_number):
+ last_rule_number = number
+
+ return "sfatables-%d-%s"%(last_rule_number+1,type)
+
+ def call_gen(self, chain, type, dir, options):
+ filename = os.path.join(dir, options.name+".xml")