From: Sapan Bhatia <sapanb@cs.princeton.edu>
Date: Mon, 21 Sep 2009 20:56:21 +0000 (+0000)
Subject: Reogranizing processors
X-Git-Tag: sfa-0.9-3~60
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=e1ab837ede90906cbf95be0afb09786c21de1f25;p=sfa.git

Reogranizing processors
---

diff --git a/sfatables/processors/core/accept.xsl b/sfatables/processors/core/accept.xsl
new file mode 100644
index 00000000..9a397ef7
--- /dev/null
+++ b/sfatables/processors/core/accept.xsl
@@ -0,0 +1,12 @@
+<?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
new file mode 100644
index 00000000..9a397ef7
--- /dev/null
+++ b/sfatables/processors/flowspec/accept.xsl
@@ -0,0 +1,12 @@
+<?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/RESTRICT_SLICE.xml b/sfatables/processors/link/RESTRICT_SLICE.xml
new file mode 100644
index 00000000..37c56d46
--- /dev/null
+++ b/sfatables/processors/link/RESTRICT_SLICE.xml
@@ -0,0 +1,27 @@
+<?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>
+    <!-- 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"/>
+
+    <!-- Drop Linkspecs for which bw > max-link-bandwidth -->
+    <xsl:template match="LinkSpec">
+            <xsl:choose>
+                <xsl:when test="bw &lt; $max-link-bandwidth">
+                    <xsl:copy-of select="."/>
+                </xsl:when>
+                <xsl:otherwise/>
+            </xsl:choose> 
+    </xsl:template>
+
+    <xsl:template match="sfatables-input"/>
+</xsl:stylesheet>
diff --git a/sfatables/processors/link/accept.xsl b/sfatables/processors/link/accept.xsl
new file mode 100644
index 00000000..9a397ef7
--- /dev/null
+++ b/sfatables/processors/link/accept.xsl
@@ -0,0 +1,12 @@
+<?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
new file mode 100644
index 00000000..9a397ef7
--- /dev/null
+++ b/sfatables/processors/node/accept.xsl
@@ -0,0 +1,12 @@
+<?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>