net.clackrouter.netutils
Class FilterEntry

java.lang.Object
  extended by net.clackrouter.netutils.FilterEntry

public class FilterEntry
extends java.lang.Object


Nested Class Summary
static class FilterEntry.PacketInfo
           
 
Field Summary
static int ANY_PORT
           
static int PROTO_ANY
           
static int PROTO_TCP
           
static int PROTO_UDP
           
 
Constructor Summary
FilterEntry(java.net.InetAddress a, int port, int proto, java.lang.String vhostname)
           
FilterEntry(java.net.InetAddress a, java.lang.String iface, int port, int proto, java.lang.String vhostname)
           
 
Method Summary
static FilterEntry createFromTopoName(java.lang.String s, TopologyModel topo_model)
          Creates a Filter entry from a configuration string.
static FilterEntry.PacketInfo getPacketInfo(VNSPacket p)
           
 boolean matches(FilterEntry.PacketInfo info)
           
 java.lang.String toString()
          Return this filter as a configuration string (used for serialization) Note: the IP address is not saved, since this is topology dependent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ANY_PORT

public static int ANY_PORT

PROTO_TCP

public static int PROTO_TCP

PROTO_UDP

public static int PROTO_UDP

PROTO_ANY

public static int PROTO_ANY
Constructor Detail

FilterEntry

public FilterEntry(java.net.InetAddress a,
                   int port,
                   int proto,
                   java.lang.String vhostname)

FilterEntry

public FilterEntry(java.net.InetAddress a,
                   java.lang.String iface,
                   int port,
                   int proto,
                   java.lang.String vhostname)
Method Detail

matches

public boolean matches(FilterEntry.PacketInfo info)

toString

public java.lang.String toString()
Return this filter as a configuration string (used for serialization) Note: the IP address is not saved, since this is topology dependent

Overrides:
toString in class java.lang.Object

createFromTopoName

public static FilterEntry createFromTopoName(java.lang.String s,
                                             TopologyModel topo_model)
                                      throws java.lang.Exception
Creates a Filter entry from a configuration string. String format for a filter entry is: [vhost name]:[iface name]:[port]:[proto] port should be any integer (-1 means any port) proto should be either "tcp", "udp", or "any"

Throws:
java.lang.Exception

getPacketInfo

public static FilterEntry.PacketInfo getPacketInfo(VNSPacket p)