jnetpcap.capture
Enum DataEncapsulation

java.lang.Object
  extended by java.lang.Enum<DataEncapsulation>
      extended by jnetpcap.capture.DataEncapsulation
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<DataEncapsulation>

public enum DataEncapsulation
extends java.lang.Enum<DataEncapsulation>

DLT (Data Link Type) specifies the type of data link protocol that encapsulates the packet data. This is the first protocol that needs to be decoded in the packet buffer as with the call CapturePacket.getDataBuffer(). The datalink protocol attached is typically supplied by the network interface that captured the packet although other types exist where the first protocol does not actually map to a Data Link at all. For example when a user strips off the original DLT or a driver used some kind custom encapsulating structure around the packet data.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Enum Constant Summary
ARCNET
           
ARCNET_LINUX
           
ATM_RFC1483
           
C_HDLC
           
EN10MB
           
FDDI
           
FRELAY
           
IEEE802
           
IEEE802_11
           
IEEE802_11_RADIO
           
IP_OVER_FC
           
LINUX_IRDA
           
LINUX_SLL
           
LOOP
           
LTALK
           
NULL_BSD
           
PFLOG
           
PPP
           
PPP_ETHER
           
PPP_SERIAL
           
PRISM_HEADER
           
RAW
           
SLIP
           
SUNATM
           
 
Method Summary
 java.lang.String getDescription()
           
 int translateTo(FileType type)
          Translates the standard DLT value into a native DLT integer value for the file type specified.
static DataEncapsulation valueOf(FileType type, int nativeDLT)
          Translates a an integer value that represents a data link or encapsulation protocol number that is specific for each file type into standard Capture framework DLT enum entry.
static DataEncapsulation valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static DataEncapsulation[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NULL_BSD

public static final DataEncapsulation NULL_BSD

EN10MB

public static final DataEncapsulation EN10MB

IEEE802

public static final DataEncapsulation IEEE802

ARCNET

public static final DataEncapsulation ARCNET

SLIP

public static final DataEncapsulation SLIP

PPP

public static final DataEncapsulation PPP

FDDI

public static final DataEncapsulation FDDI

ATM_RFC1483

public static final DataEncapsulation ATM_RFC1483

RAW

public static final DataEncapsulation RAW

PPP_SERIAL

public static final DataEncapsulation PPP_SERIAL

PPP_ETHER

public static final DataEncapsulation PPP_ETHER

C_HDLC

public static final DataEncapsulation C_HDLC

IEEE802_11

public static final DataEncapsulation IEEE802_11

FRELAY

public static final DataEncapsulation FRELAY

LOOP

public static final DataEncapsulation LOOP

LINUX_SLL

public static final DataEncapsulation LINUX_SLL

LTALK

public static final DataEncapsulation LTALK

PFLOG

public static final DataEncapsulation PFLOG

PRISM_HEADER

public static final DataEncapsulation PRISM_HEADER

IP_OVER_FC

public static final DataEncapsulation IP_OVER_FC

SUNATM

public static final DataEncapsulation SUNATM

IEEE802_11_RADIO

public static final DataEncapsulation IEEE802_11_RADIO

ARCNET_LINUX

public static final DataEncapsulation ARCNET_LINUX

LINUX_IRDA

public static final DataEncapsulation LINUX_IRDA
Method Detail

values

public static final DataEncapsulation[] 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(DataEncapsulation c : DataEncapsulation.values())
        System.out.println(c);

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

valueOf

public static DataEncapsulation valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getDescription

public java.lang.String getDescription()

translateTo

public int translateTo(FileType type)
Translates the standard DLT value into a native DLT integer value for the file type specified. For example to tranlate the DLT value of DLT.EN10MB to native PCAP DLT value you would get integer 1 which is the PCAP DLT value for the same type of data link encapsulation.

Parameters:
type - file type to convert to
dlt - dlt value to convert to native
Returns:
converted value into a native integer in that particular file format. -1 indicates that no translation exists.

valueOf

public static DataEncapsulation valueOf(FileType type,
                                        int nativeDLT)
Translates a an integer value that represents a data link or encapsulation protocol number that is specific for each file type into standard Capture framework DLT enum entry.

Parameters:
type - file type to convert the supplied nativeDLT integer from into standard DLT enum entry
nativeDLT - the native dlt integer that specifies the encapsulation structure in the file format that is supplied
Returns:
DLT enum entry. Null indicates that no translation exists.