Class SctpPacket.SctpHeader
java.lang.Object
org.pcap4j.packet.AbstractPacket.AbstractHeader
org.pcap4j.packet.SctpPacket.SctpHeader
- All Implemented Interfaces:
Serializable, Packet.Header, TransportPacket.TransportHeader
- Enclosing class:
SctpPacket
public static final class SctpPacket.SctpHeader
extends AbstractPacket.AbstractHeader
implements TransportPacket.TransportHeader
SCTP header
0 16 31 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Src Port | Dst Port | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Verification Tag | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Chunk #1 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Chunk #n | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Since:
- pcap4j 1.6.6
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate static final intprivate static final intprivate final List<SctpPacket.SctpChunk> private static final intprivate static final intprivate static final intprivate final SctpPortprivate static final longprivate static final intprivate static final intprivate final SctpPortprivate static final intprivate static final intprivate final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSctpHeader(byte[] rawData, int offset, int length) privateSctpHeader(SctpPacket.Builder builder) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringThis method builds the valuetoString()will return.private intprotected intThis method builds the valuehashCode()will return using the byte arraygetRawData()returns.protected intThis method calculates the valuelength()will return by adding up the lengths of byte arrays in the listgetRawFields()returns.booleanIndicates whether some other object is "equal to" this one using return values ofgetRawData().intprotected List<byte[]> Returns a list of byte arrays which represents this header's fields.intMethods inherited from class AbstractPacket.AbstractHeader
buildHexString, buildRawData, getRawData, hashCode, length, toHexString, toStringMethods inherited from interface Packet.Header
getRawData, length
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
SRC_PORT_OFFSET
private static final int SRC_PORT_OFFSET- See Also:
-
SRC_PORT_SIZE
private static final int SRC_PORT_SIZE- See Also:
-
DST_PORT_OFFSET
private static final int DST_PORT_OFFSET- See Also:
-
DST_PORT_SIZE
private static final int DST_PORT_SIZE- See Also:
-
VERIFICATION_TAG_OFFSET
private static final int VERIFICATION_TAG_OFFSET- See Also:
-
VERIFICAION_TAG_SIZE
private static final int VERIFICAION_TAG_SIZE- See Also:
-
CHECKSUM_OFFSET
private static final int CHECKSUM_OFFSET- See Also:
-
CHECKSUM_SIZE
private static final int CHECKSUM_SIZE- See Also:
-
CHUNKS_OFFSET
private static final int CHUNKS_OFFSET- See Also:
-
srcPort
-
dstPort
-
verificationTag
private final int verificationTag -
checksum
private final int checksum -
chunks
-
-
Constructor Details
-
SctpHeader
- Throws:
IllegalRawDataException
-
SctpHeader
-
-
Method Details
-
calcChecksum
private int calcChecksum() -
getSrcPort
- Specified by:
getSrcPortin interfaceTransportPacket.TransportHeader- Returns:
- Source port
-
getDstPort
- Specified by:
getDstPortin interfaceTransportPacket.TransportHeader- Returns:
- Destination port
-
getVerificationTag
public int getVerificationTag()- Returns:
- verification tag
-
getChecksum
public int getChecksum()- Returns:
- checksum
-
getChunks
- Returns:
- chunks
-
getRawFields
Description copied from class:AbstractPacket.AbstractHeaderReturns a list of byte arrays which represents this header's fields. This method is called bycalcLength()andbuildRawData().- Specified by:
getRawFieldsin classAbstractPacket.AbstractHeader- Returns:
- a list of byte arrays which represents this header's fields
-
calcLength
protected int calcLength()Description copied from class:AbstractPacket.AbstractHeaderThis method calculates the valuelength()will return by adding up the lengths of byte arrays in the listgetRawFields()returns.- Overrides:
calcLengthin classAbstractPacket.AbstractHeader- Returns:
- a calculated length
-
buildString
Description copied from class:AbstractPacket.AbstractHeaderThis method builds the valuetoString()will return.- Overrides:
buildStringin classAbstractPacket.AbstractHeader- Returns:
- a string representation of this object
-
equals
Description copied from class:AbstractPacket.AbstractHeaderIndicates whether some other object is "equal to" this one using return values ofgetRawData(). This method should be overridden so that it does more strict comparisons more efficiently.- Overrides:
equalsin classAbstractPacket.AbstractHeader
-
calcHashCode
protected int calcHashCode()Description copied from class:AbstractPacket.AbstractHeaderThis method builds the valuehashCode()will return using the byte arraygetRawData()returns. This method may be better to be overridden for performance reason.- Overrides:
calcHashCodein classAbstractPacket.AbstractHeader- Returns:
- a calculated hash code value for the object
-