Safe Haskell | None |
---|---|
Language | Haskell2010 |
DCC command parsing and encoding module.
Use the CtcpCommand
type class to convert between CTCPByteString
s
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))
- class CtcpCommand a where
- data DccChat
- = Chat !IPv4 !PortNumber
- | ChatWhiteboard !IPv4 !PortNumber
- data DccClose = Close
- data DccSend
- = Send !Path !IPv4 !PortNumber !(Maybe FileOffset)
- | SendReverseServer !Path !IPv4 !FileOffset !Token
- data DccResume
- = Resume !Path !PortNumber !FileOffset
- | ResumeReverse !Path !FileOffset !Token
- data DccAccept
- = Accept !Path !PortNumber !FileOffset
- | AcceptReverse !Path !FileOffset !Token
- acceptedPosition :: DccAccept -> FileOffset
- data DccSendReverseClient = SendReverseClient !Path !IPv4 !PortNumber !FileOffset !Token
- resumeFromSend :: DccSend -> FileOffset -> DccResume
- matchesSend :: DccAccept -> DccSend -> Bool
- data Path
- fromPath :: Path -> Path Rel File
- data PathType
- data FileOffset
- newtype Token = Token ByteString
DCC command parsing and encoding
class CtcpCommand a where Source #
CTCP commands that can be parsed and encoded
toCtcp :: a -> CTCPByteString Source #
DCC command types
Messaging commands (DCC CHAT)
Offer DCC chat session
Chat !IPv4 !PortNumber | Text messages exchange DCC CHAT chat <ip> <port> |
ChatWhiteboard !IPv4 !PortNumber | Drawing commands exchange DCC CHAT wboard <ip> <port> |
Signal intent to close DCC chat connection
Close | DCC CLOSE |
File Transfer commands (DCC SEND)
Offer DCC file transfer
Send !Path !IPv4 !PortNumber !(Maybe FileOffset) | As part of the standard DCC protocol, sent by the server DCC SEND <path> <ip> <port> (<fileSize>) |
SendReverseServer !Path !IPv4 !FileOffset !Token | As part of the Reverse DCC protocol, sent by the server DCC SEND <path> <ip> 0 <fileSize> <token> |
Signal intent to resume DCC file transfer at specific position
Resume !Path !PortNumber !FileOffset | As part of the standard DCC protocol, sent by the client DCC RESUME <path> <port> <position> |
ResumeReverse !Path !FileOffset !Token | As part of the Reverse DCC protocol, sent by the client DCC RESUME <path> 0 <position> <token> |
Signal acceptance to resume DCC file transfer at specific position
Accept !Path !PortNumber !FileOffset | As part of the standard DCC protocol, sent by the server DCC ACCEPT <path> <port> <position> |
AcceptReverse !Path !FileOffset !Token | As part of the Reverse DCC protocol, sent by the server DCC ACCEPT <path> 0 <position> <token> |
data DccSendReverseClient Source #
Tell the server to start a DCC file transfer and where it should send the data to.
SendReverseClient !Path !IPv4 !PortNumber !FileOffset !Token | As part of the Reverse DCC protocol, sent by the client DCC SEND <path> <ip> <port> <fileSize> <token> |
Constructors from other commands
resumeFromSend :: DccSend -> FileOffset -> DccResume Source #
Try resuming a file offer
Protocol variant checks
Helper Types
data FileOffset Source #