jpcap.packet
Class ARPPacket

java.lang.Object
  extended by jpcap.packet.Packet
      extended by jpcap.packet.ARPPacket
All Implemented Interfaces:
java.io.Serializable

public class ARPPacket
extends Packet

This class represents ARP/RARP packet.

See Also:
Serialized Form

Field Summary
static short ARP_REPLY
          ARP reply
static short ARP_REQUEST
          ARP request
 short hardtype
          Hardware type
static short HARDTYPE_ETHER
          Hardware type: Ethernet
static short HARDTYPE_FRAMERELAY
          Hardware type: Frame relay
static short HARDTYPE_IEEE802
          Hardware type: Token ring
 short hlen
          Hardware address length
static short INV_REPLY
          Identify peer response
static short INV_REQUEST
          Identify peer request
 short operation
          Operation
 short plen
          Protocol address length
 short prototype
          Protocol type
static short PROTOTYPE_IP
          Protocol type: IP
static short RARP_REPLY
          Reverse ARP reply
static short RARP_REQUEST
          Reverse ARP request
 byte[] sender_hardaddr
          Sender hardware address
 byte[] sender_protoaddr
          Sender protocol address
 byte[] target_hardaddr
          Target hardware address
 byte[] target_protoaddr
          Target protocol address
 
Fields inherited from class jpcap.packet.Packet
caplen, data, datalink, EOF, header, len, sec, usec
 
Constructor Summary
ARPPacket()
           
 
Method Summary
 java.lang.Object getSenderHardwareAddress()
          Returns the hardware address (MAC address) of the sender.
 java.lang.Object getSenderProtocolAddress()
          Returns the protocol address of the sender.
 java.lang.Object getTargetHardwareAddress()
          Returns the hardware address (MAC address) of the target.
 java.lang.Object getTargetProtocolAddress()
          Returns the protocol address of the target.
 java.lang.String toString()
          Returns a string representation of this ARP/RARP packet.

Format: ARP(hardtype:prototype)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hardtype

public short hardtype
Hardware type


HARDTYPE_ETHER

public static final short HARDTYPE_ETHER
Hardware type: Ethernet

See Also:
Constant Field Values

HARDTYPE_IEEE802

public static final short HARDTYPE_IEEE802
Hardware type: Token ring

See Also:
Constant Field Values

HARDTYPE_FRAMERELAY

public static final short HARDTYPE_FRAMERELAY
Hardware type: Frame relay

See Also:
Constant Field Values

prototype

public short prototype
Protocol type


PROTOTYPE_IP

public static final short PROTOTYPE_IP
Protocol type: IP

See Also:
Constant Field Values

hlen

public short hlen
Hardware address length


plen

public short plen
Protocol address length


operation

public short operation
Operation


ARP_REQUEST

public static final short ARP_REQUEST
ARP request

See Also:
Constant Field Values

ARP_REPLY

public static final short ARP_REPLY
ARP reply

See Also:
Constant Field Values

RARP_REQUEST

public static final short RARP_REQUEST
Reverse ARP request

See Also:
Constant Field Values

RARP_REPLY

public static final short RARP_REPLY
Reverse ARP reply

See Also:
Constant Field Values

INV_REQUEST

public static final short INV_REQUEST
Identify peer request

See Also:
Constant Field Values

INV_REPLY

public static final short INV_REPLY
Identify peer response

See Also:
Constant Field Values

sender_hardaddr

public byte[] sender_hardaddr
Sender hardware address


sender_protoaddr

public byte[] sender_protoaddr
Sender protocol address


target_hardaddr

public byte[] target_hardaddr
Target hardware address


target_protoaddr

public byte[] target_protoaddr
Target protocol address

Constructor Detail

ARPPacket

public ARPPacket()
Method Detail

getSenderHardwareAddress

public java.lang.Object getSenderHardwareAddress()
Returns the hardware address (MAC address) of the sender.

Returns:
Hardware address of the sender

getTargetHardwareAddress

public java.lang.Object getTargetHardwareAddress()
Returns the hardware address (MAC address) of the target.

Returns:
Hardware address of the target

getSenderProtocolAddress

public java.lang.Object getSenderProtocolAddress()
Returns the protocol address of the sender.

Returns:
Protocol address of the sender

getTargetProtocolAddress

public java.lang.Object getTargetProtocolAddress()
Returns the protocol address of the target.

Returns:
Protocol address of the target

toString

public java.lang.String toString()
Returns a string representation of this ARP/RARP packet.

Format: ARP(hardtype:prototype)

Overrides:
toString in class Packet
Returns:
a string representation of this ARP/RARP packet