hans-2.6.0.0: IPv4 Network Stack

Safe HaskellNone
LanguageHaskell98

Hans.Message.Ip4

Synopsis

Documentation

mkIP4PseudoHeader :: IP4 -> IP4 -> IP4Protocol -> MkPseudoHeader Source

source address | +--------+--------+--------+--------+ | destination address | +--------+--------+--------+--------+ | zero |protocol| length | +--------+--------+--------+--------+

ip4PacketSize :: IP4Header -> ByteString -> Int Source

Calculate the size of an IP4 packet

ip4HeaderSize :: IP4Header -> Int Source

Calculate the size of an IP4 header

splitPacket :: Int -> IP4Header -> ByteString -> [(IP4Header, ByteString)] Source

Fragment a single IP packet into one or more, given an MTU to fit into.

fragmentPacket :: Int64 -> IP4Header -> ByteString -> [(IP4Header, ByteString)] Source

Given a fragment size and a packet, fragment the packet into multiple smaller ones.

getIP4Packet :: Get (IP4Header, Int, Int) Source

Version| IHL |Type of Service| Total Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Identification |Flags| Fragment Offset | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Time to Live | Protocol | Header Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Destination Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

renderIP4Packet :: IP4Header -> ByteString -> IO ByteString Source

The final step to render an IP header and its payload out as a bytestring.