|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sourceforge.jpcap.net.ARPEncoding
ARP protocol encoding information.
todo: the ARP protocol supports hardware types other than ethernet and protocol types other than IP. this class isn't so generic yet.
Field Summary | |
static int |
HEADER_LEN
Length in bytes of an ARP header. |
static int |
HW_LEN_POS
Position of the hardware address length. |
static int |
HW_TYPE_POS
Position of the hardware address type. |
static int |
OP_POS
Position of the operation type. |
static int |
PR_LEN_POS
Position of the protocol address length. |
static int |
PR_TYPE_POS
Position of the protocol address type. |
static int |
S_HW_ADDR_POS
Position of the sender hardware address. |
static int |
S_PR_ADDR_POS
Position of the sender protocol address. |
static int |
T_HW_ADDR_POS
Position of the target hardware address. |
static int |
T_PR_ADDR_POS
Position of the target protocol address. |
Constructor Summary | |
ARPEncoding()
|
Method Summary | |
static ARPPacket |
create(int lLen,
byte[] bytes)
ARPPacket factory. |
static java.lang.String |
extractHwAddr(boolean sourceFlag,
int lLen,
byte[] packetBytes)
Extract a hardware (ARP) address from an ARP packet. |
static int |
extractOperation(int lLen,
byte[] packetBytes)
Extract the operation code from an ARP packet. |
static java.lang.String |
extractProtoAddr(boolean sourceFlag,
int lLen,
byte[] packetBytes)
Extract a protocol (IP) address from an ARP packet. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int HW_TYPE_POS
public static final int PR_TYPE_POS
public static final int HW_LEN_POS
public static final int PR_LEN_POS
public static final int OP_POS
public static final int S_HW_ADDR_POS
public static final int S_PR_ADDR_POS
public static final int T_HW_ADDR_POS
public static final int T_PR_ADDR_POS
public static final int HEADER_LEN
Constructor Detail |
public ARPEncoding()
Method Detail |
public static ARPPacket create(int lLen, byte[] bytes)
public static int extractOperation(int lLen, byte[] packetBytes)
public static java.lang.String extractHwAddr(boolean sourceFlag, int lLen, byte[] packetBytes)
offset
- the offset of the address data from the start of the
packet.packetBytes
- packet bytes, including the link-layer header.public static java.lang.String extractProtoAddr(boolean sourceFlag, int lLen, byte[] packetBytes)
offset
- the offset of the address data from the start of the
packet.packetBytes
- packet bytes, including the link-layer header.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |