Add new invirt-iptables package to allow stacking iptables rules.
authorEvan Broder <broder@mit.edu>
Sun, 3 Jan 2010 21:25:48 +0000 (16:25 -0500)
committerEvan Broder <broder@mit.edu>
Sun, 3 Jan 2010 21:25:48 +0000 (16:25 -0500)
svn path=/trunk/packages/invirt-iptables/; revision=2861

debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/invirt-iptables.dirs [new file with mode: 0644]
debian/invirt-iptables.init [new file with mode: 0755]
debian/rules [new file with mode: 0755]

diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..493d73e
--- /dev/null
@@ -0,0 +1,6 @@
+invirt-iptables (1) unstable; urgency=low
+
+  * Initial Release.
+
+ -- Evan Broder <broder@mit.edu>  Sun, 03 Jan 2010 15:13:00 -0600
+
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..5572c28
--- /dev/null
@@ -0,0 +1,13 @@
+Source: invirt-iptables
+Section: base
+Priority: extra
+Maintainer: Invirt project <invirt@mit.edu>
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.2.0)
+Standards-Version: 3.8.3
+
+Package: invirt-iptables
+Architecture: all
+Depends: ${misc:Depends}, iptables
+Description: Invirt iptables rules
+ This package allows other packages to distribute iptables rules to be
+ loaded idempotently and atomically at startup.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..361ca8f
--- /dev/null
@@ -0,0 +1,16 @@
+This software was written as part of the Invirt project <invirt@mit.edu>.
+
+Copyright :
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+On Debian systems, the complete text of the GNU General Public License
+can be found in the file /usr/share/common-licenses/GPL.
diff --git a/debian/invirt-iptables.dirs b/debian/invirt-iptables.dirs
new file mode 100644 (file)
index 0000000..f398222
--- /dev/null
@@ -0,0 +1 @@
+usr/share/invirt-iptables/rules.d
diff --git a/debian/invirt-iptables.init b/debian/invirt-iptables.init
new file mode 100755 (executable)
index 0000000..916dda3
--- /dev/null
@@ -0,0 +1,41 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          invirt-iptables
+# Required-Start:    $local_fs $remote_fs
+# Required-Stop:     $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Invirt iptables rules
+# Description:       
+### END INIT INFO
+
+NAME=invirt-iptables
+DESC="Invirt iptables rules"
+RULES=/usr/share/invirt-iptables/rules.d
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+
+dpkg -s "$NAME" >/dev/null 2>/dev/null || exit 0
+
+. /lib/init/std-init.sh
+
+do_start()
+{
+        echo 1 > /proc/sys/net/ipv4/ip_forward
+
+        for table in $(sed -ne 's/^*//p' $(run-parts --list "$RULES")); do
+            iptables -t "$table" -F
+        done
+       cat $(run-parts --list "$RULES") | iptables-restore -n
+}
+
+do_reload()
+{
+       do_start
+}
+
+do_stop()
+{
+       return 0
+}
+
+std_init "$1"
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..0c6ba40
--- /dev/null
@@ -0,0 +1,5 @@
+#!/usr/bin/make -f
+
+DEB_UPDATE_RCD_PARAMS_invirt-iptables = defaults 98 2
+
+include /usr/share/cdbs/1/rules/debhelper.mk