-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A DCC message parsing and helper library for IRC clients -- -- DCC (Direct Client-to-Client) is an IRC sub-protocol for establishing -- and maintaining direct connections to exchange messages and files. -- -- See http://www.irchelp.org/irchelp/rfc/ctcpspec.html for more -- details. @package irc-dcc @version 2.0.0 module Network.IRC.DCC.Internal -- | CTCP commands that can be parsed and encoded class CtcpCommand a toCtcp :: CtcpCommand a => a -> CTCPByteString fromCtcp :: CtcpCommand a => CTCPByteString -> Either String a parseCtcp :: Parser a -> CTCPByteString -> Either String a -- | Offer DCC chat session data DccChat -- | Text messages exchange -- --
-- DCC CHAT chat <ip> <port> --Chat :: !IPv4 -> !PortNumber -> DccChat -- | Drawing commands exchange -- --
-- DCC CHAT wboard <ip> <port> --ChatWhiteboard :: !IPv4 -> !PortNumber -> DccChat -- | Signal intent to close DCC chat connection data DccClose -- |
-- DCC CLOSE --Close :: DccClose -- | Offer DCC file transfer data DccSend -- | As part of the standard DCC protocol, sent by the server -- --
-- DCC SEND <path> <ip> <port> (<fileSize>) --Send :: !Path -> !IPv4 -> !PortNumber -> !(Maybe FileOffset) -> DccSend -- | As part of the Reverse DCC protocol, sent by the server -- --
-- DCC SEND <path> <ip> 0 <fileSize> <token> --SendReverseServer :: !Path -> !IPv4 -> !FileOffset -> !Token -> DccSend -- | Signal intent to resume DCC file transfer at specific position data DccResume -- | As part of the standard DCC protocol, sent by the client -- --
-- DCC RESUME <path> <port> <position> --Resume :: !Path -> !PortNumber -> !FileOffset -> DccResume -- | As part of the Reverse DCC protocol, sent by the client -- --
-- DCC RESUME <path> 0 <position> <token> --ResumeReverse :: !Path -> !FileOffset -> !Token -> DccResume -- | Signal acceptance to resume DCC file transfer at specific position data DccAccept -- | As part of the standard DCC protocol, sent by the server -- --
-- DCC ACCEPT <path> <port> <position> --Accept :: !Path -> !PortNumber -> !FileOffset -> DccAccept -- | As part of the Reverse DCC protocol, sent by the server -- --
-- DCC ACCEPT <path> 0 <position> <token> --AcceptReverse :: !Path -> !FileOffset -> !Token -> DccAccept acceptedPosition :: DccAccept -> FileOffset -- | Tell the server to start a DCC file transfer and where it should send -- the data to. data DccSendReverseClient -- | As part of the Reverse DCC protocol, sent by the client -- --
-- DCC SEND <path> <ip> <port> <fileSize> <token> --SendReverseClient :: !Path -> !IPv4 -> !PortNumber -> !FileOffset -> !Token -> DccSendReverseClient data PathType -- | A file path without spaces Simple :: PathType -- | A file path that can include spaces and will be quoted when serialized Quoted :: PathType data Path Rel :: PathType -> (Path Rel File) -> Path Abs :: PathType -> (Path Abs File) -> Path fromPath :: Path -> Path Rel File path :: Parser Path pathToBS :: Path -> ByteString wrap :: PathType -> ByteString -> ByteString newtype FileOffset FileOffset :: Word64 -> FileOffset [toWord] :: FileOffset -> Word64 fileOffset :: Parser FileOffset fileOffsetToBS :: FileOffset -> ByteString -- | An identifier for knowing which negotiation a request belongs to newtype Token Token :: ByteString -> Token token :: Parser Token tokenToBS :: Token -> ByteString socket :: Parser (IPv4, PortNumber) socketToBS :: (IPv4, PortNumber) -> ByteString ipBigEndian :: Parser IPv4 ipToBigEndianBS :: IPv4 -> ByteString fromBigEndianIp :: Integer -> IPv4 toBigEndianIp :: IPv4 -> Integer tcpPort :: Parser PortNumber tcpPortToBS :: PortNumber -> ByteString decimalInRange :: (Integer, Integer) -> Parser Integer spaced :: Parser a -> Parser a instance GHC.Show.Show Network.IRC.DCC.Internal.DccSend instance GHC.Classes.Eq Network.IRC.DCC.Internal.DccSend instance GHC.Show.Show Network.IRC.DCC.Internal.DccResume instance GHC.Classes.Eq Network.IRC.DCC.Internal.DccResume instance GHC.Show.Show Network.IRC.DCC.Internal.DccAccept instance GHC.Classes.Eq Network.IRC.DCC.Internal.DccAccept instance GHC.Show.Show Network.IRC.DCC.Internal.DccSendReverseClient instance GHC.Classes.Eq Network.IRC.DCC.Internal.DccSendReverseClient instance GHC.Show.Show Network.IRC.DCC.Internal.Token instance GHC.Classes.Eq Network.IRC.DCC.Internal.Token instance GHC.Enum.Bounded Network.IRC.DCC.Internal.FileOffset instance GHC.Real.Real Network.IRC.DCC.Internal.FileOffset instance GHC.Enum.Enum Network.IRC.DCC.Internal.FileOffset instance GHC.Real.Integral Network.IRC.DCC.Internal.FileOffset instance GHC.Num.Num Network.IRC.DCC.Internal.FileOffset instance GHC.Classes.Ord Network.IRC.DCC.Internal.FileOffset instance GHC.Classes.Eq Network.IRC.DCC.Internal.FileOffset instance GHC.Show.Show Network.IRC.DCC.Internal.Path instance GHC.Classes.Eq Network.IRC.DCC.Internal.Path instance GHC.Show.Show Network.IRC.DCC.Internal.PathType instance GHC.Classes.Eq Network.IRC.DCC.Internal.PathType instance GHC.Show.Show Network.IRC.DCC.Internal.DccClose instance GHC.Classes.Eq Network.IRC.DCC.Internal.DccClose instance GHC.Show.Show Network.IRC.DCC.Internal.DccChat instance GHC.Classes.Eq Network.IRC.DCC.Internal.DccChat instance Network.IRC.DCC.Internal.CtcpCommand Network.IRC.DCC.Internal.DccChat instance Network.IRC.DCC.Internal.CtcpCommand Network.IRC.DCC.Internal.DccClose instance Network.IRC.DCC.Internal.CtcpCommand Network.IRC.DCC.Internal.DccSend instance Network.IRC.DCC.Internal.CtcpCommand Network.IRC.DCC.Internal.DccResume instance Network.IRC.DCC.Internal.CtcpCommand Network.IRC.DCC.Internal.DccAccept instance Network.IRC.DCC.Internal.CtcpCommand Network.IRC.DCC.Internal.DccSendReverseClient instance GHC.Show.Show Network.IRC.DCC.Internal.FileOffset -- | DCC command parsing and encoding module. -- -- Use the CtcpCommand type class to convert between -- CTCPByteStrings and typed values. -- -- Try converting a CTCPByteString to a DccSend value: -- --
-- fromCtcp ctcpMessage :: Either String DccSend ---- -- Encoding a DccSend value to a CTCPByteString: -- --
-- toCtcp (Send fileName ip port (Just fileSize)) --module Network.IRC.DCC -- | CTCP commands that can be parsed and encoded class CtcpCommand a toCtcp :: CtcpCommand a => a -> CTCPByteString fromCtcp :: CtcpCommand a => CTCPByteString -> Either String a -- | Offer DCC chat session data DccChat -- | Text messages exchange -- --
-- DCC CHAT chat <ip> <port> --Chat :: !IPv4 -> !PortNumber -> DccChat -- | Drawing commands exchange -- --
-- DCC CHAT wboard <ip> <port> --ChatWhiteboard :: !IPv4 -> !PortNumber -> DccChat -- | Signal intent to close DCC chat connection data DccClose -- |
-- DCC CLOSE --Close :: DccClose -- | Offer DCC file transfer data DccSend -- | As part of the standard DCC protocol, sent by the server -- --
-- DCC SEND <path> <ip> <port> (<fileSize>) --Send :: !Path -> !IPv4 -> !PortNumber -> !(Maybe FileOffset) -> DccSend -- | As part of the Reverse DCC protocol, sent by the server -- --
-- DCC SEND <path> <ip> 0 <fileSize> <token> --SendReverseServer :: !Path -> !IPv4 -> !FileOffset -> !Token -> DccSend -- | Signal intent to resume DCC file transfer at specific position data DccResume -- | As part of the standard DCC protocol, sent by the client -- --
-- DCC RESUME <path> <port> <position> --Resume :: !Path -> !PortNumber -> !FileOffset -> DccResume -- | As part of the Reverse DCC protocol, sent by the client -- --
-- DCC RESUME <path> 0 <position> <token> --ResumeReverse :: !Path -> !FileOffset -> !Token -> DccResume -- | Signal acceptance to resume DCC file transfer at specific position data DccAccept -- | As part of the standard DCC protocol, sent by the server -- --
-- DCC ACCEPT <path> <port> <position> --Accept :: !Path -> !PortNumber -> !FileOffset -> DccAccept -- | As part of the Reverse DCC protocol, sent by the server -- --
-- DCC ACCEPT <path> 0 <position> <token> --AcceptReverse :: !Path -> !FileOffset -> !Token -> DccAccept acceptedPosition :: DccAccept -> FileOffset -- | Tell the server to start a DCC file transfer and where it should send -- the data to. data DccSendReverseClient -- | As part of the Reverse DCC protocol, sent by the client -- --
-- DCC SEND <path> <ip> <port> <fileSize> <token> --SendReverseClient :: !Path -> !IPv4 -> !PortNumber -> !FileOffset -> !Token -> DccSendReverseClient -- | Try resuming a file offer resumeFromSend :: DccSend -> FileOffset -> DccResume -- | Check if a DccSend and a DccAccept command are part of -- the same negotiation. matchesSend :: DccAccept -> DccSend -> Bool data Path Rel :: PathType -> (Path Rel File) -> Path Abs :: PathType -> (Path Abs File) -> Path fromPath :: Path -> Path Rel File data PathType -- | A file path without spaces Simple :: PathType -- | A file path that can include spaces and will be quoted when serialized Quoted :: PathType data FileOffset -- | An identifier for knowing which negotiation a request belongs to newtype Token Token :: ByteString -> Token -- | Functions for receiving files. -- -- Each chunk is acknowledged by sending the total sum of bytes received -- for a file. See the CTCP specification. module Network.IRC.DCC.Client.FileTransfer -- | Accept a DCC file offer acceptFile :: DccSend -> (PortNumber -> IO ()) -> (FileOffset -> IO ()) -> ReaderT (Maybe PortNumber) IO () -- | Accept a DCC file offer for a partially downloaded file resumeFile :: DccSend -> DccAccept -> (PortNumber -> IO ()) -> (FileOffset -> IO ()) -> ReaderT (Maybe PortNumber) IO () -- | A description of a file transfer. You can specify a callback that will -- be called with the number of bytes transfered for each chunk. data FileTransfer m Download :: !(Path Rel File) -> !(ConnectionType m) -> !TransferType -> (FileOffset -> m ()) -> FileTransfer m [_fileName] :: FileTransfer m -> !(Path Rel File) [_connectionType] :: FileTransfer m -> !(ConnectionType m) [_transferType] :: FileTransfer m -> !TransferType [_onChunk] :: FileTransfer m -> FileOffset -> m () data ConnectionType m -- | Connects to other party on specified port. With callback when socket -- is ready. Active :: !IPv4 -> !PortNumber -> (m ()) -> ConnectionType m -- | Binds to local port and waits for connection by other party. If no -- port number is provided, one will be provided by the OS. With callback -- when socket is ready. Passive :: !IPv4 -> !(Maybe PortNumber) -> (PortNumber -> m ()) -> ConnectionType m data TransferType FromStart :: TransferType ResumeFrom :: !FileOffset -> TransferType transfer :: (MonadMask m, MonadIO m) => FileTransfer m -> m ()