net.clackrouter.packets
Class VNSTCPPacket
java.lang.Object
net.clackrouter.protocol.data.VNSData
net.clackrouter.packets.VNSPacket
net.clackrouter.packets.VNSTCPPacket
public class VNSTCPPacket
- extends VNSPacket
Represents a Transmission Control Protocol (TCP) Packet.
Options are not supported right now, because they are a pain in the butt.
Perhaps I will support them in the future.
Constructor Summary |
VNSTCPPacket(java.nio.ByteBuffer packetBuffer)
|
VNSTCPPacket(int src_port,
int dst_port,
long seq_num,
long ack_num,
int flags,
int recv_window,
byte[] data)
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DEFAULT_HEADER_LEN
public static final int DEFAULT_HEADER_LEN
- See Also:
- Constant Field Values
TH_FIN
public static final int TH_FIN
- See Also:
- Constant Field Values
TH_SYN
public static final int TH_SYN
- See Also:
- Constant Field Values
TH_RST
public static final int TH_RST
- See Also:
- Constant Field Values
TH_PSH
public static final int TH_PSH
- See Also:
- Constant Field Values
TH_ACK
public static final int TH_ACK
- See Also:
- Constant Field Values
TH_URG
public static final int TH_URG
- See Also:
- Constant Field Values
seq_num
public long seq_num
ack_num
public long ack_num
src_port
public int src_port
dst_port
public int dst_port
recv_window
public int recv_window
control_flags
public int control_flags
data_offset
public int data_offset
m_header_len_bytes
public int m_header_len_bytes
VNSTCPPacket
public VNSTCPPacket(java.nio.ByteBuffer packetBuffer)
VNSTCPPacket
public VNSTCPPacket(int src_port,
int dst_port,
long seq_num,
long ack_num,
int flags,
int recv_window,
byte[] data)
pack
public void pack()
trimDataFront
public void trimDataFront(int numBytes)
trimDataEnd
public void trimDataEnd(int numBytes)
getSourcePort
public int getSourcePort()
getDestinationPort
public int getDestinationPort()
getSeqNum
public long getSeqNum()
getAckNum
public long getAckNum()
getRecvWindowSize
public int getRecvWindowSize()
synFlagSet
public boolean synFlagSet()
ackFlagSet
public boolean ackFlagSet()
finFlagSet
public boolean finFlagSet()
getBodyBuffer
public java.nio.ByteBuffer getBodyBuffer()
getDataSize
public int getDataSize()
getSeqCount
public int getSeqCount()
toString
public java.lang.String toString()
- Description copied from class:
VNSPacket
- Represents the packet in a readable format, by field.
- Overrides:
toString
in class VNSPacket
- Returns:
- Packet in readable format
getByteString
public static java.lang.String getByteString(byte[] arr)
setDestIPAddress
public void setDestIPAddress(java.net.InetAddress addr)
getDestIPAddress
public java.net.InetAddress getDestIPAddress()
setSourceIPAddress
public void setSourceIPAddress(java.net.InetAddress addr)
getSourceIPAddress
public java.net.InetAddress getSourceIPAddress()