hans- IPv4 Network Stack

Safe HaskellNone




addSackOption :: TcpSocket -> TcpHeader -> TcpHeader Source

Add the Sack option to a tcp packet.

addSackPermitted :: TcpSocket -> TcpHeader -> TcpHeader Source

Add the sack permitted tcp option.

addWindowScale :: TcpSocket -> TcpHeader -> TcpHeader Source

Add the window scale option on the outgoing header.

mkRstAck :: TcpHeader -> Int -> TcpHeader Source

Given a tcp header, generate the next header in the sequence that corresponds to the RST ACK response. As this should only be used in situations in which an ACK was not received, this adds one plus the body length to the ack number.

mkSynAck :: TcpSocket -> TcpHeader Source

Construct a SYN ACK packet, in response to a SYN.

mkFinAck :: TcpSocket -> TcpHeader Source

Construct a FIN packet.

XXX should this include a sack option?

synAck :: Sock () Source

Respond to a SYN message with a SYN ACK message.

ack :: Sock () Source

Send an ACK packet.

delayedAck :: Sock () Source

Schedule a delayed ACK packet.

clearDelayedAck :: Sock () Source

Unschedule a delayed ACK packet.

finAck :: Sock () Source

Queue an outgoing fin packet in the outgoing window, and send it.

NOTE: This uses genSegments, which will pull data out of the waiti

outputSegment :: OutSegment -> Sock () Source

Send a segment.

genSegments :: POSIXTime -> TcpSocket -> (([Wakeup], OutSegments), TcpSocket) Source

Take data from the output buffer, and turn it into segments. When data was freed from the output buffer, the wakeup actions for any threads currently blocked on writing to the output buffer will be returned.