git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
02ad775
)
More bug fixes...
author
Sapan Bhatia
<sapanb@cs.princeton.edu>
Tue, 27 Oct 2009 03:23:12 +0000
(
03:23
+0000)
committer
Sapan Bhatia
<sapanb@cs.princeton.edu>
Tue, 27 Oct 2009 03:23:12 +0000
(
03:23
+0000)
sfatables/processors/legacy-restrict-to-nodes.xsl
patch
|
blob
|
history
sfatables/processors/max_link_bandwidth.xsl
patch
|
blob
|
history
sfatables/processors/restrict_to_nodes.xsl
patch
|
blob
|
history
sfatables/runtime.py
patch
|
blob
|
history
sfatables/test.sfarspec
patch
|
blob
|
history
diff --git
a/sfatables/processors/legacy-restrict-to-nodes.xsl
b/sfatables/processors/legacy-restrict-to-nodes.xsl
index
5e23184
..
b761a29
100644
(file)
--- a/
sfatables/processors/legacy-restrict-to-nodes.xsl
+++ b/
sfatables/processors/legacy-restrict-to-nodes.xsl
@@
-9,8
+9,8
@@
</xsl:copy>
</xsl:template>
</xsl:copy>
</xsl:template>
- <xsl:variable name="whitelist_suffix" select="//
rs
pec//target-context/argument[name='whitelist-dns-suffix']/value"/>
- <xsl:variable name="blacklist_suffix" select="//
rs
pec//target-context/argument[name='blacklist-dns-suffix']/value"/>
+ <xsl:variable name="whitelist_suffix" select="//
RS
pec//target-context/argument[name='whitelist-dns-suffix']/value"/>
+ <xsl:variable name="blacklist_suffix" select="//
RS
pec//target-context/argument[name='blacklist-dns-suffix']/value"/>
<!-- Drop nodes that are not in the whitelist. This is the legacy version that works on the current
rspec. The current rspec refers to dns names, not sfa names for nodes.-->
<!-- Drop nodes that are not in the whitelist. This is the legacy version that works on the current
rspec. The current rspec refers to dns names, not sfa names for nodes.-->
diff --git
a/sfatables/processors/max_link_bandwidth.xsl
b/sfatables/processors/max_link_bandwidth.xsl
index
42b5711
..
4cfa4cf
100644
(file)
--- a/
sfatables/processors/max_link_bandwidth.xsl
+++ b/
sfatables/processors/max_link_bandwidth.xsl
@@
-11,7
+11,7
@@
<!-- End of magic sauce -->
<!-- Read in the value of the argument. See 'example_vini_rspec.xml' for an example of such an argument -->
<!-- End of magic sauce -->
<!-- Read in the value of the argument. See 'example_vini_rspec.xml' for an example of such an argument -->
- <xsl:variable name="max-link-bandwidth" select="//
rs
pec//target-context/argument[name='max-link-bandwidth']/value"/>
+ <xsl:variable name="max-link-bandwidth" select="//
RS
pec//target-context/argument[name='max-link-bandwidth']/value"/>
<!-- Drop Linkspecs for which bw > max-link-bandwidth -->
<xsl:template match="LinkSpec">
<!-- Drop Linkspecs for which bw > max-link-bandwidth -->
<xsl:template match="LinkSpec">
diff --git
a/sfatables/processors/restrict_to_nodes.xsl
b/sfatables/processors/restrict_to_nodes.xsl
index
b6a3eba
..
4d8f648
100644
(file)
--- a/
sfatables/processors/restrict_to_nodes.xsl
+++ b/
sfatables/processors/restrict_to_nodes.xsl
@@
-9,11
+9,12
@@
</xsl:copy>
</xsl:template>
</xsl:copy>
</xsl:template>
- <xsl:variable name="whitelist_prefix" select="//
rs
pec//target-context/argument[name='whitelist']/value"/>
- <xsl:variable name="blacklist_prefix" select="//
rs
pec//target-context/argument[name='blacklist']/value"/>
+ <xsl:variable name="whitelist_prefix" select="//
RS
pec//target-context/argument[name='whitelist']/value"/>
+ <xsl:variable name="blacklist_prefix" select="//
RS
pec//target-context/argument[name='blacklist']/value"/>
<!-- Drop nodes that are not in the whitelist -->
<xsl:template match="node">
<!-- Drop nodes that are not in the whitelist -->
<xsl:template match="node">
+ <xsl:value-of select="$blacklist_prefix"/>
<xsl:choose>
<xsl:when test="starts-with(@name,$whitelist_prefix) and not($blacklist_prefix and starts-with(@name,$blacklist_prefix))">
<xsl:copy-of select="."/>
<xsl:choose>
<xsl:when test="starts-with(@name,$whitelist_prefix) and not($blacklist_prefix and starts-with(@name,$blacklist_prefix))">
<xsl:copy-of select="."/>
diff --git
a/sfatables/runtime.py
b/sfatables/runtime.py
index
69dd665
..
f9263fb
100644
(file)
--- a/
sfatables/runtime.py
+++ b/
sfatables/runtime.py
@@
-50,7
+50,9
@@
class SFATablesRules:
childNode = self.create_xml_node(k, context_dict[k])
node.addChild(childNode)
else:
childNode = self.create_xml_node(k, context_dict[k])
node.addChild(childNode)
else:
- node.addContent(context_dict[k])
+ childNode = libxml2.newNode(k)
+ childNode.addContent(context_dict[k])
+ node.addChild(childNode)
return node
def add_request_context_to_rspec(self, doc):
return node
def add_request_context_to_rspec(self, doc):
@@
-86,7
+88,7
@@
class SFATablesRules:
def main():
incoming = SFATablesRules('INCOMING')
def main():
incoming = SFATablesRules('INCOMING')
- incoming.set_context({'sfa':{'user':{'hrn':'pl
e
.princeton.sapanb'}}})
+ incoming.set_context({'sfa':{'user':{'hrn':'pl
c
.princeton.sapanb'}}})
outgoing = SFATablesRules('OUTGOING')
print "%d rules loaded for INCOMING chain"%len(incoming.sorted_rule_list)
outgoing = SFATablesRules('OUTGOING')
print "%d rules loaded for INCOMING chain"%len(incoming.sorted_rule_list)
diff --git
a/sfatables/test.sfarspec
b/sfatables/test.sfarspec
index
b84bec4
..
ca39017
100644
(file)
--- a/
sfatables/test.sfarspec
+++ b/
sfatables/test.sfarspec
@@
-3,6
+3,7
@@
<RSpec>
<request-context><sfa><user><hrn>plc.princeton.sapanb</hrn></user></sfa></request-context>
<match-context><argument><name>user-hrn</name><value>plc.princeton.sapanb</value></argument></match-context>
<RSpec>
<request-context><sfa><user><hrn>plc.princeton.sapanb</hrn></user></sfa></request-context>
<match-context><argument><name>user-hrn</name><value>plc.princeton.sapanb</value></argument></match-context>
+ <target-context><argument><name>blacklist</name><value>plc.tp</value></argument></target-context>
<request>
<nodespec>
<node name="plc.princeton.planetlab-01"/>
<request>
<nodespec>
<node name="plc.princeton.planetlab-01"/>