3L      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~portable provisionalsimons@cryp.toSignify 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.tos Wait for the next L to become available. Cancel an open L.  Status code for this query. !Always  for CNAME queries " Only set if > was requested for query. #Only defined if status is P, k, or l. $,The list will be empty if an error occured. %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 P or k are provided. The  functions y, x, and  w* can also be used to map these codes into  human readable strings. ./The record types we support. 012345678don''t follow CNAMEs, instead give _s_cname 9-allow refs to CNAMEs - without, get _s_cname :-refuse if quote-req chars in CNAME we go via ;7allow special chars in things supposed to be hostnames <1allow special chars in CNAME we go via (default) =$allow special chars in query domain >&fill in the owner field in the answer ?'use a virtual circuit (TCP connection) @use the searchlist AB.do consistency checks very frequently (slow!) Cdo consistency checks on entry/exit to adns functions D7application has SIGPIPE set to SIG_IGN, do not protect Eallow r to return  F*do not make syscalls at every opportunity G(include process id in diagnostic output H!enable all output to stderr plus H msgs I1do not warn to stderr about duff nameservers etc Jnever print output to stderr (H overrides) Kdo not look at environment LMNOPQRSTUVWXYZ[\]^_`aOriginal 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. bcdefghijklmnThis 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 0/ records. oEThis function parses a FQDN in uncompressed wire format and advances 5 the pointer to the next byte after the parsed name. pRun the given ! computation with an initialized ; resolver. As of now, the diagnose stream is always set to  System.IO.stderr. Initialize the library with J if you  don'2t wont to see any error output. All resources are  freed when adnsInit returns. q Similar to p, 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. r8Perform 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 - code  in the  will signify that. s+Submit an asynchronous query. The returned L can  be tested for completion with t. t8Check the status of an asynchronous query. If the query  is complete, the  will be returned. The L  becomes invalid after that. u,Wait for a response to arrive. The returned L is 2 invalid and must not be passed to ADNS again. If  is " returned, the resolver is empty. v/Return the list of all currently open queries. wMap 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! xMap 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! yMap 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! z7Internel 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. s  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{sONMLAKJIHGFEDCB7@?>=<;:98/6543210-.PQRSTUVWXYZ[\]^_`abcdef+,ghijklm)*'(%& !"#$nopqrstuvwxy z{s  !"#$ !"#$%&&'(()**+,,-../654321001234567 @?>=<;:9889:;<=>?@A KJIHGFEDCBBCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{portable provisionalsimons@cryp.to3The 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 6 records. Get the 2* records assigned to a host address. Note 8 that although the API allows for a record to have more  than one 2& entry, this will actually not happen ! because the GNU adns library can't handle this case and  will return a. 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 6 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 k or  l , and everything else signifies P. 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 ( S Nothing (Just  host) (-1) []). 2Print an IP host address as a string suitable for 2 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.toABCDEFGHIJK|}|}AKJIHGFEDCB      !"#$%&&'()*+,,--..//01223456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ hsdns-1.4ADNS ADNS.Endian ADNS.Base ADNS.Resolvernetwork-2.2.1.7Network.SocketHostNameNetwork.Socket.Internal HostAddressEndian PDPEndian BigEndian LittleEndianendian readWord32 readWord16adns_errtypeabbrevadns_errabbrev adns_strerroradns_forallqueries_nextadns_forallqueries_beginadns_synchronous adns_check adns_submit adns_finishadns_init_strcfg adns_init adns_wait adnsCancelResponse RRUNKNOWNRRNSECRRPTRRRNSRRMXRRCNAMERRAAnswerstatuscnameownerexpiresrrs RRByteblock RRIntHostAddr RRHostAddrRRAddrStatus StatusCodeRRTypeNSECPTRNSMXCNAMEA QueryFlag CName_Forbid CName_LooseQuoteFail_CNameQuoteOk_AnsHost QuoteOk_CName QuoteOk_QueryOwnerUseVCSearchInitFlag CheckC_Freq CheckC_EntEx NoSigPipeEintr NoAutoSysLogPidDebug NoServerWarn NoErrPrintNoEnvQuery OpaqueQuery AdnsState OpaqueStatesOK 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 resolvePTR resolveMXquerydummyDNStoPTRqueryAqueryPTRqueryMXbase Data.MaybeNothingGHC.ShowshowForeign.StorablepokeGHC.EnumEnumForeign.C.ErroreINTRpeekGHC.BasefailStorableghc-prim GHC.TypesIOForeign.C.TypesCInt ResolverStateGHC.MVarMVarRStateadnsqueriesMaybe Data.EitherEitherresolve resolveLoopGHC.ConcforkIO