SourceForge Jpcap

net.sourceforge.jpcap.capture
Enum PacketCapture.Direction

java.lang.Object
  extended by java.lang.Enum<PacketCapture.Direction>
      extended by net.sourceforge.jpcap.capture.PacketCapture.Direction
All Implemented Interfaces:
Serializable, Comparable<PacketCapture.Direction>
Enclosing class:
PacketCapture

public static enum PacketCapture.Direction
extends Enum<PacketCapture.Direction>

Capture Direction enumeration. This is used in the PacketCapture.setDirection(net.sourceforge.jpcap.capture.PacketCapture.Direction) method to determine the 'direction' of packet capture, i.e. whether to capture packets coming in, going out, or both. The values of these correspond with the same items in pcap.h.

Since:
2.0.0

Enum Constant Summary
PCAP_D_IN
          PCAP_D_IN will only capture packets received by the device.
PCAP_D_INOUT
          PCAP_D_INOUT will capture packets received by or sent by the device.
PCAP_D_OUT
          PCAP_D_OUT will only capture packets sent by the device.
 
Method Summary
static PacketCapture.Direction valueOf(String name)
          Returns the enum constant of this type with the specified name.
static PacketCapture.Direction[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

PCAP_D_INOUT

public static final PacketCapture.Direction PCAP_D_INOUT
PCAP_D_INOUT will capture packets received by or sent by the device.


PCAP_D_IN

public static final PacketCapture.Direction PCAP_D_IN
PCAP_D_IN will only capture packets received by the device.


PCAP_D_OUT

public static final PacketCapture.Direction PCAP_D_OUT
PCAP_D_OUT will only capture packets sent by the device.

Method Detail

values

public static final PacketCapture.Direction[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(PacketCapture.Direction c : PacketCapture.Direction.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static PacketCapture.Direction valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name

Copyright © Patrick Charles & Jonas Lehmann, 2001; Esmond Pitt, 2008.