ú΍“„ZĄ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ (c) 2008 by Peter SimonsLGPLsimons@cryp.to provisionalForeignFunctionInterfaceNone C/ Status code for this query.Always Ą for CNAME queries Only set if * was requested for query.Only defined if status is M, h, or i.+The list will be empty if an error occured.Original definition: Z typedef struct { int priority, weight, port; char *host; } adns_rr_srvraw;Original definition: S typedef struct { int len; unsigned char *data; } adns_rr_byteblock;Original definition: S typedef struct { int i; adns_rr_hostaddr ha; } adns_rr_inthostaddr;Original definition: Ż typedef struct { char *host; adns_status astatus; 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  RRHostAddrL because I couldn't see how that information wouldn't be available in the astatus6 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.lThe status codes recognized by ADNS vary in different versions of the library. So instead of providing an ¤, the n type contains the numeric value as returned by ADNS itself. For common status codes, helper functions like M or h are provided. The functions v, u, and tB can also be used to map these codes into human readable strings.The record types we support.(use the searchlist)&use a virtual circuit (TCP connection)*%fill in the owner field in the answer+#allow special chars in query domain,0allow special chars in CNAME we go via (default)-6allow special chars in things supposed to be hostnames.,refuse if quote-req chars in CNAME we go via/,allow refs to CNAMEs - without, get _s_cname0*don't follow CNAMEs, instead give _s_cname2do not look at environment3never print output to stderr (5 overrides)40do not warn to stderr about duff nameservers etc5!enable all output to stderr plus 5 msgs6'include process id in diagnostic output7)do not make syscalls at every opportunity8allow o to return Ľ96application has SIGPIPE set to SIG_IGN, do not protect:5do consistency checks on entry/exit to adns functions;-do consistency checks very frequently (slow!)KWait for the next < to become available.LCancel an open <.]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 Ś to call §#, when marshaling this structure. Ł is not defined.kThis 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, by the way, the function to look at, if you want to add support for additional  records.lyThis function parses a FQDN in uncompressed wire format and advances the pointer to the next byte after the parsed name.mRun the given Š] computation with an initialized resolver. As of now, the diagnose stream is always set to . Initialize the library with 3K if you don't wont to see any error output. All resources are freed when adnsInit returns.n Similar to mH, 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.6Additionally, these non-standard commands may be used:clearnameservers!: Clears the list of nameservers.include filename": The specified file will be read.oGPerform a synchronous query for a record. In case of an I/O error, an 7 is thrown. If the query fails for other reasons, the  code in the   will signify that.p+Submit an asynchronous query. The returned <$ can be tested for completion with q.qJCheck the status of an asynchronous query. If the query is complete, the   will be returned. The < becomes invalid after that.r,Wait for a response to arrive. The returned <6 is invalid and must not be passed to ADNS again. If Ą% is returned, the resolver is empty.s.Return the list of all currently open queries.tMap a : code to a human-readable error description. For example: > *ADNS> adnsStrerror sNXDOMAIN >>= print "No such domain"śUse this function with great care: It will crash the process when called with a status code that ADNS doesn't know about. So use it only to print values you got from the resolver!uMap a z code to a short error name. Don't use this function to print a status code unless you've obtained it from the resolver!vMap 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!wAInternel helper function to handle result passing from ADNS via  Ptr (Ptr a)D, and to generate human-readable IO exceptions in case of an error.xMap a list of flags (¤ types) into a Ş suitable for adns calls.„  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…w & !"#$%'()*+,-./0152346789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwx„?>=<123456789:;…'()*+,-./0„ !"#$%&ƒ‚€MNOPQRSTUVWXYZ[\]^_`abcdefghi~j}|{z  yklmnopqrLKstuvJIHGFEDCBA@wxU   !"#$%&' ()*+,-./01 23456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…(c) 2008 Peter SimonsLGPLsimons@cryp.to provisionalportableNone CŤ4The internal state of the resolver is stored in an ŹK so that it is shared (and synchronized) between any number of concurrent Š threads.­opaque ADNS stateŽcurrently open queries”A ” is an ŠT 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 ”3. Note that resolver functions can be shared, and should! be shared between any number of Št 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 #l records assigned to a host address. Note that although the API allows for a record to have more than one #l entry, this will actually not happen because the GNU adns library can't handle this case and will return ^.™‹Resolve the mail exchangers for a hostname. The returned list may contain more than one entry per hostname, in case the host has several v records. The records are returned in the order you should try to contact them as determined by the priority in the  response.š1Convenience 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 h or i , and everything else signifies M.0So if you aren't interested in getting accurate ? codes in case of failures. Wrap your DNS queries as follows: RqueryA :: Resolver -> HostName -> IO (Maybe [HostAddress]) queryA = query resolveA›CUse this function to disable DNS resolving. It will always return (  P Nothing (Just host) (-1) []).œ2Print an IP host address as a string suitable for # lookups.ąHSubmit a DNS query to the resolver and check whether we have a running ˛. thread already. If we don't, start one with łZ. Make sure you link the threaded RTS so that the main loop will not block other threads.˛/Loop until all open queries have been resolved.Ť´­Ž”•–—˜™š›œą˛ ”•–—˜™š›œ ”•œ–˜™—š› Ť´­Ž”•–—˜™š›œą˛(c) 2008 Peter SimonsLGPLsimons@cryp.to provisionalportableNone CžCFor quering SRV records. Result is the list of tuples (host, port).žŸ 152346789:;”•›žŸ ”•123456789:;Ÿ ž›žŸ ľ       !"#$%&'()*#+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§Ľ¨ŠĽŞŤĽŹ­ĽŽŻĽŞ°ĽŚąĽŞ˛ł´ľĽśˇ¸ĽšşťźĽŚ˝ĽžżŔÁĽÂĂÄĹ hsdns-1.7-A6nlmgBGRML5o1VEWR5aG5ADNS ADNS.Base ADNS.Resolver System.IOstderrSystem.IO.Error IOException&network-2.6.3.1-G4Up1CPKbp7DeFsnywOnGGNetwork.SocketHostNameNetwork.Socket.Types HostAddressResponseRRARRCNAMERRMXRRNSRRPTRRRNSEC RRUNKNOWNRRSRVAnswerstatuscnameownerexpiresrrsRRSrvRaw RRByteblock RRIntHostAddr RRHostAddrRRAddrStatus StatusCodeRRTypeACNAMEMXNSPTRNSECSRV QueryFlagSearchUseVCOwner QuoteOk_Query QuoteOk_CNameQuoteOk_AnsHostQuoteFail_CName CName_Loose CName_ForbidInitFlagNoEnv NoErrPrint NoServerWarnDebugLogPid NoAutoSysEintr NoSigPipe CheckC_EntEx CheckC_FreqQuery 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 adnsErrAbbrevadnsErrTypeAbbrevwrapAdnsmkFlags$fStorableAnswer$fStorableRRSrvRaw$fStorableRRByteblock$fStorableRRIntHostAddr$fStorableRRHostAddr$fStorableRRAddr $fShowRRAddr$fStorableRRType $fEnumRRType $fShowRRType $fEqRRType$fEnumQueryFlag$fEnumInitFlag $fEqInitFlag$fBoundedInitFlag$fShowInitFlag $fEqQueryFlag$fBoundedQueryFlag$fShowQueryFlag $fReadRRType $fEqStatus $fShowStatus $fEqRRAddr$fShowRRHostAddr$fShowRRIntHostAddr$fShowResponse $fShowAnswerResolver initResolverresolveA resolveSRV resolvePTR resolveMXquerydummyDNStoPTRqueryAquerySRVqueryPTRqueryMXbaseGHC.BaseNothingGHC.ShowshowForeign.StorablepokeGHC.EnumEnumForeign.C.ErroreINTRpeekfailStorableghc-prim GHC.TypesIOForeign.C.TypesCInt ResolverStateGHC.MVarMVaradnsqueriesMaybe Data.EitherEitherresolve resolveLoop GHC.Conc.SyncforkIORState