from sfatables.globals import *
class Add(Command):
- options = [('-A','--add')]
- help = 'Add a rule to a chain'
- matches = True
- targets = True
-
def __init__(self):
+ self.options = [('-A','--add')]
+ self.help = 'Add a rule to a chain'
+ self.matches = True
+ self.targets = True
return
def getnextfilename(self,type,chain):
<!-- 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="//RSpec//sfatables-rule/argument[name='max-link-bandwidth']/value"/>
+ <xsl:variable name="max-link-bandwidth" select="//RSpec//rule-context/argument[name='max-link-bandwidth']/value"/>
<!-- Drop Linkspecs for which bw > max-link-bandwidth -->
<xsl:template match="LinkSpec">
<xsl:template match="sfatables-input"/>
</xsl:stylesheet>
+>
<!-- 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="//RSpec//sfatables-rule/argument[name='max-link-bandwidth']/value"/>
+ <xsl:variable name="max-link-bandwidth" select="//RSpec//rule-context/argument[name='max-link-bandwidth']/value"/>
<!-- Drop Linkspecs for which bw > max-link-bandwidth -->
<xsl:template match="LinkSpec">
<xsl:template match="sfatables-input"/>
</xsl:stylesheet>
+>
</xsl:copy>
</xsl:template>
- <xsl:variable name="whitelist_prefix" select="//rspec//sfatables-rule/argument[name='whitelist']/value"/>
- <xsl:variable name="blacklist_prefix" select="//rspec//sfatables-rule/argument[name='blacklist']/value"/>
+ <xsl:variable name="whitelist_prefix" select="//rspec//rule-context/argument[name='whitelist']/value"/>
+ <xsl:variable name="blacklist_prefix" select="//rspec//rule-context/argument[name='blacklist']/value"/>
<!-- Drop nodes that are not in the whitelist -->
<xsl:template match="node">
</xsl:template>
</xsl:stylesheet>
+et>
<sfa><user><hrn>plc.princeton.sapanb</hrn></user></sfa>
</request-context>
+ <rule-context>
+ <argument>
+ <name>blacklist</name>
+ <value>plc.tp</value>
+ </argument>
+ </rule-context>
+
<request>
<nodespec>
<node name="plc.princeton.planetlab-01"/>
</nodespec>
</request>
</rspec>
+ec>
style = libxslt.parseStylesheetDoc(styledoc)
#doc = libxml2.parseDoc(rspec)
result = style.applyStylesheet(doc, None)
- stylesheet_result = result #style.saveResultToString(result)
+ stylesheet_result = style.saveResultToString(result)
style.freeStylesheet()
- #doc.freeDoc()
- #result.freeDoc()
+ doc.freeDoc()
+ result.freeDoc()
+ import pdb
+ pdb.set_trace()
return stylesheet_result
def match(self, rspec):