]> gitweb.fluxo.info Git - puppet-shorewall.git/commitdiff
Adding boilerplate files and minor fixes
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 24 Aug 2009 18:24:14 +0000 (15:24 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 24 Aug 2009 18:24:14 +0000 (15:24 -0300)
files/boilerplate/tcclasses.footer [new file with mode: 0644]
files/boilerplate/tcclasses.header [new file with mode: 0644]
files/boilerplate/tcdevices.footer [new file with mode: 0644]
files/boilerplate/tcdevices.header [new file with mode: 0644]
files/boilerplate/tcrules.footer [new file with mode: 0644]
files/boilerplate/tcrules.header [new file with mode: 0644]
manifests/init.pp

diff --git a/files/boilerplate/tcclasses.footer b/files/boilerplate/tcclasses.footer
new file mode 100644 (file)
index 0000000..5e12d1d
--- /dev/null
@@ -0,0 +1 @@
+#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE
diff --git a/files/boilerplate/tcclasses.header b/files/boilerplate/tcclasses.header
new file mode 100644 (file)
index 0000000..025415b
--- /dev/null
@@ -0,0 +1,9 @@
+#
+# Shorewall version 4 - Tcclasses File
+#
+# For information about entries in this file, type "man shorewall-tcclasses"
+#
+# See http://shorewall.net/traffic_shaping.htm for additional information.
+#
+###############################################################################
+#INTERFACE:CLASS        MARK    RATE    CEIL    PRIORITY        OPTIONS
diff --git a/files/boilerplate/tcdevices.footer b/files/boilerplate/tcdevices.footer
new file mode 100644 (file)
index 0000000..5e12d1d
--- /dev/null
@@ -0,0 +1 @@
+#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE
diff --git a/files/boilerplate/tcdevices.header b/files/boilerplate/tcdevices.header
new file mode 100644 (file)
index 0000000..fe7c3d1
--- /dev/null
@@ -0,0 +1,10 @@
+#
+# Shorewall version 4 - Tcdevices File
+#
+# For information about entries in this file, type "man shorewall-tcdevices"
+#
+# See http://shorewall.net/traffic_shaping.htm for additional information.
+#
+###############################################################################
+#NUMBER:        IN-BANDWITH     OUT-BANDWIDTH   OPTIONS         REDIRECTED
+#INTERFACE                                                      INTERFACES
diff --git a/files/boilerplate/tcrules.footer b/files/boilerplate/tcrules.footer
new file mode 100644 (file)
index 0000000..5e12d1d
--- /dev/null
@@ -0,0 +1 @@
+#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE
diff --git a/files/boilerplate/tcrules.header b/files/boilerplate/tcrules.header
new file mode 100644 (file)
index 0000000..e0e7adc
--- /dev/null
@@ -0,0 +1,15 @@
+#
+# Shorewall version 4 - Tcrules File
+#
+# For information about entries in this file, type "man shorewall-tcrules"
+#
+# See http://shorewall.net/traffic_shaping.htm for additional information.
+# For usage in selecting among multiple ISPs, see
+# http://shorewall.net/MultiISP.html
+#
+# See http://shorewall.net/PacketMarking.html for a detailed description of
+# the Netfilter/Shorewall packet marking mechanism.
+######################################################################################################################
+#MARK   SOURCE          DEST            PROTO   DEST    SOURCE  USER    TEST    LENGTH  TOS   CONNBYTES         HELPER
+#                                               PORT(S) PORT(S)
+
index 84ce0305f875c5ef2756114fb7e79e723ab3f1b7..20093e9165a71dbcee359f8c8218740b9605190f 100644 (file)
@@ -204,25 +204,25 @@ class shorewall {
 
     # See http://www.shorewall.net/3.0/traffic_shaping.htm
     managed_file { tcdevices: }
-    define tcdevices($in_bandwidth, $out_bandwidth, $order='100'){
+    define tcdevices($in_bandwidth, $out_bandwidth, $options = '-', $redirected_interfaces = '', $order='100'){
         entry { "tcdevices.d/${order}-${title}":
-            line => "${name} ${in_bandwidth} ${out_bandwidth}",
+            line => "${name} ${in_bandwidth} ${out_bandwidth} ${options} ${redirected_interfaces}",
         }
     }
 
     # See http://www.shorewall.net/3.0/traffic_shaping.htm
     managed_file { tcrules: }
-    define tcrules($source, $destination, $protocol, $ports , $order='1'){
+    define tcrules($source, $destination, $protocol = 'all', $ports, $client_ports = '-', $order='1'){
         entry { "tcrules.d/${order}-${title}":
-            line => "# ${name}\n${order} ${source} ${destination} ${protocol} ${ports}",
+            line => "# ${name}\n${order} ${source} ${destination} ${protocol} ${ports} ${client_ports}",
         }
     }
 
     # See http://www.shorewall.net/3.0/traffic_shaping.htm
     managed_file { tcclasses: }
-    define tcclasses($rate, $ceil, $priority, $options , $order='1'){
+    define tcclasses($interface, $rate, $ceil, $priority, $options = '' , $order='1'){
         entry { "tcclasses.d/${order}-${title}":
-            line => "${name} ${order} ${rate} ${ceil} ${priority} ${options}",
+            line => "# ${name}\n${interface} ${order} ${rate} ${ceil} ${priority} ${options}",
         }
     }