|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.Dictionary
java.util.Hashtable
verinec.netsim.firewall.util.tables.StatefulInspection
public class StatefulInspection
Class used for Stateful Inspection.
| Field Summary | |
|---|---|
private String |
hostname
Hostname for which this Stateful Inspection Table belongs to. |
private int |
lastObservedSimTime
Last simulation time observed. |
private Logger |
logger
|
private int |
maxEntries
Defines the maximal entries in the state table |
| Constructor Summary | |
|---|---|
StatefulInspection(int maxEntries,
String hostname)
Creates new Stateful Inspection Hashtable. |
|
| Method Summary | |
|---|---|
boolean |
addToTable(Packet packet,
String direction)
Adds the packet to the corresponding State Table. |
ITableKey |
createKey(Packet packet,
boolean inverse)
Creates a key for a hash table entry. |
String |
getHostname()
|
int |
getLastObservedSimTime()
|
int |
getMaxEntries()
|
ITableKey |
inTable(Packet packet,
String direction)
Checks if a packet already belongs to a connection. |
boolean |
isFull()
Method which checks if the state table has reached the maximum entries. |
boolean |
isReplyPacket(ITableKey key,
Packet packet)
This method checks if a packet is a reply packet of an exisitng connection. |
private void |
setLastObservedSimTime(int lastObservedSimTime)
|
void |
updateEntries(String simTime)
Method which updates all entries in the hash table. |
boolean |
updateEntry(ITableKey key,
boolean reply,
Node node,
String direction)
Method which updates an entry in the state table. |
| Methods inherited from class java.util.Hashtable |
|---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private int maxEntries
private Logger logger
private int lastObservedSimTime
private String hostname
| Constructor Detail |
|---|
public StatefulInspection(int maxEntries,
String hostname)
maxEntries - The maximal entries the stateful inspection table may have.hostname - Hostname to which the Stateful Inspection Table belongs to.| Method Detail |
|---|
public ITableKey inTable(Packet packet,
String direction)
packet - Packet to check.direction - In which direction the packet is traveling.
public boolean isReplyPacket(ITableKey key,
Packet packet)
key - State Table entry's key which should be checked.packet - Packet to check if it is a reply packet of the connection entry.
public boolean addToTable(Packet packet,
String direction)
packet - Packet to add.direction - In which direction the packet is traveling.
public boolean updateEntry(ITableKey key,
boolean reply,
Node node,
String direction)
key - Key to find the Entry in the Hash Table which needs updating.reply - States if the connection entry has seen reply traffic.node - Node object needed to retrieve the socket state of a connection (Needed for TCP connections).direction - In which direction the packet is heading. Use @link verinec.netsim.firewall.IFirewall#IN IN, @link verinec.netsim.firewall.IFirewall#OUT OUT or @link verinec.netsim.firewall.IFirewall#FORWARD FORWARD.
public void updateEntries(String simTime)
simTime - Simulation time. Needed to find out if a connection has timed out.
public ITableKey createKey(Packet packet,
boolean inverse)
packet - Packet from which the key is created from.inverse - If true the source and destination addresses and ports will be inversed at key creation.
public int getMaxEntries()
public boolean isFull()
public int getLastObservedSimTime()
private void setLastObservedSimTime(int lastObservedSimTime)
lastObservedSimTime - The lastObservedSimTime to set.public String getHostname()
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||