net.floodlightcontroller.packet
Class TCP
java.lang.Object
   net.floodlightcontroller.packet.BasePacket
net.floodlightcontroller.packet.BasePacket
       net.floodlightcontroller.packet.TCP
net.floodlightcontroller.packet.TCP
- All Implemented Interfaces: 
- IPacket
- public class TCP 
- extends BasePacket
- Author:
- shudong.zhou@bigswitch.com
 
 
| Constructor Summary | 
| TCP()
 | 
 
 
 
| Methods inherited from class java.lang.Object | 
| finalize, getClass, notify, notifyAll, toString, wait, wait, wait | 
 
sourcePort
protected short sourcePort
destinationPort
protected short destinationPort
sequence
protected int sequence
acknowledge
protected int acknowledge
dataOffset
protected byte dataOffset
flags
protected short flags
windowSize
protected short windowSize
checksum
protected short checksum
urgentPointer
protected short urgentPointer
options
protected byte[] options
TCP
public TCP()
getSourcePort
public short getSourcePort()
- 
- Returns:
- the sourcePort
 
setSourcePort
public TCP setSourcePort(short sourcePort)
- 
- Parameters:
- sourcePort- the sourcePort to set
 
getDestinationPort
public short getDestinationPort()
- 
- Returns:
- the destinationPort
 
setDestinationPort
public TCP setDestinationPort(short destinationPort)
- 
- Parameters:
- destinationPort- the destinationPort to set
 
getChecksum
public short getChecksum()
- 
- Returns:
- the checksum
 
getSequence
public int getSequence()
- 
 
setSequence
public TCP setSequence(int seq)
- 
 
getAcknowledge
public int getAcknowledge()
- 
 
setAcknowledge
public TCP setAcknowledge(int ack)
- 
 
getDataOffset
public byte getDataOffset()
- 
 
setDataOffset
public TCP setDataOffset(byte offset)
- 
 
getFlags
public short getFlags()
- 
 
setFlags
public TCP setFlags(short flags)
- 
 
getWindowSize
public short getWindowSize()
- 
 
setWindowSize
public TCP setWindowSize(short windowSize)
- 
 
getTcpChecksum
public short getTcpChecksum()
- 
 
setTcpChecksum
public TCP setTcpChecksum(short checksum)
- 
 
resetChecksum
public void resetChecksum()
- Description copied from interface: IPacket
- Reset any checksums as needed, and call resetChecksum on all parents
 
- 
- Specified by:
- resetChecksumin interface- IPacket
- Overrides:
- resetChecksumin class- BasePacket
 
- 
 
getUrgentPointer
public short getUrgentPointer(short urgentPointer)
- 
 
setUrgentPointer
public TCP setUrgentPointer(short urgentPointer)
- 
 
getOptions
public byte[] getOptions()
- 
 
setOptions
public TCP setOptions(byte[] options)
- 
 
setChecksum
public TCP setChecksum(short checksum)
- 
- Parameters:
- checksum- the checksum to set
 
serialize
public byte[] serialize()
- Serializes the packet. Will compute and set the following fields if they
 are set to specific values at the time serialize is called:
      -checksum : 0
      -length : 0
 
- 
- Returns:
- a byte[] containing this packet and payloads
 
hashCode
public int hashCode()
- 
- Overrides:
- hashCodein class- BasePacket
 
- 
 
equals
public boolean equals(java.lang.Object obj)
- 
- Overrides:
- equalsin class- BasePacket
 
- 
 
deserialize
public IPacket deserialize(byte[] data,
                           int offset,
                           int length)
                    throws PacketParsingException
- Description copied from interface: IPacket
- Deserializes this packet layer and all possible payloads
 
- 
- offset- offset to start deserializing from
- length- length of the data to deserialize
- Returns:
- the deserialized data
- Throws:
- PacketParsingException