Safe Haskell | None |
---|---|
Language | Haskell98 |
- mkIP4PseudoHeader :: IP4 -> IP4 -> IP4Protocol -> MkPseudoHeader
- newtype Ident = Ident {}
- newtype IP4Protocol = IP4Protocol {}
- data IP4Header = IP4Header {
- ip4Version :: !Word8
- ip4TypeOfService :: !Word8
- ip4Ident :: !Ident
- ip4DontFragment :: Bool
- ip4MoreFragments :: Bool
- ip4FragmentOffset :: !Word16
- ip4TimeToLive :: !Word8
- ip4Protocol :: !IP4Protocol
- ip4Checksum :: !Word16
- ip4SourceAddr :: !IP4
- ip4DestAddr :: !IP4
- ip4Options :: [IP4Option]
- emptyIP4Header :: IP4Header
- noMoreFragments :: IP4Header -> IP4Header
- moreFragments :: IP4Header -> IP4Header
- addOffset :: Word16 -> IP4Header -> IP4Header
- setIdent :: Ident -> IP4Header -> IP4Header
- ip4PacketSize :: IP4Header -> ByteString -> Int
- ip4HeaderSize :: IP4Header -> Int
- splitPacket :: Int -> IP4Header -> ByteString -> [(IP4Header, ByteString)]
- fragmentPacket :: Int64 -> IP4Header -> ByteString -> [(IP4Header, ByteString)]
- getIP4Packet :: Get (IP4Header, Int, Int)
- parseIP4Packet :: ByteString -> Either String (IP4Header, Int, Int)
- renderIP4Header :: IP4Header -> Int -> ByteString
- putIP4Header :: IP4Header -> Int -> Put
- renderIP4Packet :: IP4Header -> ByteString -> IO ByteString
- renderOptions :: [IP4Option] -> (ByteString, Word8)
- getOptions :: Int -> Get [IP4Option]
- data IP4Option = IP4Option {}
- ip4OptionSize :: IP4Option -> Int
Documentation
mkIP4PseudoHeader :: IP4 -> IP4 -> IP4Protocol -> MkPseudoHeader Source
source address | +--------+--------+--------+--------+ | destination address | +--------+--------+--------+--------+ | zero |protocol| length | +--------+--------+--------+--------+
newtype IP4Protocol Source
IP4Header | |
|
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 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
parseIP4Packet :: ByteString -> Either String (IP4Header, Int, Int) Source
renderIP4Header :: IP4Header -> Int -> ByteString Source
putIP4Header :: IP4Header -> Int -> Put Source
renderIP4Packet :: IP4Header -> ByteString -> IO ByteString Source
The final step to render an IP header and its payload out as a bytestring.
renderOptions :: [IP4Option] -> (ByteString, Word8) Source
getOptions :: Int -> Get [IP4Option] Source
IP4Option | |
|
ip4OptionSize :: IP4Option -> Int Source