!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~portable provisionalsimons@cryp.toNoneSignify the system'!s native byte order according to = significance of bytes from low addresses to high addresses.  byte order: 3412  byte order: 4321  byte order: 1234 4The endian of this machine, determined at run-time. >Parse a host-ordered 32-bit word into a network-ordered tuple  of 8-bit words. AParse a host-ordered 16-bit word into a network-ordered tuple of  8-bit words. ForeignFunctionInterface provisionalsimons@cryp.toNone/Status code for this query. Always  for CNAME queries  Only set if 5 was requested for query. Only defined if status is T, o, or p. ,The list will be empty if an error occured. Original definition:  typedef struct { " int priority, weight, port;  char *host;  } adns_rr_srvraw; Original definition:  typedef struct {  int len;  unsigned char *data;  } adns_rr_byteblock; Original definition:  typedef struct {  int i;  adns_rr_hostaddr ha;  } adns_rr_inthostaddr; Original definition:   typedef struct {  char *host;  adns_status astatus; A int naddrs; /* temp fail => -1, perm fail => 0, s_ok => >0  adns_rr_addr *addrs;  } adns_rr_hostaddr; The naddrs field is not available in  RRHostAddr  because I couldn'!t see how that information wouldn't be  available in the astatus field too. If I missed  anything, please let me know. Note(: The data type should probably contain   rather than !. I'm using the former ' only because it has nicer output with .  is  not defined. #6The status codes recognized by ADNS vary in different 5 versions of the library. So instead of providing an  , the #$ type contains the numeric value as : returned by ADNS itself. For common status codes, helper  functions like T or o are provided. The  functions }, |, and  {* can also be used to map these codes into  human readable strings. %The record types we support. /don''t follow CNAMEs, instead give _s_cname 0-allow refs to CNAMEs - without, get _s_cname 1-refuse if quote-req chars in CNAME we go via 27allow special chars in things supposed to be hostnames 31allow special chars in CNAME we go via (default) 4$allow special chars in query domain 5&fill in the owner field in the answer 6'use a virtual circuit (TCP connection) 7use the searchlist 9.do consistency checks very frequently (slow!) :do consistency checks on entry/exit to adns functions ;7application has SIGPIPE set to SIG_IGN, do not protect <allow v to return  =*do not make syscalls at every opportunity >(include process id in diagnostic output ?!enable all output to stderr plus ? msgs @1do not warn to stderr about duff nameservers etc Anever print output to stderr (? overrides) Bdo not look at environment RWait for the next C to become available. SCancel an open C. dOriginal definition:   typedef struct {  int len;  union {  struct sockaddr sa; ! struct sockaddr_in inet;  } addr;  } adns_rr_addr; Note: Anything but  sockaddr_in will cause  to call , ! when marshaling this structure.  is not defined. rThis function parses the   union found in  . It cannot be defined via  because it : needs to know the type of the record to expect. This is, 9 by the way, the function to look at, if you want to add  support for additional % records. sEThis function parses a FQDN in uncompressed wire format and advances 5 the pointer to the next byte after the parsed name. tRun the given ! computation with an initialized ; resolver. As of now, the diagnose stream is always set to  . Initialize the library with A if you  don'2t wont to see any error output. All resources are  freed when adnsInit returns. u Similar to t, but reads the resolver . configuration from a string rather than from  /etc/ resolv.conf$. Supported are the usual commands:   nameserver, search, domain, sortlist, and  options. 7Additionally, these non-standard commands may be used:  clearnameservers": Clears the list of nameservers.  include filename#: The specified file will be read. v8Perform a synchronous query for a record. In case of an  I/ O error, an  is thrown. + If the query fails for other reasons, the # code  in the  will signify that. w+Submit an asynchronous query. The returned C can  be tested for completion with x. x8Check the status of an asynchronous query. If the query  is complete, the  will be returned. The C  becomes invalid after that. y,Wait for a response to arrive. The returned C is 2 invalid and must not be passed to ADNS again. If  is " returned, the resolver is empty. z/Return the list of all currently open queries. {Map a # code to a human-readable error  description. For example:  , *ADNS> adnsStrerror sNXDOMAIN >>= print  "No such domain" 5Use this function with great care: It will crash the 7 process when called with a status code that ADNS doesn't 9 know about. So use it only to print values you got from  the resolver! |Map a # code to a short error name. Don't use 0 this function to print a status code unless you've  obtained it from the resolver! }Map a #) code to a short description of the type  of error. Don'+t use this function to print a status code  unless you'"ve obtained it from the resolver! ~7Internel helper function to handle result passing from  ADNS via  Ptr (Ptr a)$, and to generate human-readable IO ! exceptions in case of an error. Map a list of flags ( types) into a   suitable for adns calls.  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~w  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~wFEDC8BA@?>=<;:9.76543210/%-,+*)('&#$TUVWXYZ[\]^_`abcdefghij!"klmnopq   rstuvwxySRz{|}QPONMLKJIHG~U   !"#$%-,+*)('&. 76543210/8 BA@?>=<;:9CDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~portable provisionalsimons@cryp.toNone3The internal state of the resolver is stored in an  1 so that it is shared (and synchronized) between  any number of concurrent  threads. opaque ADNS state currently open queries A  is an % computation which -- given the name / and type of the record to query -- returns an  that will  eventually contain the  from the Domain Name System. Run the given ! computation with an Initialized  .. Note that resolver functions can be shared,  and should! be shared between any number of  9 threads. You may use multiple resolvers, of course, but ; doing so defeats the purpose of an asynchronous resolver. Resolve a hostname's - records. Resolve a hostname's ' records. Get the )* records assigned to a host address. Note 8 that although the API allows for a record to have more  than one )& entry, this will actually not happen ! because the GNU adns library can't handle this case and  will return e. 9Resolve the mail exchangers for a hostname. The returned 7 list may contain more than one entry per hostname, in  case the host has several - records. The records are 9 returned in the order you should try to contact them as # determined by the priority in the  response. 0Convenience wrapper that will modify any of the   revolveXXX functions above to return  rather  than . The idea is that Nothing signifies any  sort of failure: Just [] signifies o or  p , and everything else signifies T. So if you aren'!t interested in getting accurate # 5 codes in case of failures. Wrap your DNS queries as  follows: < queryA :: Resolver -> HostName -> IO (Maybe [HostAddress])  queryA = query resolveA 4Use this function to disable DNS resolving. It will  always return ( W Nothing (Just  host) (-1) []). 2Print an IP host address as a string suitable for ) lookups. 8Submit a DNS query to the resolver and check whether we  have a running  thread already. If we don't,  start one with ". Make sure you link the threaded 9 RTS so that the main loop will not block other threads. 0Loop until all open queries have been resolved.  portable provisionalsimons@cryp.toNoneDFor quering SRV records. Result is the list of tuples (host, port). 89:;<=>?@AB8BA@?>=<;:9    !"#$$%%&&''(()*++,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ hsdns-1.6ADNS ADNS.Endian ADNS.Base ADNS.Resolver System.IOstderrSystem.IO.Error IOExceptionnetwork-2.4.1.0Network.SocketHostNameNetwork.Socket.Types HostAddressEndian PDPEndian BigEndian LittleEndianendian readWord32 readWord16ResponseRRSRV RRUNKNOWNRRNSECRRPTRRRNSRRMXRRCNAMERRAAnswerstatuscnameownerexpiresrrsRRSrvRaw RRByteblock RRIntHostAddr RRHostAddrRRAddrStatus StatusCodeRRTypeSRVNSECPTRNSMXCNAMEA QueryFlag CName_Forbid CName_LooseQuoteFail_CNameQuoteOk_AnsHost QuoteOk_CName QuoteOk_QueryOwnerUseVCSearchInitFlag CheckC_Freq CheckC_EntEx NoSigPipeEintr NoAutoSysLogPidDebug NoServerWarn NoErrPrintNoEnvQuery OpaqueQuery AdnsState OpaqueStateadns_errtypeabbrevadns_errabbrev adns_strerroradns_forallqueries_nextadns_forallqueries_beginadns_synchronous adns_check adns_submit adns_finishadns_init_strcfg adns_init adns_wait adnsCancelsOK sNOMEMORYsUNKNOWNRRTYPE sSYSTEMFAILsMAX_LOCALFAILsTIMEOUT sALLSERVFAIL sNORECURSEsINVALIDRESPONSEsUNKNOWNFORMATsMAX_REMOTEFAILsRCODESERVFAILsRCODEFORMATERRORsRCODENOTIMPLEMENTED sRCODEREFUSED sRCODEUNKNOWN sMAX_TEMPFAIL sINCONSISTENTsPROHIBITEDCNAMEsANSWERDOMAININVALIDsANSWERDOMAINTOOLONG sINVALIDDATAsMAX_MISCONFIGsQUERYDOMAINWRONGsQUERYDOMAININVALIDsQUERYDOMAINTOOLONG sMAX_MISQUERY sNXDOMAINsNODATA sMAX_PERMFAILpeekResppeekFQDNAndAdvanceadnsInit adnsInitCfg adnsSynch adnsSubmit adnsCheckadnsWait adnsQueries adnsStrerror adnsErrAbbrevadnsErrTypeAbbrevwrapAdnsmkFlagsResolver initResolverresolveA resolveSRV resolvePTR resolveMXquerydummyDNStoPTRqueryAquerySRVqueryPTRqueryMXbase Data.MaybeNothingGHC.ShowshowForeign.StorablepokeGHC.EnumEnumForeign.C.ErroreINTRpeekGHC.BasefailStorableghc-prim GHC.TypesIOForeign.C.TypesCInt$fStorableAnswer$fStorableRRSrvRaw$fStorableRRByteblock$fStorableRRIntHostAddr$fStorableRRHostAddr$fStorableRRAddr $fShowRRAddr$fStorableRRType $fEnumRRType $fShowRRType $fEqRRType$fEnumQueryFlag$fEnumInitFlag ResolverStateGHC.MVarMVaradnsqueriesMaybe Data.EitherEitherresolve resolveLoop GHC.Conc.SyncforkIORState