From cd69c1122bea567d05ffd952eeaab7239823f45f Mon Sep 17 00:00:00 2001 From: Sapan Bhatia Date: Fri, 11 Sep 2009 19:32:34 +0000 Subject: [PATCH] Bug fix, and updating README file. --- sfatables/README | 9 +++++++++ sfatables/commands/List.py | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/sfatables/README b/sfatables/README index 050e54ad..b148e9dc 100644 --- a/sfatables/README +++ b/sfatables/README @@ -1,3 +1,12 @@ +sfatables is a tool for defining access and admission control policies in an SFA network, in much the same way as iptables is for ip networks. This file gives an overview of the tool and then describes its design and implementation. + +EXAMPLES +-------- + +An sfatables configuration consists of lists of rules that are applied to incoming and outgoing rspecs. Each rule consists of a 'match spec' and a 'target spec.' A match spec evaluates a request and determines if it matches a given set of criteria, and the corresponding 'target spec' specifies the action in such a case. + +Let's start by defining a few policies + Examples: Add rules: diff --git a/sfatables/commands/List.py b/sfatables/commands/List.py index 16d10084..e3c124e6 100644 --- a/sfatables/commands/List.py +++ b/sfatables/commands/List.py @@ -17,11 +17,11 @@ class List(Command): return - def get_info(self, xmlextension_path): + def get_info(self, type, xmlextension_path): xmldoc = libxml2.parseFile(xmlextension_path) p = xmldoc.xpathNewContext() - ext_name_node = p.xpathEval("/match/@name") + ext_name_node = p.xpathEval("/%s/@name"%type) ext_name = ext_name_node[0].content name_nodes = p.xpathEval("//rule/argument[value!='']/name") @@ -69,8 +69,8 @@ class List(Command): match_path = sfatables_config + '/' + chain + '/' + match_file target_path = sfatables_config + '/' + chain + '/' + target_file - match_info = self.get_info (match_path) - target_info = self.get_info (target_path) + match_info = self.get_info ('match',match_path) + target_info = self.get_info ('target',target_path) pretty.push_row(["%d"%number, match_info['name'], match_info['arguments'], target_info['name'], target_info['arguments']]) -- 2.47.0