verinec.netsim.firewall
Class Firewall
java.lang.Object
verinec.netsim.firewall.Firewall
- All Implemented Interfaces:
- IFirewall
public class Firewall
- extends Object
- implements IFirewall
- Version:
- $Revision: 825 $
- Author:
- jason.hug@unifr.ch
logger
private Logger logger
packetFilters
private PacketFilters packetFilters
- Packet Filters of the Firewall.
Firewall
public Firewall(Element node)
- Creates a new Firewall.
This constructor creates a new Firewall with it's packet-filter ruleset
defined in a node.xml.
- Parameters:
node - Element which specifies the Firewalls configuration.
evalPacket
public IPacketAction evalPacket(Packet packet,
String interfaceRef,
String direction,
Node node,
String simTime,
ILogger eventsLog)
throws DirectionException
- Description copied from interface:
IFirewall
- Runs a packet through the packet-filter which determines what to do with the packet.
This method receives a packet and checks in the defined packet-filter
if there are any rules that match. If so the defined action is returned. If no match
was observed the default policy of the packet-filter is returned.
- Specified by:
evalPacket in interface IFirewall
- Parameters:
packet - Packet to be inspected by the packet-filter.interfaceRef - Specifies from which interface the packet came from. Here the ID-REF attribute of the ethernet-binding element is expected.direction - Specifies in which direction the packet is going. Use FORWARD, IN OUT.node - Node needed to find out in which state a tcp connection is in for stateful inspection.simTime - Simulation time for stateful inspection. Needed to determine when a connection entry timesout.eventsLog - The Verinec Simulator Event logger instance.
- Returns:
- The corresponding
Action
- Throws:
DirectionException - Throws this Exception if the direction specifies does not exist. Use FORWARD, IN OUT.- See Also:
IFirewall.evalPacket(verinec.netsim.entities.packets.Packet, java.lang.String, java.lang.String, verinec.netsim.components.Node, java.lang.String, verinec.netsim.loggers.ILogger)
getPacketFilters
public PacketFilters getPacketFilters()
- Returns:
- Returns the packetFilters.
toString
public String toString()
- This returns a String representation of the Packet.
- Specified by:
toString in interface IFirewall- Overrides:
toString in class Object
- Returns:
- the a String representation of the Packet