dns-4.2.0: DNS library in Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.DNS.StateBinary

Synopsis

Documentation

data PState Source #

Constructors

PState 

type SPut = State WState Builder Source #

fitSGet :: Int -> SGet a -> SGet a Source #

runSGet :: SGet a -> ByteString -> Either DNSError (a, PState) Source #

runSGetAt :: Int64 -> SGet a -> ByteString -> Either DNSError (a, PState) Source #

runSGetWithLeftoversAt Source #

Arguments

:: Int64

Reference time for DNS clock arithmetic

-> SGet a

Parser

-> ByteString

Encoded message

-> Either DNSError ((a, PState), ByteString) 

sGetMany Source #

Arguments

:: String

element type for error messages

-> Int

input buffer length

-> SGet a

element parser

-> SGet [a] 

Parse a list of elements that takes up exactly a given number of bytes. In order to avoid infinite loops, if an element parser succeeds without moving the buffer offset forward, an error will be returned.

wsPop :: Domain -> State WState (Maybe Int) Source #

wsPush :: Domain -> Int -> State WState () Source #

wsPosition :: WState -> Int Source #

addPositionW :: Int -> State WState () Source #

push :: Int -> Domain -> SGet () Source #

pop :: Int -> SGet (Maybe Domain) Source #

parseLabel :: Word8 -> ByteString -> Either DNSError (ByteString, ByteString) Source #

Decode a domain name in A-label form to a leading label and a tail with the remaining labels, unescaping backlashed chars and decimal triples along the way. Any U-label conversion belongs at the layer above this code.

unparseLabel :: Word8 -> ByteString -> ByteString Source #

Convert a wire-form label to presentation-form by escaping the separator, special and non-printing characters. For simple labels with no bytes that require escaping we get back the input bytestring asis with no copying or re-construction.

Note: the separator is required to be either '.' or '@', but this constraint is the caller's responsibility and is not checked here.