|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jpcap.net.Packet net.sourceforge.jpcap.net.EthernetPacket net.sourceforge.jpcap.net.IPPacket net.sourceforge.jpcap.net.TCPPacket
A TCP packet.
Extends an IP packet, adding a TCP header and TCP data payload.
Nested Class Summary |
Nested classes inherited from class net.sourceforge.jpcap.net.IPPacket |
IPPacket.TestProbe |
Field Summary |
Fields inherited from class net.sourceforge.jpcap.net.IPPacket |
_ipOffset |
Fields inherited from class net.sourceforge.jpcap.net.EthernetPacket |
_bytes, _ethOffset |
Fields inherited from interface net.sourceforge.jpcap.net.TCPFields |
TCP_ACK_LEN, TCP_ACK_MASK, TCP_ACK_POS, TCP_CSUM_LEN, TCP_CSUM_POS, TCP_DP_POS, TCP_FIN_MASK, TCP_FLAG_LEN, TCP_FLAG_POS, TCP_HEADER_LEN, TCP_PORT_LEN, TCP_PSH_MASK, TCP_RST_MASK, TCP_SEQ_LEN, TCP_SEQ_POS, TCP_SP_POS, TCP_SYN_MASK, TCP_URG_LEN, TCP_URG_MASK, TCP_URG_POS, TCP_WIN_LEN, TCP_WIN_POS |
Fields inherited from interface net.sourceforge.jpcap.net.IPFields |
IP_CODE_LEN, IP_CODE_POS, IP_CSUM_LEN, IP_CSUM_POS, IP_DST_POS, IP_FRAG_LEN, IP_FRAG_POS, IP_HEADER_LEN, IP_ID_LEN, IP_ID_POS, IP_LEN_LEN, IP_LEN_POS, IP_SRC_POS, IP_TOS_LEN, IP_TOS_POS, IP_TTL_LEN, IP_TTL_POS, IP_VER_LEN, IP_VER_POS |
Fields inherited from interface net.sourceforge.jpcap.net.EthernetFields |
ETH_CODE_LEN, ETH_CODE_POS, ETH_DST_POS, ETH_HEADER_LEN, ETH_SRC_POS |
Constructor Summary | |
TCPPacket(int lLen,
byte[] bytes)
Create a new TCP packet. |
Method Summary | |
long |
getAcknowledgementNumber()
Fetch the packet acknowledgment number. |
long |
getAcknowledgmentNumber()
Fetch the packet acknowledgment number. |
int |
getChecksum()
Fetch the header checksum. |
java.lang.String |
getColor()
Fetch ascii escape sequence of the color associated with this packet type. |
byte[] |
getData()
Fetch the TCP data as a byte array. |
int |
getDestinationPort()
Fetches the port number on the destination host. |
byte[] |
getHeader()
Fetch the TCP header as a byte array. |
int |
getHeaderLength()
Fetches the packet TCP header length. |
int |
getPayloadDataLength()
Fetches the length of the payload data. |
long |
getSequenceNumber()
Fetch the packet sequence number. |
int |
getSourcePort()
Fetch the port number on the source host. |
int |
getTCPChecksum()
Fetch the header checksum. |
byte[] |
getTCPData()
Fetch the TCP data as a byte array. |
byte[] |
getTCPHeader()
Fetch the TCP header a byte array. |
int |
getTcpHeaderLength()
Fetch the TCP header length in bytes. |
int |
getTCPHeaderLength()
Fetch the TCP header length in bytes. |
int |
getUrgentPointer()
Fetch the urgent pointer. |
int |
getWindowSize()
Fetch the window size. |
boolean |
isAck()
Check the ACK flag, flag indicates if the ack number is valid. |
boolean |
isFin()
Check the FIN flag, flag indicates the sender is finished sending. |
boolean |
isPsh()
Check the PSH flag, flag indicates the receiver should pass the data to the application as soon as possible. |
boolean |
isRst()
Check the RST flag, flag indicates the session should be reset between the sender and the receiver. |
boolean |
isSyn()
Check the SYN flag, flag indicates the sequence numbers should be synchronized between the sender and receiver to initiate a connection. |
boolean |
isUrg()
Check the URG flag, flag indicates if the urgent pointer is valid. |
java.lang.String |
toColoredString(boolean colored)
Generate string with contents describing this TCP packet. |
java.lang.String |
toColoredVerboseString(boolean colored)
Convert this TCP packet to a verbose. |
java.lang.String |
toString()
Convert this TCP packet to a readable string. |
Methods inherited from class net.sourceforge.jpcap.net.EthernetPacket |
getDestinationHwAddress, getEthernetData, getEthernetHeader, getEthernetHeaderLength, getEthernetProtocol, getSourceHwAddress |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TCPPacket(int lLen, byte[] bytes)
Method Detail |
public int getSourcePort()
public int getDestinationPort()
public long getSequenceNumber()
public long getAcknowledgmentNumber()
public long getAcknowledgementNumber()
public int getTCPHeaderLength()
public int getTcpHeaderLength()
public int getHeaderLength()
getHeaderLength
in class IPPacket
public int getPayloadDataLength()
public int getWindowSize()
public int getTCPChecksum()
public int getChecksum()
getChecksum
in class IPPacket
public int getUrgentPointer()
public boolean isUrg()
public boolean isAck()
public boolean isPsh()
public boolean isRst()
public boolean isSyn()
public boolean isFin()
public byte[] getTCPHeader()
public byte[] getHeader()
getHeader
in class IPPacket
public byte[] getTCPData()
public byte[] getData()
getData
in class IPPacket
public java.lang.String toString()
toString
in class IPPacket
public java.lang.String toColoredString(boolean colored)
toColoredString
in class IPPacket
colored
- whether or not the string should contain ansi
color escape sequences.public java.lang.String toColoredVerboseString(boolean colored)
toColoredVerboseString
in class IPPacket
public java.lang.String getColor()
getColor
in class IPPacket
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |