verinec.netsim.firewall.util.tables.keys
Interface ITableKey

All Known Implementing Classes:
IPKey, SimpleKey, TCPKey, UDPKey

public interface ITableKey

Interface for the different key types of the Hash Table.

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

Method Summary
 boolean equals(Object other)
          Equals methos which overrides @link Object#equals(java.lang.Object) The method was overriden so that the one can compare @link ITableKey Objects.
 String getProtocol()
          Returns the protcol of the packet-key.
 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.
 int hashCode()
          HashCode method which overrides @link Object#hashCode() The method was overriden so that one can compare @link ITableKey Objects.
 TableEntry updateEntry(TableEntry entry, boolean reply, Node node, String hostname)
          Method which updates the connection entry according to the protocol.
 

Method Detail

getProtocol

String getProtocol()
Returns the protcol of the packet-key.

Returns:
protcol type of the packet

equals

boolean equals(Object other)
Equals methos which overrides @link Object#equals(java.lang.Object) The method was overriden so that the one can compare @link ITableKey Objects. This is useful to look for HashTable entries in @link verinec.netsim.firewall.util.tables.StatefulInspection

Overrides:
equals in class Object
Parameters:
other - the Other Object to compare against.
Returns:
True if the two Objects are of the same type and have the same field values.

hashCode

int hashCode()
HashCode method which overrides @link Object#hashCode() The method was overriden so that one can compare @link ITableKey Objects. This is useful to look for HashTable entries in @link verinec.netsim.firewall.util.tables.StatefulInspection

Overrides:
hashCode in class Object
Returns:
The Hashcode of an ITableKey.

handleNew

boolean handleNew(Packet packet,
                  StatefulInspection stateInspect)
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.

handleEstablished

boolean handleEstablished(Packet packet,
                          StatefulInspection stateInspect)
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.

handleRelated

boolean handleRelated(Packet packet,
                      StatefulInspection stateInspect)
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.

updateEntry

TableEntry updateEntry(TableEntry entry,
                       boolean reply,
                       Node node,
                       String hostname)
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.

Copyright © 2005 Verinec, DIUF