Renamed max-link-bandwidth to max-link-kbps for clarity
Andy Bavier [Thu, 5 Nov 2009 20:58:50 +0000 (20:58 +0000)]
sfatables/processors/max_link_kbps.xsl [moved from sfatables/processors/max_link_bandwidth.xsl with 84% similarity]
sfatables/targets/RESTRICT_SLICE_PROP.xml
sfatables/vini.rspec [new file with mode: 0644]

similarity index 84%
rename from sfatables/processors/max_link_bandwidth.xsl
rename to sfatables/processors/max_link_kbps.xsl
index c7e0686..575e92e 100644 (file)
     <!-- 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//target-context/argument[name='max-link-bandwidth']/value"/>
+    <xsl:variable name="max-link-kbps" select="//RSpec//target-context/argument[name='max-link-kbps']/value"/>
 
     <!-- Drop Linkspecs for which bw > max-link-bandwidth -->
     <xsl:template match="LinkSpec">
             <xsl:choose>
-                <xsl:when test="bw &lt; $max-link-bandwidth">
+                <xsl:when test="not (kbps &gt; $max-link-kbps)">
                     <xsl:copy-of select="."/>
                 </xsl:when>
                 <xsl:otherwise/>
index b8d2c25..8e2b7af 100644 (file)
@@ -3,10 +3,10 @@
     <rule element="link">
     <context select=""/>
         <argument>
-            <name>max-link-bandwidth</name>
-            <help>Maximum link bandwidth.</help>
-            <operand>bps</operand>
+            <name>max-link-kbps</name>
+            <help>Maximum link bandwidth in kilobytes per second.</help>
+            <operand>kbps</operand>
         </argument>
-    <processor filename="max_link_bandwidth.xsl"/>
+    <processor filename="max_link_kbps.xsl"/>
     </rule>
 </target>
diff --git a/sfatables/vini.rspec b/sfatables/vini.rspec
new file mode 100644 (file)
index 0000000..8922170
--- /dev/null
@@ -0,0 +1,12 @@
+
+<!-- run "runtime.py vini.rspec" to apply current rule set to this file -->
+
+<RSpec>
+  <Request>
+    <LinkSpec name="foobar">
+      <endpoint>i2atla1</endpoint>
+      <endpoint>i2chic1</endpoint>
+      <kbps>1001</kbps>
+    </LinkSpec>
+  </Request>
+</RSpec>