com.eurotech.framework.linux.net.iptables
Class LinuxFirewall

java.lang.Object
  extended by com.eurotech.framework.linux.net.iptables.LinuxFirewall

public class LinuxFirewall
extends Object

Implementation class for the ILinuxFirewallService

Author:
eurotech

Method Summary
 void addCustomRule(String rule)
           
 void addLocalRule(int port, String protocol, String permittedNetwork, String permittedNetworkPrefix, String permittedMAC, String sourcePortRange)
           
 void addLocalRule(String portRange, String protocol, String permittedNetwork, String permittedNetworkPrefix, String permittedMAC, String sourcePortRange)
           
 void addNatRule(String sourceInterface, String destinationInterface, boolean masquerade)
           
 void addPortForwardRule(String iface, String address, String protocol, int inPort, int outPort, String permittedNetwork, String permittedNetworkPrefix, String permittedMAC, String sourcePortRange)
           
 void allowIcmp()
           
 void blockAllPorts()
           
 void createFile(String file1)
           
 void deleteAllLocalRules()
           
 void deleteAllNatRules()
           
 void deleteAllPortForwardRules()
           
 void deleteLocalRule(LocalRule rule)
           
 void deleteNatRule(NATRule rule)
           
 void deletePortForwardRule(PortForwardRule rule)
           
 void disable()
           
 void disableForwarding()
           
 void disableIcmp()
           
 void enable()
           
 void enableForwarding()
           
static LinuxFirewall getInstance()
           
 Set<LocalRule> getLocalRules()
           
 Set<NATRule> getNatRules()
           
 Set<PortForwardRule> getPortForwardRules()
           
 ArrayList<String> readFileLinebyLine(String sourceFile)
           
 void replaceAllNatRules(LinkedHashSet<NATRule> newNatRules)
           
 void unblockAllPorts()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static LinuxFirewall getInstance()

readFileLinebyLine

public ArrayList<String> readFileLinebyLine(String sourceFile)

createFile

public void createFile(String file1)
                throws EsfException
Throws:
EsfException

addCustomRule

public void addCustomRule(String rule)
                   throws EsfException
Throws:
EsfException

addLocalRule

public void addLocalRule(int port,
                         String protocol,
                         String permittedNetwork,
                         String permittedNetworkPrefix,
                         String permittedMAC,
                         String sourcePortRange)
                  throws EsfException
Throws:
EsfException

addLocalRule

public void addLocalRule(String portRange,
                         String protocol,
                         String permittedNetwork,
                         String permittedNetworkPrefix,
                         String permittedMAC,
                         String sourcePortRange)
                  throws EsfException
Throws:
EsfException

addPortForwardRule

public void addPortForwardRule(String iface,
                               String address,
                               String protocol,
                               int inPort,
                               int outPort,
                               String permittedNetwork,
                               String permittedNetworkPrefix,
                               String permittedMAC,
                               String sourcePortRange)
                        throws EsfException
Throws:
EsfException

addNatRule

public void addNatRule(String sourceInterface,
                       String destinationInterface,
                       boolean masquerade)
                throws EsfException
Throws:
EsfException

getLocalRules

public Set<LocalRule> getLocalRules()
                             throws EsfException
Throws:
EsfException

getPortForwardRules

public Set<PortForwardRule> getPortForwardRules()
                                         throws EsfException
Throws:
EsfException

getNatRules

public Set<NATRule> getNatRules()
                         throws EsfException
Throws:
EsfException

deleteLocalRule

public void deleteLocalRule(LocalRule rule)
                     throws EsfException
Throws:
EsfException

deletePortForwardRule

public void deletePortForwardRule(PortForwardRule rule)
                           throws EsfException
Throws:
EsfException

deleteNatRule

public void deleteNatRule(NATRule rule)
                   throws EsfException
Throws:
EsfException

deleteAllLocalRules

public void deleteAllLocalRules()
                         throws EsfException
Throws:
EsfException

deleteAllPortForwardRules

public void deleteAllPortForwardRules()
                               throws EsfException
Throws:
EsfException

replaceAllNatRules

public void replaceAllNatRules(LinkedHashSet<NATRule> newNatRules)
                        throws EsfException
Throws:
EsfException

deleteAllNatRules

public void deleteAllNatRules()
                       throws EsfException
Throws:
EsfException

blockAllPorts

public void blockAllPorts()
                   throws EsfException
Throws:
EsfException

unblockAllPorts

public void unblockAllPorts()
                     throws EsfException
Throws:
EsfException

enable

public void enable()
            throws EsfException
Throws:
EsfException

disable

public void disable()
             throws EsfException
Throws:
EsfException

allowIcmp

public void allowIcmp()

disableIcmp

public void disableIcmp()

enableForwarding

public void enableForwarding()

disableForwarding

public void disableForwarding()


Copyright © 2013. All Rights Reserved.