Still reorganizing the default set of rules
Sapan Bhatia [Tue, 22 Sep 2009 17:50:59 +0000 (17:50 +0000)]
sfatables/matches/__init__.py
sfatables/matches/slice-whitelist.xml
sfatables/processors/core/accept.xsl [deleted file]
sfatables/processors/flowspec/accept.xsl [deleted file]
sfatables/processors/link/accept.xsl [deleted file]
sfatables/processors/link/restrict_slice.xml [moved from sfatables/processors/link/RESTRICT_SLICE.xml with 100% similarity]
sfatables/processors/node/accept.xsl [deleted file]
sfatables/targets/ACCEPT.xml
sfatables/targets/REJECT.xml
sfatables/test.sfarspec

index 9910712..2329359 100644 (file)
@@ -1,4 +1,5 @@
 all="""
 hrn
 slice-whitelist
+all
 """.split()
index 91820ff..2489c1c 100644 (file)
@@ -1,4 +1,4 @@
 <match name="slice-whitelist">
-    <context select="//sfa/current/slice@hrn"/>
+    <context select="//request-context/slice@hrn"/>
     <processor filename="slice-whitelist.xsl"/>
 </match>
diff --git a/sfatables/processors/core/accept.xsl b/sfatables/processors/core/accept.xsl
deleted file mode 100644 (file)
index 9a397ef..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-    <!-- Magic sauce copied from a manual. This fragment basically copies everything except for
-    stuff that explicitly matches with the templates defined below. In the case of such a match,
-    the matched node is treated differently.-->
-    <xsl:template match="@* | node()">
-        <xsl:copy>
-            <xsl:apply-templates select="@* | node()"/>
-        </xsl:copy>
-    </xsl:template>
-    <xsl:template match="sfatables-input"/>
-</xsl:stylesheet>
diff --git a/sfatables/processors/flowspec/accept.xsl b/sfatables/processors/flowspec/accept.xsl
deleted file mode 100644 (file)
index 9a397ef..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-    <!-- Magic sauce copied from a manual. This fragment basically copies everything except for
-    stuff that explicitly matches with the templates defined below. In the case of such a match,
-    the matched node is treated differently.-->
-    <xsl:template match="@* | node()">
-        <xsl:copy>
-            <xsl:apply-templates select="@* | node()"/>
-        </xsl:copy>
-    </xsl:template>
-    <xsl:template match="sfatables-input"/>
-</xsl:stylesheet>
diff --git a/sfatables/processors/link/accept.xsl b/sfatables/processors/link/accept.xsl
deleted file mode 100644 (file)
index 9a397ef..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-    <!-- Magic sauce copied from a manual. This fragment basically copies everything except for
-    stuff that explicitly matches with the templates defined below. In the case of such a match,
-    the matched node is treated differently.-->
-    <xsl:template match="@* | node()">
-        <xsl:copy>
-            <xsl:apply-templates select="@* | node()"/>
-        </xsl:copy>
-    </xsl:template>
-    <xsl:template match="sfatables-input"/>
-</xsl:stylesheet>
diff --git a/sfatables/processors/node/accept.xsl b/sfatables/processors/node/accept.xsl
deleted file mode 100644 (file)
index 9a397ef..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-    <!-- Magic sauce copied from a manual. This fragment basically copies everything except for
-    stuff that explicitly matches with the templates defined below. In the case of such a match,
-    the matched node is treated differently.-->
-    <xsl:template match="@* | node()">
-        <xsl:copy>
-            <xsl:apply-templates select="@* | node()"/>
-        </xsl:copy>
-    </xsl:template>
-    <xsl:template match="sfatables-input"/>
-</xsl:stylesheet>
index 7a8968e..d97c68d 100644 (file)
@@ -1,8 +1,10 @@
 <target name="ACCEPT">
     <!-- The context is empty, since this target does not require any input from SFA -->
-    <context select=""/>
-    <attributes>
-        <attribute terminal="yes"/>
-    </attributes>
-    <processor filename="accept.xsl"/>
+    <rule element="*">
+        <context select=""/>
+        <attributes>
+            <attribute terminal="yes"/>
+        </attributes>
+        <processor filename="accept.xsl"/>
+    </rule>
 </target>
index 7d524db..8beeb3c 100644 (file)
@@ -1,8 +1,10 @@
 <target name="REJECT">
     <!-- The context is empty, since this target does not require any input from SFA -->
-    <context select=""/>
-    <attributes>
-        <attribute terminal="yes"/>
-    </attributes>
-    <processor filename="reject.xsl"/>
+    <rule element="*">
+        <context select=""/>
+        <attributes>
+            <attribute terminal="yes"/>
+        </attributes>
+        <processor filename="reject.xsl"/>
+    </rule>
 </target>
index db6f075..c84a56d 100644 (file)
@@ -29,4 +29,3 @@
         </nodespec>
     </request>
 </rspec>
-    """