verinec.netsim.firewall.util.tables.keys
Class IPKey

java.lang.Object
  extended by verinec.netsim.firewall.util.tables.keys.SimpleKey
      extended by verinec.netsim.firewall.util.tables.keys.IPKey
All Implemented Interfaces:
ITableKey

public class IPKey
extends SimpleKey

Version:
$Revision: 825 $
Author:
jason.hug@unifr.ch

Field Summary
static int IP_TIMEOUT
          Default time out value for IP-connections (Default Connections)
 
Fields inherited from class verinec.netsim.firewall.util.tables.keys.SimpleKey
CONFIG_FILE_NAME
 
Constructor Summary
IPKey(IAddress src, IAddress dst)
          Creates a new IP Key for the Hash Table.
 
Method Summary
 boolean handleEstablished(Packet packet, StatefulInspection stateInspect)
          Method which checks if a packet is in the NEW satet of the appropriate packet's protocol.
 boolean handleNew(Packet packet, StatefulInspection stateInspect)
          Method which checks if a packet is in the ESTABLISHED satet of the appropriate packet's protocol.
 boolean handleRelated(Packet packet, StatefulInspection stateInspect)
          Method which checks if a packet is in the RELATED satet of the appropriate packet's protocol.
static Element initTimeouts(Document doc)
          Method which loads the timeout values from a config document.
 TableEntry updateEntry(TableEntry entry, boolean reply, Node node, String hostname)
          Method which updates the connection entry according to the protocol.
 
Methods inherited from class verinec.netsim.firewall.util.tables.keys.SimpleKey
equals, getDirection, getDst, getLogger, getProtocol, getSrc, hashCode, loadTimeouts, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

IP_TIMEOUT

public static int IP_TIMEOUT
Default time out value for IP-connections (Default Connections)

Constructor Detail

IPKey

public IPKey(IAddress src,
             IAddress dst)
Creates a new IP Key for the Hash Table.

Parameters:
src - Source address of the IP Packet.
dst - Destination address of the IP Packet.
Method Detail

handleNew

public boolean handleNew(Packet packet,
                         StatefulInspection stateInspect)
Description copied from interface: ITableKey
Method which checks if a packet is in the ESTABLISHED satet of the appropriate packet's protocol.

Parameters:
packet - Packet which is checked for its state.
stateInspect - State Table with all the connection entries of the node.
Returns:
True if the packet is consider ESTABLISHED false otherwise.
See Also:
ITableKey.handleNew(verinec.netsim.entities.packets.Packet, verinec.netsim.firewall.util.tables.StatefulInspection)

handleEstablished

public boolean handleEstablished(Packet packet,
                                 StatefulInspection stateInspect)
Description copied from interface: ITableKey
Method which checks if a packet is in the NEW satet of the appropriate packet's protocol.

Parameters:
packet - Packet which is checked for its state.
stateInspect - State Table with all the connection entries of the node.
Returns:
True if the packet is consider NEW false otherwise.
See Also:
ITableKey.handleEstablished(verinec.netsim.entities.packets.Packet, verinec.netsim.firewall.util.tables.StatefulInspection)

handleRelated

public boolean handleRelated(Packet packet,
                             StatefulInspection stateInspect)
Description copied from interface: ITableKey
Method which checks if a packet is in the RELATED satet of the appropriate packet's protocol.

Parameters:
packet - Packet which is checked for its state.
stateInspect - State Table with all the connection entries of the node.
Returns:
True if the packet is consider RELATED false otherwise.
See Also:
ITableKey.handleRelated(verinec.netsim.entities.packets.Packet, verinec.netsim.firewall.util.tables.StatefulInspection)

updateEntry

public TableEntry updateEntry(TableEntry entry,
                              boolean reply,
                              Node node,
                              String hostname)
Description copied from interface: ITableKey
Method which updates the connection entry according to the protocol. The timeout value for the connection is set according to the protocol. Furthermore the state of the connection is updated if needed.

Parameters:
entry - Entry to update.
reply - If we are dealing with a reply packet.
node - Node object needed to retrieve the socket state of a connection (Needed for TCP connections).
hostname - Hostname for which the Stateful Inspection Table is active.
Returns:
The new entry, where the timeout value and the state of the connection has been newly set.
See Also:
ITableKey.updateEntry(verinec.netsim.firewall.util.tables.TableEntry, boolean, verinec.netsim.components.Node, java.lang.String)

initTimeouts

public static Element initTimeouts(Document doc)
Method which loads the timeout values from a config document. This method loads each states timeout value which was stored within a config document. The loaded parameters are returned as an Element.

Parameters:
doc - The document where the timeout values are stored. If doc is null the default values will be used.
Returns:
The loaded values stored in an Element.

Copyright © 2005 Verinec, DIUF