]> gitweb.fluxo.info Git - puppet-shorewall.git/commitdiff
Adding traffic shapping support via tcdevices, tcrules and tcclasses
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 24 Aug 2009 14:28:25 +0000 (11:28 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 24 Aug 2009 14:28:25 +0000 (11:28 -0300)
manifests/init.pp

index c93b2600a46c0115c33938cd714036fa122d9973..84ce0305f875c5ef2756114fb7e79e723ab3f1b7 100644 (file)
@@ -202,6 +202,30 @@ class shorewall {
         }
     }
 
+    # See http://www.shorewall.net/3.0/traffic_shaping.htm
+    managed_file { tcdevices: }
+    define tcdevices($in_bandwidth, $out_bandwidth, $order='100'){
+        entry { "tcdevices.d/${order}-${title}":
+            line => "${name} ${in_bandwidth} ${out_bandwidth}",
+        }
+    }
+
+    # See http://www.shorewall.net/3.0/traffic_shaping.htm
+    managed_file { tcrules: }
+    define tcrules($source, $destination, $protocol, $ports , $order='1'){
+        entry { "tcrules.d/${order}-${title}":
+            line => "# ${name}\n${order} ${source} ${destination} ${protocol} ${ports}",
+        }
+    }
+
+    # See http://www.shorewall.net/3.0/traffic_shaping.htm
+    managed_file { tcclasses: }
+    define tcclasses($rate, $ceil, $priority, $options , $order='1'){
+        entry { "tcclasses.d/${order}-${title}":
+            line => "${name} ${order} ${rate} ${ceil} ${priority} ${options}",
+        }
+    }
+
     # See http://shorewall.net/shorewall_extension_scripts.htm
     define extension_script($script = '') {
       case $name {