IptablesCommands { 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); }  @Beta // implementation not portable across distros static String iptablesService(String cmd); @Beta // implementation not portable across distros static String iptablesServiceStop(); @Beta // implementation not portable across distros static String iptablesServiceStart(); @Beta // implementation not portable across distros static String iptablesServiceRestart(); @Beta // implementation not portable across distros static String iptablesServiceStatus(); @Beta // implementation not portable across distros static String firewalldService(String cmd); @Beta // implementation not portable across distros static String firewalldServiceStop(); @Beta // implementation not portable across distros static String firewalldServiceStart(); @Beta // implementation not portable across distros static String firewalldServiceRestart(); @Beta // implementation not portable across distros static String firewalldServiceStatus(); @Beta // implementation not portable across distros static String firewalldServiceIsActive(); static String saveIptablesRules(); static String cleanUpIptablesRules(); static String listIptablesRule(); static String insertIptablesRule(Chain chain, org.apache.brooklyn.util.net.Protocol protocol, int port, Policy policy); static String insertIptablesRule(Chain chain, String networkInterface, org.apache.brooklyn.util.net.Protocol protocol, int port, Policy policy); static String appendIptablesRule(Chain chain, org.apache.brooklyn.util.net.Protocol protocol, int port, Policy policy); static String appendIptablesRule(Chain chain, String networkInterface, org.apache.brooklyn.util.net.Protocol protocol, int port, Policy policy); static String addIptablesRule(String direction, Chain chain, Optional<String> networkInterface, org.apache.brooklyn.util.net.Protocol protocol, int port, Policy policy); static String addFirewalldRule(Chain chain, org.apache.brooklyn.util.net.Protocol protocol, int port, Policy policy); static String addFirewalldRule(Chain chain, Optional<String> networkInterface, org.apache.brooklyn.util.net.Protocol protocol, int port, Policy policy);  }
@Test public void testInsertIptablesRules() { Assert.assertEquals(IptablesCommands.insertIptablesRule(Chain.INPUT, "eth0", Protocol.TCP, 3306, Policy.ACCEPT), insertIptablesRule); }
@Test public void testInsertIptablesRulesForAllInterfaces() { Assert.assertEquals(IptablesCommands.insertIptablesRule(Chain.INPUT, Protocol.TCP, 3306, Policy.ACCEPT), insertIptablesRuleAll); }