public abstract class AbstractSegment extends BasePacket
| Modifier and Type | Field and Description |
|---|---|
protected short |
checksum |
protected short |
destinationPort |
protected short |
sourcePort |
parent, payload| Constructor and Description |
|---|
AbstractSegment() |
| Modifier and Type | Method and Description |
|---|---|
IPacket |
deserialize(byte[] data,
int offset,
int length)
Deserializes this packet layer and all possible payloads.
|
short |
getChecksum()
Gets the checksum
|
short |
getDestinationPort()
Gets the destination port
|
short |
getSourcePort()
Gets the source port
|
int |
hashCode(int prime)
Method for subclass hashCode() to piggyback onto
|
void |
resetChecksum()
Reset any checksums as needed, and call resetChecksum on all parents.
|
void |
serialize(ByteBuffer bb,
int length)
Serialization method that calculates the checksum from pseudo- header.
|
AbstractSegment |
setChecksum(short checksum)
Sets the checksum
|
AbstractSegment |
setDestinationPort(short destinationPort)
Sets the destination port
|
AbstractSegment |
setSourcePort(short sourcePort)
Sets the source port
|
clone, equals, getParent, getPayload, hashCode, setParent, setPayloadprotected short sourcePort
protected short destinationPort
protected short checksum
public short getSourcePort()
public AbstractSegment setSourcePort(short sourcePort)
sourcePort - the sourcePort to setpublic short getDestinationPort()
public AbstractSegment setDestinationPort(short destinationPort)
destinationPort - the destinationPort to setpublic short getChecksum()
public AbstractSegment setChecksum(short checksum)
checksum - the checksum to setpublic void resetChecksum()
IPacketresetChecksum in interface IPacketresetChecksum in class BasePacketpublic void serialize(ByteBuffer bb, int length)
bb - The ByteBuffer for the data being serializedl4type - The protocol typelength - length of segmentpublic IPacket deserialize(byte[] data, int offset, int length)
IPacketoffset - offset to start deserializing fromlength - length of the data to deserializepublic int hashCode(int prime)
Copyright © 2015. All rights reserved.