net.sourceforge.jpcap.net
Class EthernetProtocol

java.lang.Object
  extended bynet.sourceforge.jpcap.net.EthernetProtocol
All Implemented Interfaces:
EthernetFields, EthernetProtocols

public class EthernetProtocol
extends java.lang.Object
implements EthernetProtocols, EthernetFields

Ethernet protocol utility class.


Field Summary
 
Fields inherited from interface net.sourceforge.jpcap.net.EthernetProtocols
AARP, ALL, ARP, ATALK, AX25, BPQ, CONTROL, CUST, DDCMP, DEC, DECDNS, DECDTS, DIAG, DNA_DL, DNA_RC, DNA_RT, ECHO, INFTH, IP, IPV6, IPX, IRDA, LANBRIDGE, LAT, LOCALTALK, LOOP, LOOPBACK, MASK, MOBITEX, N802_2, N802_3, N8021Q, NS, PPP, PPP_MP, PPPOED, PPPOES, PPPTALK, PUP, RARP, SCA, SNAP, SPRITE, STBPDU, TR_802_2, TRAIL, VEXP, VPROD, WAN_PPP, X25
 
Fields inherited from interface net.sourceforge.jpcap.net.EthernetFields
ETH_CODE_LEN, ETH_CODE_POS, ETH_DST_POS, ETH_HEADER_LEN, ETH_SRC_POS
 
Constructor Summary
EthernetProtocol()
           
 
Method Summary
static int extractProtocol(byte[] packetBytes)
          Extract the protocol type field from packet data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EthernetProtocol

public EthernetProtocol()
Method Detail

extractProtocol

public static int extractProtocol(byte[] packetBytes)
Extract the protocol type field from packet data.

The type field indicates what type of data is contained in the packet's data block.

Parameters:
packetBytes - packet bytes.
Returns:
the ethernet type code. i.e. 0x800 signifies IP datagram.