Package jpcap.packet
Class EthernetPacket
java.lang.Object
jpcap.packet.DatalinkPacket
jpcap.packet.EthernetPacket
- All Implemented Interfaces:
Serializable
This class represents Ethernet packet.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionbyte[]Destination MAC address (6byte)static final shortAddr.static final shortIP protocolstatic final shortIPv6static final shortused to test interfacesstatic final shortPUP protocolstatic final shortreverse Addr.static final shortIEEE 802.1Q VLAN taggingshortFrame typebyte[]Source MAC address (6byte) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the MAC address of the destination.Returns the MAC address of the source.toString()Returns a string representation of this Ethernet packet.
Format: Fsrc_mac -> dst_mac (frametype)
-
Field Details
-
dst_mac
public byte[] dst_macDestination MAC address (6byte) -
src_mac
public byte[] src_macSource MAC address (6byte) -
frametype
public short frametypeFrame type -
ETHERTYPE_PUP
public static final short ETHERTYPE_PUPPUP protocol- See Also:
-
ETHERTYPE_IP
public static final short ETHERTYPE_IPIP protocol- See Also:
-
ETHERTYPE_ARP
public static final short ETHERTYPE_ARPAddr. resolution protocol- See Also:
-
ETHERTYPE_REVARP
public static final short ETHERTYPE_REVARPreverse Addr. resolution protocol- See Also:
-
ETHERTYPE_VLAN
public static final short ETHERTYPE_VLANIEEE 802.1Q VLAN tagging- See Also:
-
ETHERTYPE_IPV6
public static final short ETHERTYPE_IPV6IPv6- See Also:
-
ETHERTYPE_LOOPBACK
public static final short ETHERTYPE_LOOPBACKused to test interfaces- See Also:
-
-
Constructor Details
-
EthernetPacket
public EthernetPacket()
-
-
Method Details
-
getSourceAddress
Returns the MAC address of the source.- Returns:
- MAC address of the source
-
getDestinationAddress
Returns the MAC address of the destination.- Returns:
- MAC address of the destination
-
toString
Returns a string representation of this Ethernet packet.
Format: Fsrc_mac -> dst_mac (frametype)
-