Safe Haskell | None |
---|---|
Language | Haskell98 |
- udpProtocol :: IP4Protocol
- newtype UdpPort = UdpPort {
- getUdpPort :: Word16
- parseUdpPort :: Get UdpPort
- renderUdpPort :: Putter UdpPort
- data UdpHeader = UdpHeader {
- udpSourcePort :: !UdpPort
- udpDestPort :: !UdpPort
- udpChecksum :: !Word16
- udpHeaderSize :: Int
- parseUdpHeader :: Get (UdpHeader, Int)
- renderUdpHeader :: UdpHeader -> Int -> Put
- parseUdpPacket :: Get (UdpHeader, ByteString)
- renderUdpPacket :: UdpHeader -> ByteString -> MkPseudoHeader -> IO ByteString
- validateUdpChecksum :: IP4 -> IP4 -> ByteString -> Bool
Documentation
UdpHeader | |
|
parseUdpHeader :: Get (UdpHeader, Int) Source
Parse out a UdpHeader
, and the size of the payload.
renderUdpHeader :: UdpHeader -> Int -> Put Source
Render a UdpHeader
.
renderUdpPacket :: UdpHeader -> ByteString -> MkPseudoHeader -> IO ByteString Source
Given a way to make the pseudo header, render the UDP packet.
validateUdpChecksum :: IP4 -> IP4 -> ByteString -> Bool Source
Recreate the UDP checksum, given a rendered packet, and the source and destination.