-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | data and parsers for Ethernet, TCP, UDP, IPv4, IPv6, ICMP, DHCP, TFTP
--   
--   The network stack extracted from the House
--   (<a>https://code.google.com/p/pdxhouse/</a>) project.
--   
--   Provides data structures and parsers for Ethernet, TCP, UDP, IPv4,
--   IPv6, ICMP, DHCP and TFTP packets as well as some server
--   implementations.
--   
--   This package was extracted from house due to the lack of existing
--   network package parsing libraries.
@package network-house
@version 0.1.0.2

module Net.Bits
(.!.) :: (Num b, Bits p, FiniteBits b, Integral p) => p -> Int -> b
nextTo :: (Bits a3, Num a3, Integral a1, Integral a2, FiniteBits a1) => a2 -> a1 -> a3
catBits :: (FiniteBits a, Num t, Bits t, Integral a) => [a] -> t
showHex :: (Show a, Integral a) => a -> String
showBin :: FiniteBits a => a -> [Char]
showHex' :: (Integral a, Show a) => Int -> a -> [Char]


-- | Concurrency primitives abstracted away from the IO monad
module Net.Concurrent
class (Functor io, Monad io) => ForkIO io
fork :: ForkIO io => io () -> io ThreadId
kill :: ForkIO io => ThreadId -> io ()
class (Functor io, Monad io) => DelayIO io
delay :: DelayIO io => Int -> io ()
class (Functor io, Monad io) => ChannelIO c io | io -> c
newChan :: ChannelIO c io => io (c a)
readChan :: ChannelIO c io => c a -> io a
writeChan :: ChannelIO c io => c a -> a -> io ()
class (Functor io, Monad io) => MVarIO v io | io -> v
newEmptyMVar :: MVarIO v io => io (v a)
newMVar :: MVarIO v io => a -> io (v a)
putMVar :: MVarIO v io => v a -> a -> io ()
takeMVar :: MVarIO v io => v a -> io a
readMVar :: MVarIO v io => v a -> io a
class (Functor io, Monad io) => RefIO r io | io -> r
newRef :: RefIO r io => a -> io (r a)
readRef :: RefIO r io => r a -> io a
writeRef :: RefIO r io => r a -> a -> io ()
instance (Control.Monad.Trans.Class.MonadTrans t, GHC.Base.Monad m, GHC.Base.Functor (t m), GHC.Base.Monad (t m), Net.Concurrent.RefIO c m) => Net.Concurrent.RefIO c (t m)
instance (Control.Monad.Trans.Class.MonadTrans t, GHC.Base.Monad m, GHC.Base.Functor (t m), GHC.Base.Monad (t m), Net.Concurrent.MVarIO v m) => Net.Concurrent.MVarIO v (t m)
instance (Control.Monad.Trans.Class.MonadTrans t, GHC.Base.Monad m, GHC.Base.Functor (t m), GHC.Base.Monad (t m), Net.Concurrent.ChannelIO c m) => Net.Concurrent.ChannelIO c (t m)
instance (Control.Monad.Trans.Class.MonadTrans t, GHC.Base.Monad m, GHC.Base.Functor (t m), GHC.Base.Monad (t m), Net.Concurrent.DelayIO m) => Net.Concurrent.DelayIO (t m)

module Net.IO
instance Net.Concurrent.ForkIO GHC.Types.IO
instance Net.Concurrent.DelayIO GHC.Types.IO
instance Net.Concurrent.ChannelIO Control.Concurrent.Chan.Chan GHC.Types.IO
instance Net.Concurrent.MVarIO GHC.MVar.MVar GHC.Types.IO
instance Net.Concurrent.RefIO GHC.IORef.IORef GHC.Types.IO

module Net.Interface
data Interface m i o
Interface :: m i -> (o -> m ()) -> Interface m i o
[rx] :: Interface m i o -> m i
[tx] :: Interface m i o -> o -> m ()
data TimedInterface m i o
TimedInterface :: (Maybe Int -> m (Maybe i)) -> (o -> m ()) -> TimedInterface m i o
[rxT] :: TimedInterface m i o -> Maybe Int -> m (Maybe i)
[txT] :: TimedInterface m i o -> o -> m ()


-- | Various utilities used in the network protocol stack modules
module Net.Utils
class Functor f => Container f
contents :: Container f => f a -> a
replace :: Functor f => f b1 -> b2 -> f b2
emap :: (Container f2, Functor f1) => (t -> f1 b) -> f2 t -> f1 f2 b
emap2 :: (Functor f3, Container f2, Container f1) => (t -> f3 b) -> f1 f2 t -> f3 f1 f2 b
lift :: (Container f2, Functor f1) => f2 f1 b -> f1 f2 b
lift2 :: (Functor f3, Container f2, Container f1) => f1 f2 f3 b -> f3 f1 f2 b
doReq :: (MVarIO v io, MVarIO v m, ChannelIO c m) => c a -> ((b -> io ()) -> a) -> m b
foldlArray :: (IArray arr elem, Ix ix, Enum ix) => arr ix elem -> (elem -> a -> a) -> a -> a

-- | The number of elements in an array
arraySize :: (Ix a1, IArray a2 e, Num a1) => a2 a1 e -> a1

-- | TCP/IP 16-bit checksums
checksum :: [Word16] -> Word16

-- | Split a list into subcomponents of length 2. The first argument is
--   what to append in case the list is of odd length.
pairs :: a -> [a] -> [[a]]
bytes_to_words_big :: [Word8] -> [Word16]
bytes_to_words_lil :: [Word8] -> [Word16]
words_to_bytes_big :: [Word16] -> [Word8]
words_to_bytes_lil :: [Word16] -> [Word8]

module Net.Packet

-- | 8-bit unsigned integer type
data Word8 :: *

-- | The buffers used to represent packet, when they are received over the
--   network.
data InPacket
len :: InPacket -> Int
emptyInPack :: InPacket
toInPack :: Chunk -> InPacket
takeInPack :: Int -> InPacket -> InPacket
dropInPack :: Int -> InPacket -> InPacket

-- | Get a byte at a certain offset.
byteAt :: InPacket -> Int -> Word8

-- | Get a word from a certain offset (big endian).
wordAt :: InPacket -> Int -> Word16
toChunk :: InPacket -> Chunk

-- | 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.
data OutPacket
outLen :: OutPacket -> Int
chunks :: OutPacket -> [Chunk]
type Chunk = UArray Int Word8
emptyOutPack :: OutPacket
addChunk :: Chunk -> OutPacketS
appendOutPack :: OutPacket -> OutPacket -> OutPacket
splitOutPack :: Int -> OutPacket -> (OutPacket, OutPacket)
outBytes :: OutPacket -> [Word8]
loopback :: OutPacket -> InPacket
loopbackout :: InPacket -> OutPacket
instance GHC.Show.Show Net.Packet.InPacket
instance GHC.Show.Show Net.Packet.OutPacket

module Net.PacketParsing
data PacketParser a

-- | The buffers used to represent packet, when they are received over the
--   network.
data InPacket
doParse :: Parse a => InPacket -> Maybe a
parseInPacket :: () => PacketParser a -> InPacket -> Maybe a

-- | Perform two monadic computation and return the result from the second
--   one
(#!) :: Monad m => m b -> m a -> m b
infixl 1 #!

-- | Apply a pure function to the result of a monadic computation
(#) :: Functor f => (a -> b) -> f a -> f b
infixl 1 #

-- | Apply a function returned by a monadic computation to an argument
--   returned by a monadic computation
(<#) :: Monad m => m (a -> b) -> m a -> m b
infixl 1 <#
class Parse a
parse :: Parse a => PacketParser a
bytes :: (Num t, Eq 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 :: Monad m => Bool -> m ()
lift :: Monad m => Maybe a -> m a
therest :: PacketParser InPacket
trunc :: Int -> PacketParser ()
class Unparse a
unparse :: Unparse a => a -> UnparseS

-- | 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.
data OutPacket
doUnparse :: Unparse a => a -> OutPacket
instance Net.PacketParsing.Unparse GHC.Word.Word8
instance Net.PacketParsing.Unparse GHC.Word.Word16
instance Net.PacketParsing.Unparse GHC.Word.Word32
instance Net.PacketParsing.Unparse Net.Packet.OutPacket
instance Net.PacketParsing.Unparse Net.Packet.Chunk
instance Net.PacketParsing.Unparse Net.Packet.InPacket
instance Net.PacketParsing.Unparse ()
instance (Net.PacketParsing.Unparse a, Net.PacketParsing.Unparse b) => Net.PacketParsing.Unparse (a, b)
instance (Net.PacketParsing.Unparse a, Net.PacketParsing.Unparse b, Net.PacketParsing.Unparse c) => Net.PacketParsing.Unparse (a, b, c)
instance (Net.PacketParsing.Unparse a, Net.PacketParsing.Unparse b, Net.PacketParsing.Unparse c, Net.PacketParsing.Unparse d) => Net.PacketParsing.Unparse (a, b, c, d)
instance (Net.PacketParsing.Unparse a, Net.PacketParsing.Unparse b, Net.PacketParsing.Unparse c, Net.PacketParsing.Unparse d, Net.PacketParsing.Unparse e) => Net.PacketParsing.Unparse (a, b, c, d, e)
instance Net.PacketParsing.Unparse a => Net.PacketParsing.Unparse [a]
instance Net.PacketParsing.Unparse GHC.Types.Char
instance Net.PacketParsing.Parse Net.Packet.InPacket
instance Net.PacketParsing.Parse (Data.Array.Base.UArray GHC.Types.Int GHC.Word.Word8)
instance (Net.PacketParsing.Parse a, Net.PacketParsing.Parse b) => Net.PacketParsing.Parse (a, b)
instance (Net.PacketParsing.Parse a, Net.PacketParsing.Parse b, Net.PacketParsing.Parse c) => Net.PacketParsing.Parse (a, b, c)
instance (Net.PacketParsing.Parse a, Net.PacketParsing.Parse b, Net.PacketParsing.Parse c, Net.PacketParsing.Parse d) => Net.PacketParsing.Parse (a, b, c, d)
instance Net.PacketParsing.Parse a => Net.PacketParsing.Parse [a]
instance Net.PacketParsing.Parse GHC.Types.Bool
instance Net.PacketParsing.Parse GHC.Word.Word8
instance Net.PacketParsing.Parse GHC.Word.Word16
instance Net.PacketParsing.Parse GHC.Word.Word32
instance Net.PacketParsing.Parse GHC.Types.Char
instance GHC.Base.Functor Net.PacketParsing.PacketParser
instance GHC.Base.Applicative Net.PacketParsing.PacketParser
instance GHC.Base.Monad Net.PacketParsing.PacketParser
instance GHC.Base.MonadPlus Net.PacketParsing.PacketParser
instance GHC.Base.Alternative Net.PacketParsing.PacketParser

module Net.TFTP
data Packet
RRQ :: Filename -> Mode -> Packet
WRQ :: Filename -> Mode -> Packet
Data :: BlockNr -> Data -> Packet
Ack :: BlockNr -> Packet
Error :: ErrorCode -> ErrMsg -> Packet
type Filename = String
type Mode = String
type BlockNr = Word16
type Data = UArray Int Word8
newtype ErrorCode
E :: Word16 -> ErrorCode
type ErrMsg = String
string :: PacketParser [Char]
unstring :: Unparse a => a -> UnparseS
instance GHC.Show.Show Net.TFTP.Packet
instance GHC.Show.Show Net.TFTP.ErrorCode
instance GHC.Classes.Eq Net.TFTP.ErrorCode
instance Net.PacketParsing.Parse Net.TFTP.Packet
instance Net.PacketParsing.Unparse Net.TFTP.Packet
instance Net.PacketParsing.Parse Net.TFTP.ErrorCode
instance Net.PacketParsing.Unparse Net.TFTP.ErrorCode


-- | Port numbers (used by UDP and TCP) and some standard port numbers
module Net.PortNumber
newtype Port
Port :: Word16 -> Port
echo :: Port
telnet :: Port
bootps :: Port
bootpc :: Port
tftp :: Port
http :: Port
instance GHC.Show.Show Net.PortNumber.Port
instance GHC.Enum.Bounded Net.PortNumber.Port
instance GHC.Classes.Ord Net.PortNumber.Port
instance GHC.Classes.Eq Net.PortNumber.Port
instance GHC.Enum.Enum Net.PortNumber.Port
instance Net.PacketParsing.Parse Net.PortNumber.Port
instance Net.PacketParsing.Unparse Net.PortNumber.Port

module Net.UDP
data Packet content
Packet :: !Port -> !Word16 -> !Word16 -> !content -> Packet content
[sourcePort, destPort] :: Packet content -> !Port
[len] :: Packet content -> !Word16
[checksum] :: Packet content -> !Word16
[content] :: Packet content -> !content
template :: () => Port -> Port -> content -> Packet content
newtype Port
Port :: Word16 -> Port
instance GHC.Show.Show content => GHC.Show.Show (Net.UDP.Packet content)
instance GHC.Base.Functor Net.UDP.Packet
instance Net.Utils.Container Net.UDP.Packet
instance Net.PacketParsing.Parse a => Net.PacketParsing.Parse (Net.UDP.Packet a)
instance Net.PacketParsing.Unparse a => Net.PacketParsing.Unparse (Net.UDP.Packet a)

module Net.TCP
data Packet content
Packet :: !Port -> !Word32 -> !Word8 -> !ECN -> !ControlBits -> !Word16 -> !Word16 -> !Word16 -> ![Option] -> !content -> Packet content
[sourcePort, destPort] :: Packet content -> !Port
[seqNr, ackNr] :: Packet content -> !Word32
[dataOffset] :: Packet content -> !Word8
[ecn] :: Packet content -> !ECN
[controlBits] :: Packet content -> !ControlBits
[window] :: Packet content -> !Word16
[checksum] :: Packet content -> !Word16
[urgentPointer] :: Packet content -> !Word16
[options] :: Packet content -> ![Option]
[content] :: Packet content -> !content
template :: Packet ()
data ECN
ECN :: !Bool -> ECN
[n, c, e] :: ECN -> !Bool
data ControlBits
CB :: !Bool -> ControlBits
[urg, ack, psh, rst, syn, fin] :: ControlBits -> !Bool
type Option = Word8
toBits :: (Foldable t, Num b) => t Bool -> b
instance GHC.Show.Show content => GHC.Show.Show (Net.TCP.Packet content)
instance GHC.Show.Show Net.TCP.ControlBits
instance GHC.Enum.Bounded Net.TCP.ControlBits
instance GHC.Classes.Eq Net.TCP.ControlBits
instance GHC.Enum.Bounded Net.TCP.ECN
instance GHC.Show.Show Net.TCP.ECN
instance GHC.Base.Functor Net.TCP.Packet
instance Net.Utils.Container Net.TCP.Packet
instance Net.PacketParsing.Parse content => Net.PacketParsing.Parse (Net.TCP.Packet content)
instance Net.PacketParsing.Unparse content => Net.PacketParsing.Unparse (Net.TCP.Packet content)
instance Net.PacketParsing.Parse Net.TCP.ControlBits
instance Net.PacketParsing.Parse Net.TCP.ECN

module Net.IPv4
data Addr
Addr :: !Word8 -> !Word8 -> !Word8 -> !Word8 -> Addr
loopbackAddr :: Addr
broadcastAddr :: Addr -> Addr
type Netmask = Addr
netmaskA :: Addr
netmaskB :: Addr
netmaskC :: Addr
defaultNetmask :: Addr -> Addr
sameNet :: (Addr, Addr) -> Addr -> Bool
liftA1 :: (Word8 -> Word8) -> Addr -> Addr
liftA2 :: (Word8 -> Word8 -> Word8) -> Addr -> Addr -> Addr
andAddr :: Addr -> Addr -> Addr
orAddr :: Addr -> Addr -> Addr
complAddr :: Addr -> Addr
data Precedence
Routine :: Precedence
Priority :: Precedence
Immediate :: Precedence
Flash :: Precedence
Flash_Override :: Precedence
CRITIC_ECP :: Precedence
Internetwork_Control :: Precedence
Network_Control :: Precedence
data Packet content
Packet :: !Word8 -> !Int -> !TypeOfService -> !Word16 -> !Word16 -> !Flags -> !Word16 -> !Word8 -> !Protocol -> !Word16 -> !Addr -> ![Word8] -> !content -> Packet content
[version] :: Packet content -> !Word8
[headerLen] :: Packet content -> !Int
[tos] :: Packet content -> !TypeOfService
[totalLen] :: Packet content -> !Word16
[identifier] :: Packet content -> !Word16
[flags] :: Packet content -> !Flags
[fragOff] :: Packet content -> !Word16
[timeToLive] :: Packet content -> !Word8
[protocol] :: Packet content -> !Protocol
[headerCheck] :: Packet content -> !Word16
[source, dest] :: Packet content -> !Addr
[options] :: Packet content -> ![Word8]
[content] :: Packet content -> !content
data TypeOfService
TOS :: !Precedence -> !Bool -> !Bool -> !Bool -> TypeOfService
[precedence] :: TypeOfService -> !Precedence
[lowDelay] :: TypeOfService -> !Bool
[highThrough] :: TypeOfService -> !Bool
[highReal] :: TypeOfService -> !Bool
data Flags
Flags :: !Bool -> !Bool -> Flags
[don'tFrag] :: Flags -> !Bool
[moreFrags] :: Flags -> !Bool
skip :: Int -> PacketParser Word32
template :: () => Protocol -> Addr -> Addr -> content -> Packet content
data Protocol
ICMP :: Protocol
TCP :: Protocol
UDP :: Protocol
Unknown :: !Word8 -> Protocol
num_prot :: [(Int, Protocol)]
prot_num :: [(Protocol, Int)]
data Option
Short :: Word8 -> Option
Long :: OptType -> Word8 -> [Word8] -> Option
[optType] :: Option -> OptType
[optLen] :: Option -> Word8
[optData] :: Option -> [Word8]
data OptType
OptType :: Bool -> OptClass -> Word8 -> OptType
[optCopied] :: OptType -> Bool
[optClass] :: OptType -> OptClass
[optNumber] :: OptType -> Word8
data OptClass
Control :: OptClass
Reserved1 :: OptClass
DebugMeasure :: OptClass
Reserved4 :: OptClass
ipv4unparse :: Packet OutPacket -> OutPacket
instance GHC.Enum.Enum Net.IPv4.OptClass
instance GHC.Show.Show content => GHC.Show.Show (Net.IPv4.Packet content)
instance GHC.Classes.Eq Net.IPv4.Protocol
instance GHC.Show.Show Net.IPv4.Protocol
instance GHC.Show.Show Net.IPv4.Flags
instance GHC.Show.Show Net.IPv4.TypeOfService
instance GHC.Enum.Enum Net.IPv4.Precedence
instance GHC.Show.Show Net.IPv4.Precedence
instance GHC.Classes.Ord Net.IPv4.Addr
instance GHC.Classes.Eq Net.IPv4.Addr
instance GHC.Base.Functor Net.IPv4.Packet
instance Net.Utils.Container Net.IPv4.Packet
instance Net.PacketParsing.Parse contents => Net.PacketParsing.Parse (Net.IPv4.Packet contents)
instance Net.PacketParsing.Unparse a => Net.PacketParsing.Unparse (Net.IPv4.Packet a)
instance GHC.Enum.Enum Net.IPv4.Protocol
instance Net.PacketParsing.Parse Net.IPv4.Protocol
instance Net.PacketParsing.Unparse Net.IPv4.Protocol
instance Net.PacketParsing.Parse Net.IPv4.Flags
instance Net.PacketParsing.Parse Net.IPv4.TypeOfService
instance Net.PacketParsing.Parse Net.IPv4.Precedence
instance Net.PacketParsing.Parse Net.IPv4.Addr
instance Net.PacketParsing.Unparse Net.IPv4.Addr
instance GHC.Show.Show Net.IPv4.Addr
instance GHC.Read.Read Net.IPv4.Addr

module Net.TCP_Client
initialize :: (DelayIO m, ForkIO m, ChannelIO c m, MVarIO v m) => ([Char] -> m ()) -> Addr -> Interface m TCPPacketIn Packet Packet OutPacket -> m Interface m
data Active m
Active :: m () -> Interface m InPacket OutPacket -> Active m
[close] :: Active m -> m ()
[io] :: Active m -> Interface m InPacket OutPacket
tx :: () => Active m -> OutPacket -> m ()
rx :: () => Active m -> m InPacket
data Passive m
Passive :: m (Peer, Active m) -> m () -> Passive m
[accept] :: Passive m -> m (Peer, Active m)
[unlisten] :: Passive m -> m ()
data Interface m
Interface :: (Port -> m (Passive m)) -> (Peer -> m (Maybe (Active m))) -> Interface m
[listen] :: Interface m -> Port -> m (Passive m)
[connect] :: Interface m -> Peer -> m (Maybe (Active m))
type Peer = (Addr, Port)
newtype Port
Port :: Word16 -> Port
instance GHC.Show.Show Net.TCP_Client.Phase
instance GHC.Classes.Ord Net.TCP_Client.Phase
instance GHC.Classes.Eq Net.TCP_Client.Phase

module Net.IPv6
data Addr
Addr :: !Word16 -> !Word16 -> !Word16 -> !Word16 -> !Word16 -> !Word16 -> !Word16 -> !Word16 -> Addr
newtype Word4
Word4 :: Word8 -> Word4
newtype Word20
Word20 :: Word32 -> Word20
data Packet content
Packet :: !Word4 -> !Word8 -> !Word20 -> !Word16 -> !Protocol -> !Word8 -> !Addr -> !Addr -> !content -> Packet content
[version] :: Packet content -> !Word4
[traffic_class] :: Packet content -> !Word8
[flow_label] :: Packet content -> !Word20
[payload_length] :: Packet content -> !Word16
[next_header] :: Packet content -> !Protocol
[hop_limit] :: Packet content -> !Word8
[source] :: Packet content -> !Addr
[dest] :: Packet content -> !Addr
[content] :: Packet content -> !content
instance GHC.Classes.Eq Net.IPv6.Addr
instance GHC.Base.Functor Net.IPv6.Packet
instance Net.PacketParsing.Parse content => Net.PacketParsing.Parse (Net.IPv6.Packet content)
instance Net.PacketParsing.Unparse content => Net.PacketParsing.Unparse (Net.IPv6.Packet content)
instance Net.PacketParsing.Parse Net.IPv6.Word20
instance Net.PacketParsing.Parse Net.IPv6.Word4
instance Net.PacketParsing.Parse Net.IPv6.Addr
instance Net.PacketParsing.Unparse Net.IPv6.Addr

module Net.IPv4Link
initialize :: Monad m => (Addr, Addr) -> Maybe Addr -> Interface m i (Addr, Packet content) -> Interface m i Packet content

module Net.ICMP
data Packet
EchoRequest :: EchoMsg -> Packet
EchoReply :: EchoMsg -> Packet
Other :: !MessageType -> !Word8 -> !Word16 -> UArray Int Word8 -> Packet
[type_] :: Packet -> !MessageType
[code] :: Packet -> !Word8
[chksum] :: Packet -> !Word16
[content] :: Packet -> UArray Int Word8
data EchoMsg
Echo :: !Word16 -> !Word16 -> UArray Int Word8 -> EchoMsg
[ident] :: EchoMsg -> !Word16
[seqNum] :: EchoMsg -> !Word16
[echoData] :: EchoMsg -> UArray Int Word8
icmpUnparse :: Packet -> OutPacket
echoUnparse :: Bool -> EchoMsg -> OutPacket
data MessageType
Echo_Reply :: MessageType
Unknown1 :: MessageType
Unknown2 :: MessageType
Destination_Unreachable :: MessageType
Source_Quench :: MessageType
Redirect :: MessageType
Unknown6 :: MessageType
Unknown7 :: MessageType
Echo_Request :: MessageType
Unknown9 :: MessageType
Unknown10 :: MessageType
Time_Exceeded :: MessageType
Parameter_Problem :: MessageType
Timestamp :: MessageType
Timestamp_Reply :: MessageType
Information_Request :: MessageType
Information_Reply :: MessageType
UnknownOther :: MessageType
instance GHC.Show.Show Net.ICMP.Packet
instance GHC.Show.Show Net.ICMP.MessageType
instance GHC.Enum.Bounded Net.ICMP.MessageType
instance GHC.Enum.Enum Net.ICMP.MessageType
instance GHC.Classes.Eq Net.ICMP.MessageType
instance GHC.Show.Show Net.ICMP.EchoMsg
instance Net.PacketParsing.Parse Net.ICMP.Packet
instance Net.PacketParsing.Unparse Net.ICMP.Packet
instance Net.PacketParsing.Parse Net.ICMP.MessageType
instance Net.PacketParsing.Parse Net.ICMP.EchoMsg

module Net.Ethernet
data Interface m i o
Interface :: Addr -> Interface m i o -> Interface m i o
[myMAC] :: Interface m i o -> Addr
[io] :: Interface m i o -> Interface m i o
rx :: () => Interface m i o -> m i
tx :: () => Interface m i o -> o -> m ()
data Addr
Addr :: !Word8 -> !Word8 -> !Word8 -> !Word8 -> !Word8 -> !Word8 -> Addr
broadcastAddr :: Addr
data Packet content
Packet :: Addr -> Addr -> PacketType -> content -> Packet content
[dest] :: Packet content -> Addr
[source] :: Packet content -> Addr
[packType] :: Packet content -> PacketType
[content] :: Packet content -> content
data PacketType
Ethernet :: !Int -> PacketType
IPv4 :: PacketType
IPv6 :: PacketType
ARP :: PacketType
Unknown :: !Word16 -> PacketType
unparse :: Packet OutPacket -> OutPacket
instance GHC.Show.Show content => GHC.Show.Show (Net.Ethernet.Packet content)
instance GHC.Show.Show Net.Ethernet.PacketType
instance GHC.Classes.Eq Net.Ethernet.PacketType
instance GHC.Enum.Bounded Net.Ethernet.Addr
instance GHC.Classes.Ord Net.Ethernet.Addr
instance GHC.Classes.Eq Net.Ethernet.Addr
instance GHC.Base.Functor Net.Ethernet.Packet
instance Net.Utils.Container Net.Ethernet.Packet
instance Net.PacketParsing.Parse content => Net.PacketParsing.Parse (Net.Ethernet.Packet content)
instance GHC.Enum.Enum Net.Ethernet.PacketType
instance Net.PacketParsing.Parse Net.Ethernet.PacketType
instance Net.PacketParsing.Parse Net.Ethernet.Addr
instance Net.PacketParsing.Unparse Net.Ethernet.Addr
instance GHC.Show.Show Net.Ethernet.Addr

module Net.IPv4OverEthernet
initialize :: Monad m => (t -> m Maybe Addr) -> Interface m i Packet b -> Interface m i (t, b)

module Net.DHCP
serverPort :: Port
clientPort :: Port
data Packet
Packet :: Operation -> Word32 -> Word16 -> Flags -> Addr -> Addr -> String -> String -> Options -> Packet
[opcode] :: Packet -> Operation
[xid] :: Packet -> Word32
[secs] :: Packet -> Word16
[flags] :: Packet -> Flags
[ciaddr, yiaddr, siaddr, giaddr] :: Packet -> Addr
[chaddr] :: Packet -> Addr
[sname] :: Packet -> String
[file] :: Packet -> String
[options] :: Packet -> Options
data Operation
BootRequest :: Operation
BootReply :: Operation
data Flags
Flags :: Bool -> Flags
[broadcast] :: Flags -> Bool
newtype Options
Options :: [Option] -> Options
data Option
Pad :: Option
End :: Option
SubnetMask :: Addr -> Option
TimeOffset :: Option
Routers :: [Addr] -> Option
DNS_Servers :: [Addr] -> Option
HostName :: String -> Option
DomainName :: String -> Option
BroadcastAddress :: Addr -> Option
NTP_Servers :: [Addr] -> Option
RequestedIPAddress :: Addr -> Option
LeaseTime :: Word32 -> Option
OptionOverload :: Word8 -> Option
MessageType :: MessageType -> Option
ServerIdentifier :: Addr -> Option
Unknown :: Word8 -> [Word8] -> Option
data MessageType
Discover :: MessageType
Offer :: MessageType
Request :: MessageType
Decline :: MessageType
Ack :: MessageType
Nak :: MessageType
Release :: MessageType
Inform :: MessageType
template :: Addr -> Packet
magic :: [Word8]
parses :: Parse a => Int -> PacketParser [a]
zstring :: Int -> PacketParser String
bounded :: (Enum a1, Integral a2, Bounded a1) => Int -> a2 -> PacketParser a1
unEnum :: (Enum a, Num b) => Int -> a -> b
instance GHC.Show.Show Net.DHCP.Packet
instance GHC.Show.Show Net.DHCP.Options
instance GHC.Classes.Eq Net.DHCP.Options
instance GHC.Show.Show Net.DHCP.Option
instance GHC.Classes.Eq Net.DHCP.Option
instance GHC.Show.Show Net.DHCP.MessageType
instance GHC.Enum.Enum Net.DHCP.MessageType
instance GHC.Enum.Bounded Net.DHCP.MessageType
instance GHC.Classes.Eq Net.DHCP.MessageType
instance GHC.Show.Show Net.DHCP.Flags
instance GHC.Classes.Eq Net.DHCP.Flags
instance GHC.Show.Show Net.DHCP.Operation
instance GHC.Enum.Enum Net.DHCP.Operation
instance GHC.Enum.Bounded Net.DHCP.Operation
instance GHC.Classes.Eq Net.DHCP.Operation
instance Net.PacketParsing.Parse Net.DHCP.Packet
instance Net.PacketParsing.Unparse Net.DHCP.Packet
instance Net.PacketParsing.Parse Net.DHCP.Options
instance Net.PacketParsing.Unparse Net.DHCP.Options
instance Net.PacketParsing.Unparse Net.DHCP.Option
instance Net.PacketParsing.Parse Net.DHCP.Option
instance Net.PacketParsing.Parse Net.DHCP.MessageType
instance Net.PacketParsing.Unparse Net.DHCP.MessageType
instance Net.PacketParsing.Parse Net.DHCP.Flags
instance Net.PacketParsing.Unparse Net.DHCP.Flags
instance Net.PacketParsing.Parse Net.DHCP.Operation
instance Net.PacketParsing.Unparse Net.DHCP.Operation

module Net.ARP
data Packet
Packet :: Operation -> Addr -> Addr -> Addr -> Addr -> Packet
[opcode] :: Packet -> Operation
[senderHA] :: Packet -> Addr
[senderIP] :: Packet -> Addr
[targetHA] :: Packet -> Addr
[targetIP] :: Packet -> Addr
data Operation
Request :: Operation
Reply :: Operation
instance GHC.Show.Show Net.ARP.Packet
instance GHC.Show.Show Net.ARP.Operation
instance GHC.Classes.Eq Net.ARP.Operation
instance Net.PacketParsing.Parse Net.ARP.Packet
instance Net.PacketParsing.Unparse Net.ARP.Packet
instance Net.PacketParsing.Parse Net.ARP.Operation
instance Net.PacketParsing.Unparse Net.ARP.Operation

module Net.DHCP_Client
init :: (ForkIO m, DelayIO m, RefIO r m) => ([Char] -> m ()) -> Interface m Packet InPacket Packet OutPacket -> m (Addr, Maybe Addr, Addr)
solicit :: (RefIO r m, ForkIO m, DelayIO m) => m a -> m b -> m b
solicit' :: (DelayIO m, ForkIO m, RefIO r m) => Int -> m a -> m b -> m b

module Net.ARP_Protocol
data Interface m
Interface :: (Addr -> m (Maybe Addr)) -> m CacheDump -> Interface m
[lookup] :: Interface m -> Addr -> m (Maybe Addr)
[dump] :: Interface m -> m CacheDump
type CacheDump = [(Addr, Maybe Addr)]
initialize :: (MVarIO v2 m1, MVarIO v2 m2, ChannelIO c m2, MVarIO v1 m2, MVarIO v1 m1, DelayIO m1, ForkIO m1, ChannelIO c m1) => ([Char] -> m1 a) -> Interface m1 Packet Packet Packet -> Addr -> m1 Interface m2
instance GHC.Show.Show (Net.ARP_Protocol.Req m)

module Net.Wire
type Wire m a = Interface m a a

-- | An unbounded buffer unbounded :: ChannelIO c m =&gt; m (Wire m a)
unbounded :: (ChannelIO c m2, ChannelIO c m1) => () -> m1 Interface m2 a a
newWire :: (ChannelIO c m1, ChannelIO c m2, MVarIO v m2, MVarIO v m1) => () -> m1 Interface m2 o o
newWire' :: (ChannelIO c m2, ChannelIO c m1, MVarIO v m2, MVarIO v m1, Num a, Ord a, Enum a) => a -> m2 Interface m1 o o
bounded :: (MVarIO v m2, MVarIO v m1) => m2 Interface m1 i o -> m2 Interface m1 i o

-- | A bounded buffer that discards input when full
bounded' :: (Enum a, Ord a, MVarIO v m2, Num a, MVarIO v m1) => a -> m1 Interface m2 i o -> m1 Interface m2 i o
timedWire :: (RefIO r m2, ForkIO m2, DelayIO m2, ChannelIO c m2, Eq r (), ChannelIO c m1) => () -> m1 TimedInterface m2 b b

module Net.UDP_Client
initialize :: (ChannelIO c m, MVarIO v2 m, MVarIO v1 m, DelayIO m, RefIO r m, Eq r (), ForkIO m) => ([Char] -> m ()) -> Addr -> Interface m Packet Packet InPacket Packet Packet OutPacket -> m Interface m
type UDP_API m = TimedInterface m (Addr, Packet InPacket) (Addr, Packet OutPacket)
data Interface m
Interface :: (Port -> m (UDP_API m)) -> m (Port, UDP_API m) -> (Port -> m ()) -> Interface m
[listen] :: Interface m -> Port -> m (UDP_API m)
[listenAny] :: Interface m -> m (Port, UDP_API m)
[unlisten] :: Interface m -> Port -> m ()
data Packet content
Packet :: !Port -> !Word16 -> !Word16 -> !content -> Packet content
[sourcePort, destPort] :: Packet content -> !Port
[len] :: Packet content -> !Word16
[checksum] :: Packet content -> !Word16
[content] :: Packet content -> !content
template :: () => Port -> Port -> content -> Packet content
newtype Port
Port :: Word16 -> Port

module Net.TFTP_Client
tftpGet :: MVarIO v m => p -> Interface m -> Addr -> Filename -> Mode -> m Either [Char] [Data]
tftpPut :: MVarIO v m => p -> Interface m -> Addr -> Filename -> Mode -> String -> m Either [Char] ()

module Net.ClientInterface
data Config
DHCP :: Config
Fixed :: Addr -> Config
[myIP, routerIP, netmask] :: Config -> Addr
fixed :: Addr -> Addr -> Config
data Net m
Net :: (Addr -> Word16 -> Word16 -> m ()) -> m CacheDump -> Interface m -> Interface m -> Net m
[ping] :: Net m -> Addr -> Word16 -> Word16 -> m ()
[dump] :: Net m -> m CacheDump
[udp] :: Net m -> Interface m
[tcp] :: Net m -> Interface m
instance GHC.Show.Show Net.ClientInterface.Config

module Net.Servers
tcpEchoServer :: ForkIO m => ([Char] -> m a) -> Net m -> m b
udpEchoServer :: Monad m => ([Char] -> m a) -> Net m -> m b
simpleTCPServer :: (ForkIO m, Unparse a2, Parse a1) => ([Char] -> m a3) -> Net m -> Port -> (Interface m Maybe a1 a2 -> m a4) -> m b
lineBuffered :: (MVarIO v m2, MVarIO v m1) => p -> Interface m2 Maybe [Char] o -> m1 Interface m2 [Char] o

-- | A simple telnet server for line-based services
telnetServer :: (MVarIO v m, Unparse p, ForkIO m) => ([Char] -> m a1) -> p -> (Interface m [Char] p -> [Char] -> m a2) -> Net m -> m b

-- | A simple telnet client for line-based services
telnet :: (ForkIO m, RefIO r m) => Interface m [Char] [Char] -> Net m -> Peer -> m ()

module Net.IPv4Client
type Client m p = Client' m (p InPacket) (p OutPacket)
type Client_ m p = Client' m p p
type Client' m i o = Interface m (Packet i) (Packet o)
data Clients m
Clients :: Client_ m Packet -> Client m Packet -> Client m Packet -> Clients m
[icmp] :: Clients m -> Client_ m Packet
[udp] :: Clients m -> Client m Packet
[tcp] :: Clients m -> Client m Packet
initialize :: (ForkIO m, ChannelIO c m, MVarIO v m) => ([Char] -> m ()) -> Interface m Packet InPacket Packet OutPacket -> m Clients m

module Net.EthernetClient
type Client_ m p = Interface m p (Packet p)
type Client m p = Interface m (p InPacket) (Packet (p OutPacket))
data Clients m
Clients :: Client m Packet -> Client_ m Packet -> Clients m
[ipv4] :: Clients m -> Client m Packet
[arp] :: Clients m -> Client_ m Packet
initialize :: (ForkIO m, ChannelIO c m, MVarIO v m) => ([Char] -> m ()) -> Interface m Packet InPacket Packet OutPacket -> m Clients m

module Net.Test
initialize :: (ChannelIO c io, Eq r (), ForkIO io, DelayIO io, RefIO r io, MVarIO v io) => ([Char] -> io ()) -> Config -> Interface io Packet InPacket Packet OutPacket -> io ((Addr, Maybe Addr, Addr), Net io)
icmpHandler :: ForkIO io => ([Char] -> io ()) -> Addr -> Interface io Packet Packet Packet Packet -> io ThreadId
sendPing :: () => (Packet Packet -> t) -> Addr -> Addr -> Word16 -> Word16 -> t
