|
||||||||||
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
public class VNSPacket
Encapsulates common functionality of a packet.
Field Summary | |
---|---|
protected java.lang.String |
m_inputInterfaceName
|
protected int |
m_length
|
protected java.nio.ByteBuffer |
m_level2Type
|
protected boolean |
m_local_packet
|
protected java.nio.ByteBuffer |
m_nextHopIPAddr
|
protected java.nio.ByteBuffer |
m_nextHopMacAddr
|
protected java.lang.String |
m_outputInterfaceName
|
protected java.nio.ByteBuffer |
m_packetByteBuffer
|
protected VNSPacket |
mParentHeader
|
Constructor Summary | |
---|---|
protected |
VNSPacket()
Constructs a packet of zero length. |
|
VNSPacket(java.nio.ByteBuffer packetByteBuffer)
Constructs a packet from the supplied byte buffer. |
Method Summary | |
---|---|
void |
addToPath(java.lang.String name)
|
static int |
get16bit(byte[] arr)
|
static long |
get32bit(byte[] arr)
|
java.nio.ByteBuffer |
getByteBuffer()
Returns the byte buffer containing the packet's bytes. |
java.lang.String |
getInputInterfaceName()
Returns the interface name on which the packet came in, e.g. |
int |
getLength()
Returns the length of the packet, in bytes. |
java.nio.ByteBuffer |
getLevel2Type()
|
java.nio.ByteBuffer |
getNextHopIPAddress()
Returns the packet's next-hop IP address. |
java.nio.ByteBuffer |
getNextHopMacAddress()
|
java.lang.String |
getOutputInterfaceName()
Returns the interfaces name on which the packet will leave, e.g "eth1". |
VNSPacket |
getParentHeader()
|
protected java.lang.StringBuffer |
getStringBuffer(java.nio.ByteBuffer byteBuffer)
|
boolean |
isPacket()
|
boolean |
needsSourceAddress()
|
protected void |
setByteBuffer(java.nio.ByteBuffer packetByteBuffer)
Sets the packet's byte buffer to the supplied byte buffer. |
void |
setInputInterfaceName(java.lang.String inputInterfaceName)
Sets the input interface on which the packet came in. |
void |
setLevel2Type(java.nio.ByteBuffer type)
|
void |
setNeedsSourceAddress(boolean local)
|
void |
setNextHopIPAddress(java.nio.ByteBuffer nextHopAddr)
Sets packet's next-hop IP address. |
void |
setNextHopMacAddress(java.nio.ByteBuffer nextHopMacAddr)
|
void |
setOutputInterfaceName(java.lang.String outputInterfaceName)
Sets the output interface on which the packet will go out. |
void |
setParentHeader(VNSPacket parent)
|
java.lang.String |
toString()
Represents the packet in a readable format, by field. |
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 |
---|
protected java.lang.String m_inputInterfaceName
protected java.lang.String m_outputInterfaceName
protected java.nio.ByteBuffer m_nextHopIPAddr
protected java.nio.ByteBuffer m_nextHopMacAddr
protected java.nio.ByteBuffer m_level2Type
protected boolean m_local_packet
protected java.nio.ByteBuffer m_packetByteBuffer
protected int m_length
protected VNSPacket mParentHeader
Constructor Detail |
---|
public VNSPacket(java.nio.ByteBuffer packetByteBuffer)
packetByteBuffer
- Byte buffer containing bytes representing the packetprotected VNSPacket()
Method Detail |
---|
public boolean isPacket()
isPacket
in class VNSData
protected java.lang.StringBuffer getStringBuffer(java.nio.ByteBuffer byteBuffer)
protected void setByteBuffer(java.nio.ByteBuffer packetByteBuffer)
packetByteBuffer
- Byte buffer containing bytes representing the packetpublic void setParentHeader(VNSPacket parent)
public VNSPacket getParentHeader()
public java.lang.String getInputInterfaceName()
public java.lang.String getOutputInterfaceName()
public java.nio.ByteBuffer getNextHopIPAddress()
public void setNeedsSourceAddress(boolean local)
public boolean needsSourceAddress()
public void setInputInterfaceName(java.lang.String inputInterfaceName)
inputInterfaceName
- Interface on which the packet came inpublic void setOutputInterfaceName(java.lang.String outputInterfaceName)
outputInterfaceName
- Interface on which the packet will go outpublic void setNextHopIPAddress(java.nio.ByteBuffer nextHopAddr)
nextHopAddr
- Next-hop IP address.public void setNextHopMacAddress(java.nio.ByteBuffer nextHopMacAddr)
public java.nio.ByteBuffer getNextHopMacAddress()
public void setLevel2Type(java.nio.ByteBuffer type)
public java.nio.ByteBuffer getLevel2Type()
public java.nio.ByteBuffer getByteBuffer()
public int getLength()
public java.lang.String toString()
toString
in class java.lang.Object
public void addToPath(java.lang.String name)
public static long get32bit(byte[] arr)
public static int get16bit(byte[] arr)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |