|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectverinec.netsim.firewall.PacketFilters
public class PacketFilters
| Field Summary | |
|---|---|
private String |
forward
reference-string to the forward chain specified from the node.xml |
private PacketFilterChain |
forward_chain
reference to the global FORWARD chain object |
private String |
globalin
reference-string to the global INPUT chain specified from the node.xml |
private String |
globalout
reference-string to the global OUTPUT chain specified from the node.xml |
private String |
hostname
Hostname of the node. |
private PacketFilterChain |
input_chain
reference to the global INPUT chain object |
private InterfaceFilterMappings |
interfaceFilterMappings
Stores the Interface Filter Mappings |
private Logger |
logger
|
private PacketFilterChain |
output_chain
reference to the global OUTPUT chain object |
private Vector |
packetFilterChains
Stores all available Filter-Chains |
private String |
simTime
Current simulation time of the node. |
| Constructor Summary | |
|---|---|
protected |
PacketFilters(Element node,
String hostname)
Creates a new Packet Filter. |
protected |
PacketFilters(String hostname)
Creates a packet-filter which accepts everything. |
| Method Summary | |
|---|---|
private void |
addPacketFilterChain(PacketFilterChain chain)
Adds a chain to the Packet-Filter-Chains |
PacketFilterChain |
getForward_chain()
|
String |
getForward()
Retrieves the global forward interface |
String |
getGlobalin()
Retrieves the global-in interface |
String |
getGlobalout()
Retrieves the global-out interface |
String |
getHostname()
|
PacketFilterChain |
getInput_chain()
|
InterfaceFilterMappings |
getInterfaceFilterMappings()
Gets the interface-filter-mappings |
PacketFilterChain |
getOutput_chain()
|
private PacketFilterChain |
getPacketFilterChain(String id)
Returns the chain that corresponds to the given ID. |
Vector |
getPacketFilterChains()
Gets the packet-filter-chains |
String |
getSimTime()
|
private PacketFilterChain |
initDefaultChain(String name)
Creates a Default chain and adds it to the PacketFilterChain. |
private void |
initPacketFilterChain(Element node)
Method to init the packet-filter-chain |
private void |
InitStatefulInspection(Element node)
Method which inits Stateful inspection. |
IPacketAction |
matchAction(Packet packet,
String interfaceRef,
String direction,
Node node,
String simTime,
ILogger eventsLog)
This method receives a packet and checks in the defined packet-filter-chains if there are any rules that match. |
void |
setForward(String forward)
Set the forward interface |
void |
setGlobalin(String globalin)
Sets the global-in interface |
void |
setGlobalout(String globalout)
Sets the global-out interface |
void |
setInterfaceFilterMappings(InterfaceFilterMappings interfaceFilterMappings)
Sets the interface-filter-mappings |
void |
setPacketFilterChains(Vector packetFilterChains)
Sets the packet-filter-chains |
void |
setSimTime(String simTime)
|
private void |
statefulInspection(Packet packet,
IPacketAction action,
String direction,
Node node,
String simTime)
Method which handles the Stateful Inspection's HashTable for the packet-filter. |
String |
toString()
|
private IPacketAction |
traverseChain(Packet packet,
String interfaceRef,
String direction,
PacketFilterChain chain,
ILogger eventsLog)
Traverse Chain picks out the referenced chain and traverses it. |
private IPacketAction |
traverseDefaultChain(Packet packet,
String interfaceRef,
String direction,
ILogger eventsLog)
Traverses the corresponding default chain. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private Logger logger
private String globalout
private PacketFilterChain output_chain
private String globalin
private PacketFilterChain input_chain
private String forward
private PacketFilterChain forward_chain
private InterfaceFilterMappings interfaceFilterMappings
private Vector packetFilterChains
private String hostname
private String simTime
| Constructor Detail |
|---|
protected PacketFilters(Element node,
String hostname)
node - Element which specifies the Packet Filters configurations.hostname - To be configured node's hostnameprotected PacketFilters(String hostname)
hostname - To be configured node's hostname| Method Detail |
|---|
public IPacketAction matchAction(Packet packet,
String interfaceRef,
String direction,
Node node,
String simTime,
ILogger eventsLog)
packet - Packet that should be inspected.interfaceRef - From which interface the packet came from.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.node - Node needed for stateful inspection. With this we are able to retrieve the states of the TCP connections.simTime - Simulation time. Needed for stateful inspection, so that we know when a connection times out.eventsLog - The Verinec Simulator Event logger instance.
private void statefulInspection(Packet packet,
IPacketAction action,
String direction,
Node node,
String simTime)
packet - Packet entry to add or update.action - Action to check if the packet was ACCEPTED by the packet-filter.direction - In which direction the packet is heading.node - Node needed for stateful inspection. With this we are able to retrieve the states of the TCP connections.simTime - Simulation time. Needed for stateful inspection, so that we know when a connection times out.
private IPacketAction traverseChain(Packet packet,
String interfaceRef,
String direction,
PacketFilterChain chain,
ILogger eventsLog)
packet - the packet to match with the rulesinterfaceRef - From which interface the packet was recieved on.direction - In which direction the packet is going (in, out, forward).chain - The chain to traverseeventsLog - The Verinec Simulator Event logger instance.
private IPacketAction traverseDefaultChain(Packet packet,
String interfaceRef,
String direction,
ILogger eventsLog)
packet - Packet which needs to be checked by the rules.interfaceRef - From which interface the packet was recieved on.direction - In what direction the the packet is moving (in, out, forward).eventsLog - The Verinec Simulator Event logger instance.
private void InitStatefulInspection(Element node)
node - Element which specifies the Packet Filters configurations.private void initPacketFilterChain(Element node)
node - specifies all the needed configurations for the Packet-Filter-Chainprivate PacketFilterChain initDefaultChain(String name)
name - Name of the default chain.
public String getGlobalout()
public void setGlobalout(String globalout)
globalout - The new global-out interfacepublic String getGlobalin()
public void setGlobalin(String globalin)
globalin - the new global-on interfacepublic String getForward()
public void setForward(String forward)
forward - public InterfaceFilterMappings getInterfaceFilterMappings()
public void setInterfaceFilterMappings(InterfaceFilterMappings interfaceFilterMappings)
interfaceFilterMappings - The interfaceFilterMappings to set.public Vector getPacketFilterChains()
private PacketFilterChain getPacketFilterChain(String id)
id - ID referencing the chain.
public void setPacketFilterChains(Vector packetFilterChains)
packetFilterChains - The packetFilterChains to set.private void addPacketFilterChain(PacketFilterChain chain)
chain - PacketFilterChain to be addedpublic PacketFilterChain getForward_chain()
public PacketFilterChain getInput_chain()
public PacketFilterChain getOutput_chain()
public String toString()
toString in class ObjectObject.toString()public String getHostname()
public String getSimTime()
public void setSimTime(String simTime)
simTime - The simTime to set.
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||