|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.clackrouter.protocol.data.VNSData net.clackrouter.packets.VNSPacket net.clackrouter.packets.VNSEthernetPacket
public final class VNSEthernetPacket
Encapsulates an Ethernet frame.
Field Summary | |
---|---|
static int |
ADDR_LEN
Length of source and destination address fields. |
static int |
BODY_LEN
Length of the body. |
static int |
MAX_LEN
Total maximum length of an Ethernet frame. |
static short |
TYPE_ARP
Value of the type field if higher-level protocol is ARP. |
static short |
TYPE_IP
Value of the type field if higher-level protocol is IP. |
static int |
TYPE_LEN
Length of the type field. |
Fields inherited from class net.clackrouter.packets.VNSPacket |
---|
m_inputInterfaceName, m_length, m_level2Type, m_local_packet, m_nextHopIPAddr, m_nextHopMacAddr, m_outputInterfaceName, m_packetByteBuffer, mParentHeader |
Constructor Summary | |
---|---|
VNSEthernetPacket(java.nio.ByteBuffer packetByteBuffer)
Constructs an Ethernet frame from the supplied byte buffer. |
Method Summary | |
---|---|
java.nio.ByteBuffer |
getBodyBuffer()
Returns the body of the Ethernet frame. |
static java.nio.ByteBuffer |
getBroadcastAddress()
|
java.nio.ByteBuffer |
getDestinationAddressBuffer()
Returns destination hardware address. |
VNSPacket |
getPayload()
|
java.nio.ByteBuffer |
getSourceAddressBuffer()
Returns source hardware address. |
short |
getType()
Returns type of the higher-level protocol. |
java.nio.ByteBuffer |
getTypeBuffer()
Returns type of the higher-level protocol. |
void |
pack()
|
void |
setBodyBuffer(java.nio.ByteBuffer body)
Sets the body of the Ethernet frame to the supplied byte buffer. |
void |
setDestinationAddressBuffer(java.nio.ByteBuffer dstAddr)
Sets the destination hardware address of the Ethernet frame to the supplied byte buffer. |
void |
setSourceAddressBuffer(java.nio.ByteBuffer srcAddr)
Sets the source hardware address of the Ethernet frame to the supplied byte buffer. |
java.lang.String |
toString()
Presents an Ethernet frame in a readable format, by field. |
static VNSEthernetPacket |
wrap(VNSPacket packet,
java.nio.ByteBuffer dstAddr,
java.nio.ByteBuffer srcAddr,
java.nio.ByteBuffer type)
Constructs an Ethernet packet from its individual fields. |
Methods inherited from class net.clackrouter.packets.VNSPacket |
---|
addToPath, get16bit, get32bit, getByteBuffer, getInputInterfaceName, getLength, getLevel2Type, getNextHopIPAddress, getNextHopMacAddress, getOutputInterfaceName, getParentHeader, getStringBuffer, isPacket, needsSourceAddress, setByteBuffer, setInputInterfaceName, setLevel2Type, setNeedsSourceAddress, setNextHopIPAddress, setNextHopMacAddress, setOutputInterfaceName, setParentHeader |
Methods inherited from class net.clackrouter.protocol.data.VNSData |
---|
isBanner, isClose, isHWInfo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ADDR_LEN
public static final int TYPE_LEN
public static final int BODY_LEN
public static final int MAX_LEN
public static final short TYPE_IP
public static final short TYPE_ARP
Constructor Detail |
---|
public VNSEthernetPacket(java.nio.ByteBuffer packetByteBuffer)
packetByteBuffer
- Buffer of bytes representing an Ethernet frameMethod Detail |
---|
public void pack()
public java.nio.ByteBuffer getDestinationAddressBuffer()
public java.nio.ByteBuffer getSourceAddressBuffer()
public java.nio.ByteBuffer getTypeBuffer()
getType()
public java.nio.ByteBuffer getBodyBuffer()
public short getType()
getTypeBuffer()
public void setBodyBuffer(java.nio.ByteBuffer body)
body
- Byte buffer containing the body of the Ethernet framegetBodyBuffer()
public void setSourceAddressBuffer(java.nio.ByteBuffer srcAddr)
srcAddr
- Byte buffer containing the source hardware address of the
Ethernet framepublic void setDestinationAddressBuffer(java.nio.ByteBuffer dstAddr)
dstAddr
- Byte buffer containing the destination hardware address of the
Ethernet framepublic static VNSEthernetPacket wrap(VNSPacket packet, java.nio.ByteBuffer dstAddr, java.nio.ByteBuffer srcAddr, java.nio.ByteBuffer type) throws VNSInvalidPacketException
packet
- Any packet except an Ethernet framedstAddr
- Destination hardware addresssrcAddr
- Source hardware addresstype
- Type of the higher-level protocol *
VNSInvalidPacketException
public java.lang.String toString()
toString
in class VNSPacket
public static java.nio.ByteBuffer getBroadcastAddress()
public VNSPacket getPayload()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |