public class TCP extends BasePacket
| Modifier and Type | Field and Description |
|---|---|
protected int |
acknowledge |
protected short |
checksum |
protected byte |
dataOffset |
protected short |
destinationPort |
protected short |
flags |
protected byte[] |
options |
protected int |
sequence |
protected short |
sourcePort |
protected short |
urgentPointer |
protected short |
windowSize |
parent, payload| Constructor and Description |
|---|
TCP() |
| Modifier and Type | Method and Description |
|---|---|
IPacket |
deserialize(byte[] data,
int offset,
int length)
Deserializes this packet layer and all possible payloads.
|
boolean |
equals(Object obj) |
int |
getAcknowledge()
Gets acknowledge number.
|
short |
getChecksum()
Gets checksum.
|
byte |
getDataOffset()
Gets offset.
|
short |
getDestinationPort()
Gets TCP destination port.
|
short |
getFlags()
Gets TCP flags.
|
byte[] |
getOptions()
Gets TCP options.
|
int |
getSequence()
Gets sequence number.
|
short |
getSourcePort()
Gets TCP source port.
|
short |
getUrgentPointer()
Gets urgent pointer.
|
short |
getWindowSize()
Gets TCP window size.
|
int |
hashCode() |
void |
resetChecksum()
Reset any checksums 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(short 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(short sourcePort)
Sets TCP source port.
|
TCP |
setUrgentPointer(short urgentPointer)
Sets urgent pointer.
|
TCP |
setWindowSize(short windowSize)
Sets TCP window size.
|
clone, getParent, getPayload, setParent, setPayloadprotected short sourcePort
protected short 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 short getSourcePort()
public TCP setSourcePort(short sourcePort)
sourcePort - the sourcePort to setpublic short getDestinationPort()
public TCP setDestinationPort(short destinationPort)
destinationPort - the destinationPort to setpublic 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()
IPacketresetChecksum in interface IPacketresetChecksum in class BasePacketpublic 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 BasePacketpublic boolean equals(Object obj)
equals in class BasePacketpublic IPacket deserialize(byte[] data, int offset, int length)
IPacketdata - bytes to deserializeoffset - offset to start deserializing fromlength - length of the data to deserializeCopyright © 2015. All rights reserved.