net.sourceforge.jpcap.net
Class LinkLayer

java.lang.Object
  extended bynet.sourceforge.jpcap.net.LinkLayer
All Implemented Interfaces:
LinkLayers

public class LinkLayer
extends java.lang.Object
implements LinkLayers

Information about network link layers.


Field Summary
 
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
 
Constructor Summary
LinkLayer()
           
 
Method Summary
static java.lang.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
 

Constructor Detail

LinkLayer

public LinkLayer()
Method Detail

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 java.lang.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.