net.sourceforge.jpcap.net
Class LinkLayer
java.lang.Object
net.sourceforge.jpcap.net.LinkLayer
- All Implemented Interfaces:
- LinkLayers
public class LinkLayer
- extends Object
- implements LinkLayers
Information about network link layers.
- Version:
- $Revision: 1.1 $
- Author:
- Patrick Charles and Jonas Lehmann
- Last modified by:
- $Author: esmondpitt $
- Last modified at:
- $Date: 2008/08/21 02:58:27 $
Fields inherited from interface net.sourceforge.jpcap.net.LinkLayers |
ARCNET, ATM_CLIP, ATM_RFC1483, AX25, CHAOS, CHDLC, EN10MB, EN3MB, FDDI, IEEE802, IEEE802_11, LINUX_SLL, LOOP, NULL, PPP, PPP_BSDOS, PPP_SERIAL, PRONET, RAW, SLIP, SLIP_BSDOS, UNKNOWN |
Method Summary |
static String |
getDescription(int code)
Fetch a link-layer type description. |
static int |
getLinkLayerLength(int layerType)
Fetch the header length associated with various link-layer types. |
static int |
getProtoOffset(int layerType)
Fetch the offset into the link-layer header where the protocol code
can be found. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LinkLayer
public LinkLayer()
getLinkLayerLength
public static int getLinkLayerLength(int layerType)
- Fetch the header length associated with various link-layer types.
- Parameters:
layerType
- the link-layer code
- Returns:
- the length of the header for the specified link-layer
getProtoOffset
public static int getProtoOffset(int layerType)
- Fetch the offset into the link-layer header where the protocol code
can be found. Returns -1 if there is no embedded protocol code.
- Parameters:
layerType
- the link-layer code
- Returns:
- the offset in bytes
getDescription
public static String getDescription(int code)
- Fetch a link-layer type description.
- Parameters:
code
- the code associated with the description.
- Returns:
- a description of the link-layer type.