/** * Returns the command that appends a rule to iptables to all interfaces. * * @return Returns the command that appends a rule to iptables. */ public static String appendIptablesRule(Chain chain, org.apache.brooklyn.util.net.Protocol protocol, int port, Policy policy) { return addIptablesRule("-A", chain, Optional.<String> absent(), protocol, port, policy); }
/** * Returns the command that inserts a rule on top of the iptables' rules to all interfaces. * * @return Returns the command that inserts a rule on top of the iptables' * rules. */ public static String insertIptablesRule(Chain chain, org.apache.brooklyn.util.net.Protocol protocol, int port, Policy policy) { return addIptablesRule("-I", chain, Optional.<String> absent(), protocol, port, policy); }
/** * Returns the command that inserts a rule on top of the iptables' rules. * * @return Returns the command that inserts a rule on top of the iptables' * rules. */ public static String insertIptablesRule(Chain chain, String networkInterface, org.apache.brooklyn.util.net.Protocol protocol, int port, Policy policy) { return addIptablesRule("-I", chain, Optional.of(networkInterface), protocol, port, policy); }
/** * Returns the command that appends a rule to iptables. * * @return Returns the command that appends a rule to iptables. */ public static String appendIptablesRule(Chain chain, String networkInterface, org.apache.brooklyn.util.net.Protocol protocol, int port, Policy policy) { return addIptablesRule("-A", chain, Optional.of(networkInterface), protocol, port, policy); }
/** @deprecated since 0.7.0; use {@link #addIptablesRule(String, Chain, Optional, org.apache.brooklyn.util.net.Protocol, int, Policy)} */ @Deprecated public static String addIptablesRule(String direction, Chain chain, Optional<String> networkInterface, Protocol protocol, int port, Policy policy) { return addIptablesRule(direction, chain, networkInterface, protocol.convert(), port, policy); }