Blame | Last modification | View Log | RSS feed
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>liboop: oop_adns_submit(), oop_adns_cancel()</title><link rel="stylesheet" type="text/css" href="style.css"></head><body><h2>oop_adns_submit(), oop_adns_cancel()</h2><pre>#include <oop.h>#include <adns.h>#include <oop-adns.h>/* <em>Callback function prototype.</em> */typedef void *oop_adns_call(oop_adapter_adns *adapter,adns_answer *answer,void *data);/* <em>Submit an asynchronous DNS query.</em> */oop_adns_query *oop_adns_submit(oop_adapter_adns *adapter,const char *owner,adns_rrtype type,adns_queryflags flags,oop_adns_call *call,void *user);/* <em>Cancel a running query.</em> */void oop_adns_cancel(oop_adns_query *query);</pre><h3>Arguments.</h3><dl><dt><b>oop_adapter_adns *adns</b><dd>The <a href="oop_adns">adns adapter</a> to use for the query.<p><dt><b>adns_answer *answer</b><dd>The answer to the query (status and RR data). Refer to the adnsdocumentation for details.<p><dt><b>const char *owner</b><dd>The DNS domain name to query.<p><dt><b>adns_rrtype type</b><dd>The DNS Resource Record type to query. Refer to the adns documentation forthe list of valid RR types.<p><dt><b>adns_queryflags flags</b><dd>Flags for the DNS query. Refer to the adns documentation for details.<p><dt><b>oop_call_fd *call</b><dd>The callback function (event sink) to use for reporting query succcess orfailure.<p><dt><b>void *user</b><dd>User data passed through to the callback function.<p><dt><b>oop_adns_query *query</b><dd>The query to cancel.</dl><h3>Description.</h3><dl><dt><b>oop_adns_submit</b><dd>This function begins a DNS query using an adns adapter. Most of theparameters are passed directly to adns. The query will be processedasynchronously using the event source specified when the adapter was created;when it completes (successfully or not), the specified callback will beinvoked.<p>On malloc failure or catastrophic system error, NULL will be returned.(Simple name resolution errors, such as not finding the name, do not resultin a NULL query; instead, the callback is invoked with an error status.)<p>The returned pointer is valid (and may be used to cancel the query) untileither the query is cancelled or the callback is invoked (the querycompletes).<p><dt><b>oop_adns_cancel</b><dd>Stop processing a query started with oop_adns_submit (above). This mustbe called with a non-NULL pointer returned from oop_adns_submit before thequery has completed (and the callback function invoked). Any query may onlybe cancelled once. All resources associated with the query will bereleased.<p><dt><b>oop_adns_call</b><dd>Called when the query completes, successfully or not. Performs auser-specific action with the results of the query. All resources associatedwith the query will be released before the function is called, except for theanswer structure itself. (The user is responsible for freeing the answerstructure, as per the conventions established by adns. Note that adns doesnot use oop_alloc!)Should return OOP_CONTINUE if the event loop should continue operating;any other value (including OOP_HALT) will cause termination of the event loop.</dl><hr><a href="ref">liboop reference</a></body></html>