Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Net.PacketParsing
Synopsis
- data PacketParser a
- data InPacket
- doParse :: Parse a => InPacket -> Maybe a
- parseInPacket :: PacketParser a -> InPacket -> Maybe a
- (#!) :: Monad m => m b -> m a -> m b
- (#) :: Functor f => (a -> b) -> f a -> f b
- (<#) :: Monad m => m (a -> b) -> m a -> m b
- class Parse a where
- parse :: PacketParser a
- bytes :: (Eq t, Num t) => t -> PacketParser [Word8]
- bits :: (Integral a, Bits a) => Int -> PacketParser a
- word8 :: PacketParser Word8
- word16 :: PacketParser Word16
- word32 :: PacketParser Word32
- check8 :: Word8 -> PacketParser ()
- check16 :: Word16 -> PacketParser ()
- check :: MonadFail m => Bool -> m ()
- lift :: MonadFail m => Maybe a -> m a
- therest :: PacketParser InPacket
- trunc :: Int -> PacketParser ()
- class Unparse a where
- unparse :: a -> UnparseS
- data OutPacket
- doUnparse :: Unparse a => a -> OutPacket
Documentation
data PacketParser a Source #
Instances
The buffers used to represent packet, when they are received over the network.
parseInPacket :: PacketParser a -> InPacket -> Maybe a Source #
(#!) :: Monad m => m b -> m a -> m b infixl 1 Source #
Perform two monadic computation and return the result from the second one
(#) :: Functor f => (a -> b) -> f a -> f b infixl 1 Source #
Apply a pure function to the result of a monadic computation
(<#) :: Monad m => m (a -> b) -> m a -> m b infixl 1 Source #
Apply a function returned by a monadic computation to an argument returned by a monadic computation
Methods
parse :: PacketParser a Source #
Instances
check8 :: Word8 -> PacketParser () Source #
check16 :: Word16 -> PacketParser () Source #
trunc :: Int -> PacketParser () Source #
class Unparse a where Source #
Instances
The buffers for packets, that are to be sent over the network. Each array contains a header of a layer in the network protocol stack.