verinec.netsim.firewall.packetFilter
Class InterfaceFilterMappings

java.lang.Object
  extended by verinec.netsim.firewall.packetFilter.InterfaceFilterMappings

public class InterfaceFilterMappings
extends Object

Maps interfaces to the packet-filter

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

Field Summary
private  Logger logger
           
private  Vector mappings
           
 
Constructor Summary
InterfaceFilterMappings(Element node)
          Creates a new Interface Filter Mappings.
 
Method Summary
private  boolean doubleEntry(IfMap map)
          Checks wether the specified map has the same direction and interface as another one.
 Vector getMappings()
          Return the interface filter mappings (if-map)
private  void initIfMaps(Element node)
          Initializes the If-Maps and checks wether two identical entries were defined.
 String matchChain(String interf, String direction)
          Matches interface and direction to the corresponding chain.
 void setMappings(Vector mappings)
          Sets new interface filter mappings (if-map)
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mappings

private Vector mappings

logger

private Logger logger
Constructor Detail

InterfaceFilterMappings

public InterfaceFilterMappings(Element node)
Creates a new Interface Filter Mappings. This consists of one or more IfMaps. The IfMaps configuration is defined in the node.

Parameters:
node - Element which specifies the IfMaps configuration.
Method Detail

initIfMaps

private void initIfMaps(Element node)
                 throws InterfaceFilterMappingsException
Initializes the If-Maps and checks wether two identical entries were defined.

Parameters:
node -
Throws:
InterfaceFilterMappingsException

doubleEntry

private boolean doubleEntry(IfMap map)
Checks wether the specified map has the same direction and interface as another one.

Parameters:
map - The map entry to check.
Returns:
True if the map entry is identical to another one. False otherwise.

matchChain

public String matchChain(String interf,
                         String direction)
Matches interface and direction to the corresponding chain. Checks if a defined interface-filter-mapping corresponds to the given interface and direction.

Parameters:
interf - The interface to match.
direction - The direction to match.
Returns:
Chain Name of the chain corresponding to the given interface and direction. Null if no match was found.

getMappings

public Vector getMappings()
Return the interface filter mappings (if-map)

Returns:
Returns the mappings.

setMappings

public void setMappings(Vector mappings)
Sets new interface filter mappings (if-map)

Parameters:
mappings - The mappings to set.

toString

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

Copyright © 2005 Verinec, DIUF