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

java.lang.Object
  extended by verinec.netsim.firewall.util.tables.keys.SimpleKey
All Implemented Interfaces:
ITableKey
Direct Known Subclasses:
IPKey, TCPKey, UDPKey

public abstract class SimpleKey
extends Object
implements ITableKey

SimpleKey class. used to create keys for the Stateful Inspection HashTable. Simple Key consists of the protocol, destination and source address of a packet which is added to the Hash Table.

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

Field Summary
static String CONFIG_FILE_NAME
          File name of the preferences file where the timeout values are stored.
private  String direction
          Direction in which the packet is traveling.
private  IAddress dst
          Destination address of the packet.
private  Logger logger
           
private  String protocol
          Protocol of the packet.
private  IAddress src
          Source address of the packet.
 
Constructor Summary
SimpleKey(String protocol, IAddress src, IAddress dst)
          Creates a Key for a HashTable entry.
 
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 getDirection()
          Get the direction in which the packet is traveling.
 IAddress getDst()
          Gets destination address of the key's packet.
 Logger getLogger()
           
 String getProtocol()
          Returns the protcol of the packet-key.
 IAddress getSrc()
          Gets source address of the key's packet.
 int hashCode()
          HashCode method which overrides @link Object#hashCode() The method was overriden so that one can compare @link ITableKey Objects.
static void loadTimeouts()
          Method which loads the timeout values for each protocol.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface verinec.netsim.firewall.util.tables.keys.ITableKey
handleEstablished, handleNew, handleRelated, updateEntry
 

Field Detail

logger

private Logger logger

protocol

private String protocol
Protocol of the packet.


src

private IAddress src
Source address of the packet.


dst

private IAddress dst
Destination address of the packet.


direction

private String direction
Direction in which the packet is traveling.


CONFIG_FILE_NAME

public static final String CONFIG_FILE_NAME
File name of the preferences file where the timeout values are stored.

See Also:
Constant Field Values
Constructor Detail

SimpleKey

public SimpleKey(String protocol,
                 IAddress src,
                 IAddress dst)
Creates a Key for a HashTable entry.

Parameters:
protocol - Type of network protocol the key is used for.
src - Source address of the packet.
dst - Destination address of the packet.
Method Detail

getDst

public IAddress getDst()
Gets destination address of the key's packet.

Returns:
Returns the dst.

getSrc

public IAddress getSrc()
Gets source address of the key's packet.

Returns:
Returns the src.

getProtocol

public String getProtocol()
Description copied from interface: ITableKey
Returns the protcol of the packet-key.

Specified by:
getProtocol in interface ITableKey
Returns:
protcol type of the packet
See Also:
ITableKey.getProtocol()

getDirection

public String getDirection()
Get the direction in which the packet is traveling.

Returns:
Returns the direction.

equals

public boolean equals(Object other)
Description copied from interface: ITableKey
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

Specified by:
equals in interface ITableKey
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.
See Also:
ITableKey.equals(java.lang.Object)

hashCode

public int hashCode()
Description copied from interface: ITableKey
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

Specified by:
hashCode in interface ITableKey
Overrides:
hashCode in class Object
Returns:
The Hashcode of an ITableKey.
See Also:
ITableKey.hashCode()

loadTimeouts

public static void loadTimeouts()
Method which loads the timeout values for each protocol. The timeout values are stored within a config file found in the VeriNeC repository.


getLogger

public Logger getLogger()
Returns:
Returns the logger.

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

Copyright © 2005 Verinec, DIUF