hans-3.0.2: Network Stack

Safe HaskellNone
LanguageHaskell2010

Hans.Tcp.Packet

Contents

Synopsis

Header

tcpHeaderSize :: TcpHeader -> Int Source #

The encoded size of a header.

Sequence Numbers

type TcpAckNum = TcpSeqNum Source #

An alias to TcpSeqNum, as these two are used in the same role.

Header Flags

Serialization

getTcpHeader :: Get TcpHeader Source #

Parse a TcpHeader.

putTcpHeader :: Putter TcpHeader Source #

Render a TcpHeader. The checksum value is never rendered, as it is expected to be calculated and poked in afterwords.

Options

setTcpOption :: HasTcpOptions opts => TcpOption -> opts -> opts Source #

setTcpOptions :: HasTcpOptions opts => [TcpOption] -> opts -> opts Source #

tcpOptionsSize :: [TcpOption] -> (Int, Int) Source #

Get the rendered length of a list of TcpOptions, in 4-byte words, and the number of padding bytes required. This rounds up to the nearest 4-byte word.

Segment Operations

tcpSegLen :: TcpHeader -> Int -> Int Source #

The length of the data segment, including Syn and Fin.

tcpSegLastSeqNum :: TcpHeader -> Int -> TcpSeqNum Source #

The last sequence number used in a segment.

tcpSegNextAckNum :: TcpHeader -> Int -> TcpAckNum Source #

The ack number for this segment.