|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sourceforge.jpcap.net.EthernetEncoding
Ethernet packet encoding.
Contains link-level information encoding information for an ethernet packet and methods for encoding and decoding ethernet headers.
Field Summary | |
static int |
CODE_LEN
Width of the ethernet type code in bytes. |
static int |
CODE_POS
Position of the ethernet type field within the ethernet header. |
static int |
HEADER_LEN
Total length of an ethernet header in bytes. |
static int |
MAC_DST_POS
Position of the destination MAC address within the ethernet header. |
static int |
MAC_SRC_POS
Position of the source MAC address within the ethernet header. |
Constructor Summary | |
EthernetEncoding()
|
Method Summary | |
static EthernetPacket |
create(int lLen,
byte[] bytes)
EthernetPacket factory. |
static java.lang.String |
extractMACAddress(int lLen,
boolean sourceFlag,
byte[] packetBytes)
Extract a MAC address from an ethernet header. |
static int |
extractTypeCode(byte[] packetBytes)
Extract the type field from packet data. |
static byte[] |
generateRandomHeader()
Generate a random ethernet header. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int CODE_LEN
public static final int MAC_DST_POS
public static final int MAC_SRC_POS
public static final int CODE_POS
public static final int HEADER_LEN
Constructor Detail |
public EthernetEncoding()
Method Detail |
public static EthernetPacket create(int lLen, byte[] bytes)
public static byte[] generateRandomHeader()
public static int extractTypeCode(byte[] packetBytes)
packetBytes
- packet bytes.public static java.lang.String extractMACAddress(int lLen, boolean sourceFlag, byte[] packetBytes)
sourceFlag
- whether the extract query is for the source address.packetBytes
- packet bytes.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |