public class TCP extends BasePacket
Modifier and Type | Field and Description |
---|---|
protected int |
acknowledge |
protected short |
checksum |
protected byte |
dataOffset |
protected int |
destinationPort |
protected short |
flags |
protected byte[] |
options |
protected int |
sequence |
protected int |
sourcePort |
protected short |
urgentPointer |
protected short |
windowSize |
parent, payload
Constructor and Description |
---|
TCP() |
Modifier and Type | Method and Description |
---|---|
static Deserializer<TCP> |
deserializer()
Deserializer function for TCP packets.
|
boolean |
equals(java.lang.Object obj) |
int |
getAcknowledge()
Gets acknowledge number.
|
short |
getChecksum()
Gets checksum.
|
byte |
getDataOffset()
Gets offset.
|
int |
getDestinationPort()
Gets TCP destination port.
|
short |
getFlags()
Gets TCP flags.
|
byte[] |
getOptions()
Gets TCP options.
|
int |
getSequence()
Gets sequence number.
|
int |
getSourcePort()
Gets TCP source port.
|
short |
getUrgentPointer()
Gets urgent pointer.
|
short |
getWindowSize()
Gets TCP window size.
|
int |
hashCode() |
void |
resetChecksum()
Reset any checksum as needed, and call resetChecksum on all parents.
|
byte[] |
serialize()
Serializes the packet.
|
TCP |
setAcknowledge(int ack)
Sets acknowledge number.
|
TCP |
setChecksum(short checksum)
Sets checksum.
|
TCP |
setDataOffset(byte offset)
Sets offset.
|
TCP |
setDestinationPort(int destinationPort)
Sets TCP destination port.
|
TCP |
setFlags(short flags)
Sets TCP flags.
|
TCP |
setOptions(byte[] options)
Sets TCP options.
|
TCP |
setSequence(int seq)
Sets sequence number.
|
TCP |
setSourcePort(int sourcePort)
Sets TCP source port.
|
TCP |
setUrgentPointer(short urgentPointer)
Sets urgent pointer.
|
TCP |
setWindowSize(short windowSize)
Sets TCP window size.
|
java.lang.String |
toString() |
clone, getParent, getPayload, setParent, setPayload
protected int sourcePort
protected int destinationPort
protected int sequence
protected int acknowledge
protected byte dataOffset
protected short flags
protected short windowSize
protected short checksum
protected short urgentPointer
protected byte[] options
public int getSourcePort()
public TCP setSourcePort(int sourcePort)
sourcePort
- the sourcePort to set (unsigned 16 bits integer)public int getDestinationPort()
public TCP setDestinationPort(int destinationPort)
destinationPort
- the destinationPort to set (unsigned 16 bits integer)public short getChecksum()
public TCP setChecksum(short checksum)
checksum
- the checksum to setpublic int getSequence()
public TCP setSequence(int seq)
seq
- the sequence number to setpublic int getAcknowledge()
public TCP setAcknowledge(int ack)
ack
- the acknowledge number to setpublic byte getDataOffset()
public TCP setDataOffset(byte offset)
offset
- the offset to setpublic short getFlags()
public TCP setFlags(short flags)
flags
- the TCP flags to setpublic short getWindowSize()
public TCP setWindowSize(short windowSize)
windowSize
- the TCP window size to setpublic void resetChecksum()
IPacket
resetChecksum
in interface IPacket
resetChecksum
in class BasePacket
public short getUrgentPointer()
public TCP setUrgentPointer(short urgentPointer)
urgentPointer
- the urgent pointer to setpublic byte[] getOptions()
public TCP setOptions(byte[] options)
options
- the options to setpublic byte[] serialize()
public int hashCode()
hashCode
in class BasePacket
public boolean equals(java.lang.Object obj)
equals
in class BasePacket
public static Deserializer<TCP> deserializer()
public java.lang.String toString()
toString
in class java.lang.Object