org.jnetpcap.protocol.lan
Class Ethernet

java.lang.Object
  extended by org.jnetpcap.nio.JMemory
      extended by org.jnetpcap.nio.JBuffer
          extended by org.jnetpcap.packet.JHeader
              extended by org.jnetpcap.protocol.lan.Ethernet
All Implemented Interfaces:
JByteBuffer, JPayloadAccessor

@Header(length=14,
        dlt={EN10MB,FDDI},
        osi=DATALINK,
        characteristics=CSMA_CD,
        nicname="Eth",
        description="Ethernet",
        url="http://en.wikipedia.org/wiki/Ethernet")
public class Ethernet
extends JHeader

Ethernet2 definition. Datalink layer ethernet frame definition.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
static class Ethernet.EthernetType
          A table of EtherType values and their names
 
Nested classes/interfaces inherited from class org.jnetpcap.packet.JHeader
JHeader.State
 
Nested classes/interfaces inherited from class org.jnetpcap.nio.JMemory
JMemory.Type
 
Field Summary
static int ADDRESS_IG_BIT
           
static int ADDRESS_LG_BIT
           
static int ID
           
static int LENGTH
           
static java.lang.String ORG_IEEE
           
 
Fields inherited from class org.jnetpcap.packet.JHeader
annotatedHeader, EMPTY_HEADER_ARRAY, isSubHeader, packet, state
 
Fields inherited from class org.jnetpcap.nio.JMemory
JNETPCAP_LIBRARY_NAME
 
Constructor Summary
Ethernet()
           
 
Method Summary
 long destination_IG()
           
 long destination_LG()
           
 byte[] destination()
           
 void destination(byte[] array)
           
 byte[] destinationToByteArray(byte[] array)
           
 void formatHeader(java.util.List<JField> fields)
           
 long source_IG()
           
 long source_LG()
           
 byte[] source()
           
 void source(byte[] array)
           
 byte[] sourceToByteArray(byte[] array)
           
 int type()
           
 void type(int type)
           
 java.lang.String typeDescription()
           
 Ethernet.EthernetType typeEnum()
           
 
Methods inherited from class org.jnetpcap.packet.JHeader
addAnalysis, decode, decodeHeader, getAnalysis, getAnalysisIterable, getAnnotatedHeader, getDescription, getFields, getId, getLength, getName, getNicname, getOffset, getPacket, getParent, getPayload, getState, getSubHeaders, getType, hasAnalysis, hasAnalysis, hasAnalysis, hasDescription, hasSubHeaders, peer, peer, peerPayloadTo, setPacket, setSubHeaders, sizeof, toString, transferPayloadTo, transferPayloadTo, transferPayloadTo, validateHeader
 
Methods inherited from class org.jnetpcap.nio.JBuffer
findUTF8String, getByte, getByteArray, getByteArray, getDouble, getFloat, getInt, getLong, getShort, getUByte, getUInt, getUShort, getUTF8Char, getUTF8String, getUTF8String, getUTF8String, getUTF8String, isReadonly, order, order, peer, peer, peer, peer, setByte, setByteArray, setByteBuffer, setDouble, setFloat, setInt, setLong, setShort, setUByte, setUInt, setUShort, transferFrom, transferFrom, transferFrom, transferTo, transferTo, transferTo
 
Methods inherited from class org.jnetpcap.nio.JMemory
check, cleanup, finalize, isInitialized, isJMemoryBasedOwner, isOwner, peer, setSize, size, toDebugString, toHexdump, toHexdump, totalActiveAllocated, totalAllocateCalls, totalAllocated, totalAllocatedSegments0To255Bytes, totalAllocatedSegments256OrAbove, totalDeAllocateCalls, totalDeAllocated, transferFrom, transferFrom, transferFromDirect, transferOwnership, transferTo, transferTo, transferTo, transferTo, transferTo
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jnetpcap.nio.JByteBuffer
size
 

Field Detail

ADDRESS_IG_BIT

public static final int ADDRESS_IG_BIT
See Also:
Constant Field Values

ADDRESS_LG_BIT

public static final int ADDRESS_LG_BIT
See Also:
Constant Field Values

ID

public static final int ID
See Also:
Constant Field Values

LENGTH

public static final int LENGTH
See Also:
Constant Field Values

ORG_IEEE

public static final java.lang.String ORG_IEEE
See Also:
Constant Field Values
Constructor Detail

Ethernet

public Ethernet()
Method Detail

destination

@Field(offset=0,
       length=48,
       format="#mac#",
       mask=281470681743360L)
public byte[] destination()

destination_IG

@Field(parent="destination",
       offset=40,
       length=1,
       display="IG bit")
@FlowKey(index=0)
public long destination_IG()

destination_LG

@Field(parent="destination",
       offset=41,
       length=1,
       display="LG bit")
public long destination_LG()

destination

public void destination(byte[] array)

destinationToByteArray

public byte[] destinationToByteArray(byte[] array)

source

@Field(offset=48,
       length=48,
       format="#mac#",
       mask=281470681743360L)
@FlowKey(index=0)
public byte[] source()

source_IG

@Field(parent="source",
       offset=40,
       length=1,
       display="IG bit")
public long source_IG()

source_LG

@Field(parent="source",
       offset=41,
       length=1,
       display="LG bit")
public long source_LG()

source

public void source(byte[] array)

sourceToByteArray

public byte[] sourceToByteArray(byte[] array)

type

@Field(offset=96,
       length=16,
       format="%x")
@FlowKey(index=1)
public int type()

type

public void type(int type)

typeDescription

@Dynamic(value=DESCRIPTION)
public java.lang.String typeDescription()

formatHeader

public void formatHeader(java.util.List<JField> fields)

typeEnum

public Ethernet.EthernetType typeEnum()