|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The ILinuxFirewallservice is used to set up firewall settings . To setup the firewall settings setup the respective parameter using the add methods and then use the method writefile. Also use writefile after you use the delete calls. CONFIGURATION Rule specific configuration parameters are detailed in the documentation of each rule class. Firewall configurations will consist of one or more rule configurations.
Field Summary | |
static java.lang.String |
SERVICE_NAME
service name of this interface for the bundle activator (com.esf.networking.firewall.service) |
Method Summary | |
void |
addLocalRule(int port,
java.lang.String protocol,
java.lang.String permittedNetwork,
java.lang.String permittedMAC,
java.lang.String sourcePortRange,
int persistence)
Adds a new Local Port rule to the firewall, to allow incoming port connections. |
void |
addNatRule(java.lang.String sourceNetwork,
java.lang.String sourceInterface,
java.lang.String destinationInterface,
boolean masquerade,
int persistence)
Adds a new Network Address Translation rule to the firewall. |
void |
addPortForwardRule(java.lang.String iface,
java.lang.String address,
java.lang.String protocol,
int inPort,
int outPort,
java.lang.String permittedNetwork,
java.lang.String permittedMAC,
java.lang.String sourcePortRange,
int persistence)
Adds a new Port Forwarding rule to firewall. |
void |
blockAllPorts(int persistence)
blocks all ports in the firewall configuration. |
void |
deleteAllLocalRules(int persistence)
Removes all Local Port rules from this firewall configuration. |
void |
deleteAllNatRules(int persistence)
Removes all Network Address Translation rules from this firewall configuration. |
void |
deleteAllPortForwardRules(int persistence)
Removes all Port Forwarding rules from this firewall configuration. |
void |
deleteLocalRule(int index,
int persistence)
Deletes a Local Rule from this firewall configuration. |
void |
deleteNatRule(int index,
int persistence)
Deletes a Network Address Translation rule from this firewall configuration. |
void |
deletePortForwardRule(int index,
int persistence)
Deletes a Port Forwarding rule from this firewall configuration. |
java.util.ArrayList |
getLocalRules(int persistence)
Gets a list of all Local Port rules from this firewall configuration. |
java.util.ArrayList |
getNatRules(int persistence)
Gets a list of all Network Address Translation rules from this firewall configuration. |
java.util.ArrayList |
getPortForwardRules(int persistence)
Gets a list of all Port Forwarding rules from this firewall configuration. |
void |
unblockAllPorts(int persistence)
unblocks all ports in the firewall configuration. |
void |
writeFile(int persistence)
Writes a new firewall configuration file. |
Field Detail |
public static final java.lang.String SERVICE_NAME
Method Detail |
public void writeFile(int persistence) throws java.lang.Exception
persistence
- = persistence definition
java.lang.Exception
- If any access errors occur.public void addLocalRule(int port, java.lang.String protocol, java.lang.String permittedNetwork, java.lang.String permittedMAC, java.lang.String sourcePortRange, int persistence) throws java.lang.Exception
persistence
- = persistence definitionport
- local port number for the incoming connectionprotocol
- network protocol, as String
permittedNetwork
- permitted source IP address or network, as
String
permittedMAC
- permitted source MAC address, as String
sourcePortRange
- permitted source port range for incoming
connection, as String
java.lang.Exception
- If rule cannot be addedpublic void addPortForwardRule(java.lang.String iface, java.lang.String address, java.lang.String protocol, int inPort, int outPort, java.lang.String permittedNetwork, java.lang.String permittedMAC, java.lang.String sourcePortRange, int persistence) throws java.lang.Exception
persistence
- = persistence definitioniface
- source interface name, as String
address
- destination IP address to forward to, as
String
protocol
- network protocol, as String
inPort
- incoming IP portoutPort
- forwarded destination IP portpermittedNetwork
- permitted source IP address or network, as
String
permittedMAC
- permitted source MAC address, as String
sourcePortRange
- permitted source port range for incoming
connection, as String
java.lang.Exception
- If rule cannot be addedpublic void addNatRule(java.lang.String sourceNetwork, java.lang.String sourceInterface, java.lang.String destinationInterface, boolean masquerade, int persistence) throws java.lang.Exception
persistence
- = persistence definitionsourceNetwork
- source IP address or network, as String
sourceInterface
- source interface name, as String
destinationInterface
- destination interface name, as
String
masquerade
- add masquerade entry, as boolean
java.lang.Exception
- If rule cannot be addedpublic java.util.ArrayList getLocalRules(int persistence) throws java.lang.Exception
persistence
- = persistence definition
ArrayList
of Local Port rules
java.lang.Exception
- If unable to get Local Port rulespublic java.util.ArrayList getPortForwardRules(int persistence) throws java.lang.Exception
persistence
- = persistence definition
ArrayList
of Port Forwarding rules
java.lang.Exception
- If unable to get Port Forwarding rulespublic java.util.ArrayList getNatRules(int persistence) throws java.lang.Exception
persistence
- = persistence definition
ArrayList
of NAT rules
java.lang.Exception
- If unable to get NAT rulespublic void deleteLocalRule(int index, int persistence) throws java.lang.Exception
index
- index in the ArrayList
of the Local Rule to be
deletedpersistence
- = persistence definition
java.lang.Exception
- If unable to delete Local Rulepublic void deletePortForwardRule(int index, int persistence) throws java.lang.Exception
index
- index in the ArrayList
of the Port Forwarding
rule to be deletedpersistence
- = persistence definition
java.lang.Exception
- If unable to delete Port Forwarding rulepublic void deleteNatRule(int index, int persistence) throws java.lang.Exception
index
- index in the ArrayList
of the NAT rule to be
deletedpersistence
- = persistence definition
java.lang.Exception
- If unable to delete NAT rulepublic void deleteAllLocalRules(int persistence) throws java.lang.Exception
persistence
- = persistence definition
java.lang.Exception
- If unable to delete all Local Port rulespublic void deleteAllPortForwardRules(int persistence) throws java.lang.Exception
persistence
- = persistence definition
java.lang.Exception
- If unable to delete all Port Forwarding rulespublic void deleteAllNatRules(int persistence) throws java.lang.Exception
persistence
- = persistence definition
java.lang.Exception
- If unable to delete all NAT rulespublic void blockAllPorts(int persistence) throws java.lang.Exception
persistence
- = persistence definition
java.lang.Exception
- If unable to block all portspublic void unblockAllPorts(int persistence) throws java.lang.Exception
persistence
- = persistence definition
java.lang.Exception
- If unable to unblock all ports
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |