# Handshake

data class Handshake(handshakeVersion: Int = 4, var encryption: EncryptionType = EncryptionType.NONE, var extensionField: Int = ExtensionField.KM_REQ.value, var initialPacketSequence: Int = 0, var MTU: Int = Constants.MTU, var flowWindowsSize: Int = 8192, var handshakeType: HandshakeType = HandshakeType.INDUCTION, var srtSocketId: Int = 762640158, var synCookie: Int = 0, var ipAddress: String = "0.0.0.0", var handshakeExtension: HandshakeExtension? = null) : ControlPacket

Created by pedro on 21/8/23.

0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | HS Version | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Encryption Field | Extension Field | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0| Initial Packet Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Maximum Transmission Unit Size | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Maximum Flow Window Size | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Handshake Type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SRT Socket ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SYN Cookie | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |

-                                                               +

  Content copied to clipboard

| |

-                        Peer IP Address                        +

  Content copied to clipboard

| |

-                                                               +

  Content copied to clipboard

| | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | Extension Type (optional) | Extension Length (optional) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |

-                Extension Contents (optional)                  +

  Content copied to clipboard

| | +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+

## Constructors

Handshake
Link copied to clipboard
constructor(handshakeVersion: Int = 4, encryption: EncryptionType = EncryptionType.NONE, extensionField: Int = ExtensionField.KM_REQ.value, initialPacketSequence: Int = 0, MTU: Int = Constants.MTU, flowWindowsSize: Int = 8192, handshakeType: HandshakeType = HandshakeType.INDUCTION, srtSocketId: Int = 762640158, synCookie: Int = 0, ipAddress: String = "0.0.0.0", handshakeExtension: HandshakeExtension? = null)

## Properties

buffer
Link copied to clipboard
var buffer: ByteArrayOutputStream
controlType
Link copied to clipboard
var controlType: ControlType
encryption
Link copied to clipboard
var encryption: EncryptionType
extensionField
Link copied to clipboard
var extensionField: Int
flowWindowsSize
Link copied to clipboard
var flowWindowsSize: Int
handshakeExtension
Link copied to clipboard
var handshakeExtension: HandshakeExtension?
handshakeType
Link copied to clipboard
var handshakeType: HandshakeType
initialPacketSequence
Link copied to clipboard
var initialPacketSequence: Int
ipAddress
Link copied to clipboard
var ipAddress: String
MTU
Link copied to clipboard
var MTU: Int
socketId
Link copied to clipboard
var socketId: Int
srtSocketId
Link copied to clipboard
var srtSocketId: Int
subtype
Link copied to clipboard
var subtype: ControlType
synCookie
Link copied to clipboard
var synCookie: Int
ts
Link copied to clipboard
var ts: Int
typeSpecificInformation
Link copied to clipboard
var typeSpecificInformation: Int

## Functions

getData
Link copied to clipboard
fun getData(): ByteArray
isErrorType
Link copied to clipboard
fun isErrorType(): Boolean
read
Link copied to clipboard
fun read(input: InputStream)
resetBuffer
Link copied to clipboard
fun resetBuffer()
toString
Link copied to clipboard
open override fun toString(): String
write
Link copied to clipboard
fun write(ts: Int, socketId: Int)