tftp-0.2: A library for building tftp servers

Safe HaskellNone

Network.TFTP.Message

Description

Encapsulates parsing and generation of TFTP Messages

Synopsis

Documentation

data Message Source

TFTP message type.

Constructors

RRQ String Mode

Read request

WRQ String Mode

Write request

DATA BlockNumber ByteString

Data block with a raw bytestring

ACK BlockNumber

Acknowledge message

Error TFTPError

Error message

data Mode Source

The data mode to encode the data with

Constructors

NetASCII

netascii mode

Octet

octet mode

data TFTPError Source

The error codes as defined in the RFC 1350

Constructors

ErrorMessage String

Encapsulates a custom message for a non-standard error

FileNotFound 
AccessViolation 
DiskFull 
IllegalTFTPOperation 
UnknownTransferID 
FileAlreadyExists 
NoSuchUser 

decode :: Binary a => ByteString -> a

Decode a value from a lazy ByteString, reconstructing the original structure.

encode :: Binary a => a -> ByteString

Encode a value using binary serialisation to a lazy ByteString.

convertMode :: Mode -> Mode -> ByteString -> ByteStringSource

Convert a ByteString encoded in fromMode to a ByteString encoded in toMode.