śĪ{©sąh      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgportable provisionalsimons@cryp.to>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. Signify the system'!s native byte order according to = significance of bytes from low addresses to high addresses. ForeignFunctionInterface provisionalsimons@cryp.toWait for the next Y to become available. Cancel an open Y. %Original definition:   typedef struct {  int len;  union {  struct sockaddr sa; ! struct sockaddr_in inet;  } addr;  } adns_rr_addr; Note: Anything but  sockaddr_in will cause h to call i, ! when marshaling this structure. j is not defined. 2This function parses the @ union found in  A. It cannot be defined via k 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 L records. 3EThis function parses a FQDN in uncompressed wire format and advances 5 the pointer to the next byte after the parsed name. 4Run the given l! computation with an initialized ; resolver. As of now, the diagnose stream is always set to  System.IO.stderr. Initialize the library with W if you  don'2t wont to see any error output. All resources are  freed when adnsInit returns. 5 Similar to 4, 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. 68Perform a synchronous query for a record. In case of an  I/ O error, an System.IO.Error.IOException is thrown. + If the query fails for other reasons, the K code  in the A will signify that. 7+Submit an asynchronous query. The returned Y can  be tested for completion with 8. 88Check the status of an asynchronous query. If the query  is complete, the A will be returned. The Y  becomes invalid after that. 9,Wait for a response to arrive. The returned Y is 2 invalid and must not be passed to ADNS again. If m  is " returned, the resolver is empty. :/Return the list of all currently open queries. ;Map a K 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 K 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 K) 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 (n  types) into a o   suitable for adns calls. BStatus code for this query. CAlways m  for CNAME queries D Only set if p was requested for query. EOnly defined if status is , /, or 0. F,The list will be empty if an error occured. GOriginal definition:  typedef struct {  int len;  unsigned char *data;  } adns_rr_byteblock; HOriginal definition:  typedef struct {  int i;  adns_rr_hostaddr ha;  } adns_rr_inthostaddr; IOriginal 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  q  rather than J. I'm using the former ' only because it has nicer output with r. j is  not defined. K6The status codes recognized by ADNS vary in different 5 versions of the library. So instead of providing an  n , the K$ type contains the numeric value as : returned by ADNS itself. For common status codes, helper  functions like  or / are provided. The  functions =, <, and  ;* can also be used to map these codes into  human readable strings. LThe record types we support. s  !"#$%&'()*+,-./0123456789:;<=>?@stuvwxyAzBCDEFG{H|I}J~KL€‚ƒ„…†M‡ˆ‰Š‹ŒpŽNOPQRSTUVWXYZ[\L  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNYZ[\portable provisionalsimons@cryp.to ]Run the given l! computation with an Initialized  d.. Note that resolver functions can be shared,  and should! be shared between any number of l 9 threads. You may use multiple resolvers, of course, but ; doing so defeats the purpose of an asynchronous resolver. ^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 %. `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 w response. a0Convenience 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 / or  0 , and everything else signifies . So if you aren'!t interested in getting accurate K 5 codes in case of failures. Wrap your DNS queries as  follows: < queryA :: Resolver -> HostName -> IO (Maybe [HostAddress])  queryA = query resolveA b4Use this function to disable DNS resolving. It will  always return (A  Nothing (Just  host) (-1) []). c2Print 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. ”3The internal state of the resolver is stored in an  •1 so that it is shared (and synchronized) between  any number of concurrent l threads. –opaque ADNS state —currently open queries dA d is an l% computation which -- given the name / and type of the record to query -- returns an • that will  eventually contain the A from the Domain Name System. ]^_`abcdd]c^_`abportable provisionalsimons@cryp.to˜qNOPQRSTUVWX]bdefgd]NOPQRSTUVWXefgb™ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|} ~  € ‚ƒ„…†‡ˆ‰ŠRXYZ[‹]ŒŽ‘’“”•–—˜™ š›œžŸ ”¢ £¤ hsdns-1.3 ADNS.Endian ADNS.BaseADNS ADNS.ResolverbaseForeign.StorableGHC.Base GHC.IOBase Data.MaybeGHC.EnumForeign.C.Typesnetwork-2.2.0.0Network.SocketGHC.Show Data.EitherGHC.Concendian readWord32 readWord16Endian PDPEndian BigEndian LittleEndianadns_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 adnsErrAbbrevadnsErrTypeAbbrevwrapAdnsmkFlagsResponseAnswerstatuscnameownerexpiresrrs RRByteblock RRIntHostAddr RRHostAddrRRAddrStatusRRType QueryFlagInitFlag CheckC_Freq CheckC_EntEx NoSigPipeEintr NoAutoSysLogPidDebug NoServerWarn NoErrPrintNoEnvQuery OpaqueQuery AdnsState OpaqueState initResolverresolveA resolvePTR resolveMXquerydummyDNStoPTRResolverqueryAqueryPTRqueryMXpeekfailpokeStorableIONothingEnumCIntOwner HostAddressshow RRUNKNOWNRRNSECRRPTRRRNSRRMXRRCNAMERRA StatusCodeNSECPTRNSMXCNAMEA CName_Forbid CName_LooseQuoteFail_CNameQuoteOk_AnsHost QuoteOk_CName QuoteOk_QueryUseVCSearchMaybeEitherresolve resolveLoopforkIO ResolverStateMVaradnsqueriesHostName