org.jnetpcap
Enum PcapDLT

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

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

Constants that represent the Pcap's Data Link Type assignments. The most popular constant is the EN10MB (alternatively CONST_EN10MB) which represents Ethernet2 based physical medium. This includes 10, 100, and 1000 mega-bit ethernets.

There are 2 tables within PcapDLT enum structure. First is the full table of enum constants, and then there is a duplicate table containing public final static int of contants, prefixed with CONST_. Also the enum constant's field value is public which means that integer DLT constant can also be access using the field directly.

Here are 4 examples of how you can use DLT constants in various ways.

Accessing the int DLT value using an enum constant

 int dlt = pcap.datalink(); // Get DLT value from open Pcap capture
 if (dlt == PcapDLT.EN10MB.value) {
         // Do something
 }
 
 // Also can use this more formal approach
 
 if (PcapDLT.EN10MB.equals(dlt)) {
   // Do something
 } 
 

Accessing the int DLT value from integer constants table

 int dlt = pcap.datalink(); // Get DLT value from open Pcap capture
 if (dlt == PcapDLT.CONST_EN10MB) {
        // Do something
 }
 

Converting integer DLT value into a constant

 int dlt = pcap.datalink(); // Get DLT value from open Pcap capture
 PcapDLT enumConst = PcapDLT.valueOf(dlt);
 System.out.println("The Data Link Type is " + enumConst + " described as " + 
                enumConst.description);
 

Converting string DLT name into a constant

 PcapDLT enumConst = PcapDLT.valueOf("EN10MB");
 System.out.println("The Data Link Type value is " + enumConst.value);
 

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Enum Constant Summary
AIRONET_HEADER
           
APPLE_IP_OVER_IEEE1394
           
ARCNET
           
ARCNET_LINUX
           
ATM_CLIP
           
ATM_RFC1483
           
AURORA
           
AX25
           
BACNET_MS_TP
           
C_HDLC
           
CHAOS
           
CISCO_IOS
           
DOCSIS
           
ECONET
           
EN10MB
           
EN3MB
           
ENC
           
ERF_ETH
           
ERF_POS
           
FDDI
           
FRELAY
           
GCOM_SERIAL
           
GCOM_T1E1
           
GPF_F
           
GPF_T
           
GPRS_LLC
           
IBM_SN
           
IBM_SP
           
IEEE802
           
IEEE802_11
           
IEEE802_11_RADIO
           
IEEE802_11_RADIO_AVS
           
IP_OVER_FC
           
IPFILTER
           
JUNIPER_ATM1
           
JUNIPER_ATM2
           
JUNIPER_ES
           
JUNIPER_GGSN
           
JUNIPER_MFR
           
JUNIPER_MLFR
           
JUNIPER_MLPPP
           
JUNIPER_MONITOR
           
JUNIPER_PIC_PEER
           
JUNIPER_PPPOE
           
JUNIPER_PPPOE_ATM
           
JUNIPER_SERVICES
           
LINUX_IRDA
           
LINUX_LAPD
           
LINUX_SLL
           
LOOP
           
LTALK
           
MTP2
           
MTP2_WITH_PHDR
           
MTP3
           
NULL
           
PCI_EXP
           
PFLOG
           
PFSYNC
           
PPP
           
PPP_BSDOS
           
PPP_ETHER
           
PPP_PPPD
           
PPP_SERIAL
           
PRISM_HEADER
           
PRONET
           
RAW
           
RIO
           
SCCP
           
SLIP
           
SLIP_BSDOS
           
SUNATM
           
SYMANTEC_FIREWALL
           
TZSP
           
USER0
           
USER1
           
USER10
           
USER11
           
USER12
           
USER13
           
USER14
           
USER15
           
USER2
           
USER3
           
USER4
           
USER5
           
USER6
           
USER7
           
USER8
           
USER9
           
 
Field Summary
static int CONST_AIRONET_HEADER
           
static int CONST_APPLE_IP_OVER_IEEE1394
           
static int CONST_ARCNET
           
static int CONST_ARCNET_LINUX
           
static int CONST_ATM_CLIP
           
static int CONST_ATM_RFC1483
           
static int CONST_AURORA
           
static int CONST_AX25
           
static int CONST_BACNET_MS_TP
           
static int CONST_C_HDLC
           
static int CONST_CHAOS
           
static int CONST_CISCO_IOS
           
static int CONST_DOCSIS
           
static int CONST_ECONET
           
static int CONST_EN10MB
           
static int CONST_EN3MB
           
static int CONST_ENC
           
static int CONST_ERF_ETH
           
static int CONST_ERF_POS
           
static int CONST_FDDI
           
static int CONST_FRELAY
           
static int CONST_GCOM_SERIAL
           
static int CONST_GCOM_T1E1
           
static int CONST_GPF_F
           
static int CONST_GPF_T
           
static int CONST_GPRS_LLC
           
static int CONST_IBM_SN
           
static int CONST_IBM_SP
           
static int CONST_IEEE802
           
static int CONST_IEEE802_11
           
static int CONST_IEEE802_11_RADIO
           
static int CONST_IEEE802_11_RADIO_AVS
           
static int CONST_IP_OVER_FC
           
static int CONST_IPFILTER
           
static int CONST_JUNIPER_ATM1
           
static int CONST_JUNIPER_ATM2
           
static int CONST_JUNIPER_ES
           
static int CONST_JUNIPER_GGSN
           
static int CONST_JUNIPER_MFR
           
static int CONST_JUNIPER_MLFR
           
static int CONST_JUNIPER_MLPPP
           
static int CONST_JUNIPER_MONITOR
           
static int CONST_JUNIPER_PIC_PEER
           
static int CONST_JUNIPER_PPPOE
           
static int CONST_JUNIPER_PPPOE_ATM
           
static int CONST_JUNIPER_SERVICES
           
static int CONST_LINUX_IRDA
           
static int CONST_LINUX_LAPD
           
static int CONST_LINUX_SLL
           
static int CONST_LOOP
           
static int CONST_LTALK
           
static int CONST_MTP2
           
static int CONST_MTP2_WITH_PHDR
           
static int CONST_MTP3
           
static int CONST_NULL
           
static int CONST_PCI_EXP
           
static int CONST_PFLOG
           
static int CONST_PFSYNC
           
static int CONST_PPP
           
static int CONST_PPP_BSDOS
           
static int CONST_PPP_ETHER
           
static int CONST_PPP_PPPD
           
static int CONST_PPP_SERIAL
           
static int CONST_PRISM_HEADER
           
static int CONST_PRONET
           
static int CONST_RAW
           
static int CONST_RIO
           
static int CONST_SCCP
           
static int CONST_SLIP
           
static int CONST_SLIP_BSDOS
           
static int CONST_SUNATM
           
static int CONST_SYMANTEC_FIREWALL
           
static int CONST_TZSP
           
static int CONST_USER0
           
static int CONST_USER1
           
static int CONST_USER10
           
static int CONST_USER11
           
static int CONST_USER12
           
static int CONST_USER13
           
static int CONST_USER14
           
static int CONST_USER15
           
static int CONST_USER2
           
static int CONST_USER3
           
static int CONST_USER4
           
static int CONST_USER5
           
static int CONST_USER6
           
static int CONST_USER7
           
static int CONST_USER8
           
static int CONST_USER9
           
 java.lang.String description
          Description of the dlt retrieved by quering the native pcap library.
 int value
          Integer dlt value assigned by libpcap to this constant
 
Method Summary
 boolean equals(int value)
          Compares the supplied value with the constant's assigned DLT value.
static PcapDLT valueOf(int value)
          Converts an integer value into a PcapDLT constant.
static PcapDLT valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static PcapDLT[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

NULL

public static final PcapDLT NULL

EN10MB

public static final PcapDLT EN10MB

EN3MB

public static final PcapDLT EN3MB

AX25

public static final PcapDLT AX25

PRONET

public static final PcapDLT PRONET

CHAOS

public static final PcapDLT CHAOS

IEEE802

public static final PcapDLT IEEE802

ARCNET

public static final PcapDLT ARCNET

SLIP

public static final PcapDLT SLIP

PPP

public static final PcapDLT PPP

FDDI

public static final PcapDLT FDDI

ATM_RFC1483

public static final PcapDLT ATM_RFC1483

RAW

public static final PcapDLT RAW

SLIP_BSDOS

public static final PcapDLT SLIP_BSDOS

PPP_BSDOS

public static final PcapDLT PPP_BSDOS

ATM_CLIP

public static final PcapDLT ATM_CLIP

PPP_SERIAL

public static final PcapDLT PPP_SERIAL

PPP_ETHER

public static final PcapDLT PPP_ETHER

SYMANTEC_FIREWALL

public static final PcapDLT SYMANTEC_FIREWALL

C_HDLC

public static final PcapDLT C_HDLC

IEEE802_11

public static final PcapDLT IEEE802_11

FRELAY

public static final PcapDLT FRELAY

LOOP

public static final PcapDLT LOOP

ENC

public static final PcapDLT ENC

LINUX_SLL

public static final PcapDLT LINUX_SLL

LTALK

public static final PcapDLT LTALK

ECONET

public static final PcapDLT ECONET

IPFILTER

public static final PcapDLT IPFILTER

PFLOG

public static final PcapDLT PFLOG

CISCO_IOS

public static final PcapDLT CISCO_IOS

PRISM_HEADER

public static final PcapDLT PRISM_HEADER

AIRONET_HEADER

public static final PcapDLT AIRONET_HEADER

PFSYNC

public static final PcapDLT PFSYNC

IP_OVER_FC

public static final PcapDLT IP_OVER_FC

SUNATM

public static final PcapDLT SUNATM

RIO

public static final PcapDLT RIO

PCI_EXP

public static final PcapDLT PCI_EXP

AURORA

public static final PcapDLT AURORA

IEEE802_11_RADIO

public static final PcapDLT IEEE802_11_RADIO

TZSP

public static final PcapDLT TZSP

ARCNET_LINUX

public static final PcapDLT ARCNET_LINUX

JUNIPER_MLPPP

public static final PcapDLT JUNIPER_MLPPP

JUNIPER_MLFR

public static final PcapDLT JUNIPER_MLFR

JUNIPER_ES

public static final PcapDLT JUNIPER_ES

JUNIPER_GGSN

public static final PcapDLT JUNIPER_GGSN

JUNIPER_MFR

public static final PcapDLT JUNIPER_MFR

JUNIPER_ATM2

public static final PcapDLT JUNIPER_ATM2

JUNIPER_SERVICES

public static final PcapDLT JUNIPER_SERVICES

JUNIPER_ATM1

public static final PcapDLT JUNIPER_ATM1

APPLE_IP_OVER_IEEE1394

public static final PcapDLT APPLE_IP_OVER_IEEE1394

MTP2_WITH_PHDR

public static final PcapDLT MTP2_WITH_PHDR

MTP2

public static final PcapDLT MTP2

MTP3

public static final PcapDLT MTP3

SCCP

public static final PcapDLT SCCP

DOCSIS

public static final PcapDLT DOCSIS

LINUX_IRDA

public static final PcapDLT LINUX_IRDA

IBM_SP

public static final PcapDLT IBM_SP

IBM_SN

public static final PcapDLT IBM_SN

USER0

public static final PcapDLT USER0

USER1

public static final PcapDLT USER1

USER2

public static final PcapDLT USER2

USER3

public static final PcapDLT USER3

USER4

public static final PcapDLT USER4

USER5

public static final PcapDLT USER5

USER6

public static final PcapDLT USER6

USER7

public static final PcapDLT USER7

USER8

public static final PcapDLT USER8

USER9

public static final PcapDLT USER9

USER10

public static final PcapDLT USER10

USER11

public static final PcapDLT USER11

USER12

public static final PcapDLT USER12

USER13

public static final PcapDLT USER13

USER14

public static final PcapDLT USER14

USER15

public static final PcapDLT USER15

IEEE802_11_RADIO_AVS

public static final PcapDLT IEEE802_11_RADIO_AVS

JUNIPER_MONITOR

public static final PcapDLT JUNIPER_MONITOR

BACNET_MS_TP

public static final PcapDLT BACNET_MS_TP

PPP_PPPD

public static final PcapDLT PPP_PPPD

JUNIPER_PPPOE

public static final PcapDLT JUNIPER_PPPOE

JUNIPER_PPPOE_ATM

public static final PcapDLT JUNIPER_PPPOE_ATM

GPRS_LLC

public static final PcapDLT GPRS_LLC

GPF_T

public static final PcapDLT GPF_T

GPF_F

public static final PcapDLT GPF_F

GCOM_T1E1

public static final PcapDLT GCOM_T1E1

GCOM_SERIAL

public static final PcapDLT GCOM_SERIAL

JUNIPER_PIC_PEER

public static final PcapDLT JUNIPER_PIC_PEER

ERF_ETH

public static final PcapDLT ERF_ETH

ERF_POS

public static final PcapDLT ERF_POS

LINUX_LAPD

public static final PcapDLT LINUX_LAPD
Field Detail

value

public final int value
Integer dlt value assigned by libpcap to this constant


description

public final java.lang.String description
Description of the dlt retrieved by quering the native pcap library. The description is not a static constant part of the API and may change from native libpcap implementation to implementation.


CONST_NULL

public static final int CONST_NULL
See Also:
Constant Field Values

CONST_EN10MB

public static final int CONST_EN10MB
See Also:
Constant Field Values

CONST_EN3MB

public static final int CONST_EN3MB
See Also:
Constant Field Values

CONST_AX25

public static final int CONST_AX25
See Also:
Constant Field Values

CONST_PRONET

public static final int CONST_PRONET
See Also:
Constant Field Values

CONST_CHAOS

public static final int CONST_CHAOS
See Also:
Constant Field Values

CONST_IEEE802

public static final int CONST_IEEE802
See Also:
Constant Field Values

CONST_ARCNET

public static final int CONST_ARCNET
See Also:
Constant Field Values

CONST_SLIP

public static final int CONST_SLIP
See Also:
Constant Field Values

CONST_PPP

public static final int CONST_PPP
See Also:
Constant Field Values

CONST_FDDI

public static final int CONST_FDDI
See Also:
Constant Field Values

CONST_ATM_RFC1483

public static final int CONST_ATM_RFC1483
See Also:
Constant Field Values

CONST_RAW

public static final int CONST_RAW
See Also:
Constant Field Values

CONST_SLIP_BSDOS

public static final int CONST_SLIP_BSDOS
See Also:
Constant Field Values

CONST_PPP_BSDOS

public static final int CONST_PPP_BSDOS
See Also:
Constant Field Values

CONST_ATM_CLIP

public static final int CONST_ATM_CLIP
See Also:
Constant Field Values

CONST_PPP_SERIAL

public static final int CONST_PPP_SERIAL
See Also:
Constant Field Values

CONST_PPP_ETHER

public static final int CONST_PPP_ETHER
See Also:
Constant Field Values

CONST_SYMANTEC_FIREWALL

public static final int CONST_SYMANTEC_FIREWALL
See Also:
Constant Field Values

CONST_C_HDLC

public static final int CONST_C_HDLC
See Also:
Constant Field Values

CONST_IEEE802_11

public static final int CONST_IEEE802_11
See Also:
Constant Field Values

CONST_FRELAY

public static final int CONST_FRELAY
See Also:
Constant Field Values

CONST_LOOP

public static final int CONST_LOOP
See Also:
Constant Field Values

CONST_ENC

public static final int CONST_ENC
See Also:
Constant Field Values

CONST_LINUX_SLL

public static final int CONST_LINUX_SLL
See Also:
Constant Field Values

CONST_LTALK

public static final int CONST_LTALK
See Also:
Constant Field Values

CONST_ECONET

public static final int CONST_ECONET
See Also:
Constant Field Values

CONST_IPFILTER

public static final int CONST_IPFILTER
See Also:
Constant Field Values

CONST_PFLOG

public static final int CONST_PFLOG
See Also:
Constant Field Values

CONST_CISCO_IOS

public static final int CONST_CISCO_IOS
See Also:
Constant Field Values

CONST_PRISM_HEADER

public static final int CONST_PRISM_HEADER
See Also:
Constant Field Values

CONST_AIRONET_HEADER

public static final int CONST_AIRONET_HEADER
See Also:
Constant Field Values

CONST_PFSYNC

public static final int CONST_PFSYNC
See Also:
Constant Field Values

CONST_IP_OVER_FC

public static final int CONST_IP_OVER_FC
See Also:
Constant Field Values

CONST_SUNATM

public static final int CONST_SUNATM
See Also:
Constant Field Values

CONST_RIO

public static final int CONST_RIO
See Also:
Constant Field Values

CONST_PCI_EXP

public static final int CONST_PCI_EXP
See Also:
Constant Field Values

CONST_AURORA

public static final int CONST_AURORA
See Also:
Constant Field Values

CONST_IEEE802_11_RADIO

public static final int CONST_IEEE802_11_RADIO
See Also:
Constant Field Values

CONST_TZSP

public static final int CONST_TZSP
See Also:
Constant Field Values

CONST_ARCNET_LINUX

public static final int CONST_ARCNET_LINUX
See Also:
Constant Field Values

CONST_JUNIPER_MLPPP

public static final int CONST_JUNIPER_MLPPP
See Also:
Constant Field Values

CONST_APPLE_IP_OVER_IEEE1394

public static final int CONST_APPLE_IP_OVER_IEEE1394
See Also:
Constant Field Values

CONST_JUNIPER_MLFR

public static final int CONST_JUNIPER_MLFR
See Also:
Constant Field Values

CONST_JUNIPER_ES

public static final int CONST_JUNIPER_ES
See Also:
Constant Field Values

CONST_JUNIPER_GGSN

public static final int CONST_JUNIPER_GGSN
See Also:
Constant Field Values

CONST_JUNIPER_MFR

public static final int CONST_JUNIPER_MFR
See Also:
Constant Field Values

CONST_JUNIPER_ATM2

public static final int CONST_JUNIPER_ATM2
See Also:
Constant Field Values

CONST_JUNIPER_SERVICES

public static final int CONST_JUNIPER_SERVICES
See Also:
Constant Field Values

CONST_JUNIPER_ATM1

public static final int CONST_JUNIPER_ATM1
See Also:
Constant Field Values

CONST_MTP2_WITH_PHDR

public static final int CONST_MTP2_WITH_PHDR
See Also:
Constant Field Values

CONST_MTP2

public static final int CONST_MTP2
See Also:
Constant Field Values

CONST_MTP3

public static final int CONST_MTP3
See Also:
Constant Field Values

CONST_SCCP

public static final int CONST_SCCP
See Also:
Constant Field Values

CONST_DOCSIS

public static final int CONST_DOCSIS
See Also:
Constant Field Values

CONST_LINUX_IRDA

public static final int CONST_LINUX_IRDA
See Also:
Constant Field Values

CONST_IBM_SP

public static final int CONST_IBM_SP
See Also:
Constant Field Values

CONST_IBM_SN

public static final int CONST_IBM_SN
See Also:
Constant Field Values

CONST_USER0

public static final int CONST_USER0
See Also:
Constant Field Values

CONST_USER1

public static final int CONST_USER1
See Also:
Constant Field Values

CONST_USER2

public static final int CONST_USER2
See Also:
Constant Field Values

CONST_USER3

public static final int CONST_USER3
See Also:
Constant Field Values

CONST_USER4

public static final int CONST_USER4
See Also:
Constant Field Values

CONST_USER5

public static final int CONST_USER5
See Also:
Constant Field Values

CONST_USER6

public static final int CONST_USER6
See Also:
Constant Field Values

CONST_USER7

public static final int CONST_USER7
See Also:
Constant Field Values

CONST_USER8

public static final int CONST_USER8
See Also:
Constant Field Values

CONST_USER9

public static final int CONST_USER9
See Also:
Constant Field Values

CONST_USER10

public static final int CONST_USER10
See Also:
Constant Field Values

CONST_USER11

public static final int CONST_USER11
See Also:
Constant Field Values

CONST_USER12

public static final int CONST_USER12
See Also:
Constant Field Values

CONST_USER13

public static final int CONST_USER13
See Also:
Constant Field Values

CONST_USER14

public static final int CONST_USER14
See Also:
Constant Field Values

CONST_USER15

public static final int CONST_USER15
See Also:
Constant Field Values

CONST_IEEE802_11_RADIO_AVS

public static final int CONST_IEEE802_11_RADIO_AVS
See Also:
Constant Field Values

CONST_JUNIPER_MONITOR

public static final int CONST_JUNIPER_MONITOR
See Also:
Constant Field Values

CONST_BACNET_MS_TP

public static final int CONST_BACNET_MS_TP
See Also:
Constant Field Values

CONST_PPP_PPPD

public static final int CONST_PPP_PPPD
See Also:
Constant Field Values

CONST_JUNIPER_PPPOE

public static final int CONST_JUNIPER_PPPOE
See Also:
Constant Field Values

CONST_JUNIPER_PPPOE_ATM

public static final int CONST_JUNIPER_PPPOE_ATM
See Also:
Constant Field Values

CONST_GPRS_LLC

public static final int CONST_GPRS_LLC
See Also:
Constant Field Values

CONST_GPF_T

public static final int CONST_GPF_T
See Also:
Constant Field Values

CONST_GPF_F

public static final int CONST_GPF_F
See Also:
Constant Field Values

CONST_GCOM_T1E1

public static final int CONST_GCOM_T1E1
See Also:
Constant Field Values

CONST_GCOM_SERIAL

public static final int CONST_GCOM_SERIAL
See Also:
Constant Field Values

CONST_JUNIPER_PIC_PEER

public static final int CONST_JUNIPER_PIC_PEER
See Also:
Constant Field Values

CONST_ERF_ETH

public static final int CONST_ERF_ETH
See Also:
Constant Field Values

CONST_ERF_POS

public static final int CONST_ERF_POS
See Also:
Constant Field Values

CONST_LINUX_LAPD

public static final int CONST_LINUX_LAPD
See Also:
Constant Field Values
Method Detail

values

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

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

valueOf

public static PcapDLT 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
java.lang.NullPointerException - if the argument is null

equals

public boolean equals(int value)
Compares the supplied value with the constant's assigned DLT value.

Parameters:
value - value to check against this constant
Returns:
true if the supplied value matches the value of the constant, otherwise false

valueOf

public static PcapDLT valueOf(int value)
Converts an integer value into a PcapDLT constant.

Parameters:
value - Pcap DLT integer value to convert
Returns:
constant assigned to the DLT integer, or null if not found