-struct pluginfuncs p;
-
-int garden_session(sessiont *s, int flag);
-
-char *init_commands[] = {
- // This is for incoming connections to a gardened user
- "iptables -t nat -N garden_users 2>&1 >/dev/null",
- "iptables -t nat -F garden_users 2>&1 >/dev/null",
- "iptables -t nat -N garden 2>&1 >/dev/null",
- "iptables -t nat -A l2tpns -j garden_users",
- NULL
+static struct pluginfuncs *p = 0;
+
+static int iam_master = 0; // We're all slaves! Slaves I tell you!
+
+char *up_commands[] = {
+ "iptables -t nat -N garden >/dev/null 2>&1", // Create a chain that all gardened users will go through
+ "iptables -t nat -F garden",
+ ". " PLUGINCONF "/build-garden", // Populate with site-specific DNAT rules
+ "iptables -t nat -N garden_users >/dev/null 2>&1",// Empty chain, users added/removed by garden_session
+ "iptables -t nat -F garden_users",
+ "iptables -t nat -A PREROUTING -j garden_users", // DNAT any users on the garden_users chain
+ NULL,