<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>ldns documentation</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <div class="logo"> <img src="LogoInGradientBar2-y100.png"/> </div> <!-- Generated by Doxygen 1.7.4 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_7a7a565456b510ac01baf8655647d8a2.html">ldns</a> </li> </ul> </div> </div> <div class="header"> <div class="headertitle"> <div class="title">net.h</div> </div> </div> <div class="contents"> <a href="net_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> * net.h</span> <a name="l00003"></a>00003 <span class="comment"> *</span> <a name="l00004"></a>00004 <span class="comment"> * DNS Resolver definitions</span> <a name="l00005"></a>00005 <span class="comment"> *</span> <a name="l00006"></a>00006 <span class="comment"> * a Net::DNS like library for C</span> <a name="l00007"></a>00007 <span class="comment"> *</span> <a name="l00008"></a>00008 <span class="comment"> * (c) NLnet Labs, 2005-2006</span> <a name="l00009"></a>00009 <span class="comment"> *</span> <a name="l00010"></a>00010 <span class="comment"> * See the file LICENSE for the license</span> <a name="l00011"></a>00011 <span class="comment"> */</span> <a name="l00012"></a>00012 <a name="l00013"></a>00013 <span class="preprocessor">#ifndef LDNS_NET_H</span> <a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define LDNS_NET_H</span> <a name="l00015"></a>00015 <span class="preprocessor"></span> <a name="l00016"></a>00016 <span class="preprocessor">#include <<a class="code" href="ldns_8h.html" title="Including this file will include all ldns files, and define some lookup tables.">ldns/ldns.h</a>></span> <a name="l00017"></a>00017 <span class="preprocessor">#include <sys/socket.h></span> <a name="l00018"></a>00018 <a name="l00019"></a>00019 <span class="preprocessor">#ifdef __cplusplus</span> <a name="l00020"></a>00020 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> { <a name="l00021"></a>00021 <span class="preprocessor">#endif</span> <a name="l00022"></a>00022 <span class="preprocessor"></span> <a name="l00023"></a><a class="code" href="net_8h.html#a22e08a915ebd4b0e6ce971cb67367c28">00023</a> <span class="preprocessor">#define LDNS_DEFAULT_TIMEOUT_SEC 5</span> <a name="l00024"></a><a class="code" href="net_8h.html#a988fa4d3029ca208472bc789000709fd">00024</a> <span class="preprocessor"></span><span class="preprocessor">#define LDNS_DEFAULT_TIMEOUT_USEC 0</span> <a name="l00025"></a>00025 <span class="preprocessor"></span> <a name="l00042"></a>00042 <a class="code" href="error_8h.html#aaa6d98f86f535cf87b83b89e91f488f9">ldns_status</a> <a class="code" href="net_8c.html#abd60865d343250317ff4edf7c8b775d0" title="Sends a buffer to an ip using udp and return the respons as a ldns_pkt.">ldns_udp_send</a>(uint8_t **result, <a class="code" href="structldns__struct__buffer.html" title="implementation of buffers to ease operations">ldns_buffer</a> *qbin, <span class="keyword">const</span> <span class="keyword">struct</span> sockaddr_storage *to, socklen_t tolen, <span class="keyword">struct</span> timeval timeout, <span class="keywordtype">size_t</span> *answersize); <a name="l00043"></a>00043 <a name="l00054"></a>00054 <span class="keywordtype">int</span> <a class="code" href="net_8c.html#a84751182c6fa8f75ff79da83c18c0954" title="Send an udp query and don't wait for an answer but return the socket.">ldns_udp_bgsend</a>(<a class="code" href="structldns__struct__buffer.html" title="implementation of buffers to ease operations">ldns_buffer</a> *qbin, <span class="keyword">const</span> <span class="keyword">struct</span> sockaddr_storage *to, socklen_t tolen, <span class="keyword">struct</span> timeval timeout); <a name="l00055"></a>00055 <a name="l00065"></a>00065 <span class="keywordtype">int</span> <a class="code" href="net_8c.html#a8c4de333a55065818703c26c4464ba70" title="Send an tcp query and don't wait for an answer but return the socket.">ldns_tcp_bgsend</a>(<a class="code" href="structldns__struct__buffer.html" title="implementation of buffers to ease operations">ldns_buffer</a> *qbin, <span class="keyword">const</span> <span class="keyword">struct</span> sockaddr_storage *to, socklen_t tolen, <span class="keyword">struct</span> timeval timeout); <a name="l00066"></a>00066 <a name="l00078"></a>00078 <a class="code" href="error_8h.html#aaa6d98f86f535cf87b83b89e91f488f9">ldns_status</a> <a class="code" href="net_8c.html#add29437506d01b49c5d2d84cd0589999" title="Sends a buffer to an ip using tcp and return the respons as a ldns_pkt.">ldns_tcp_send</a>(uint8_t **result, <a class="code" href="structldns__struct__buffer.html" title="implementation of buffers to ease operations">ldns_buffer</a> *qbin, <span class="keyword">const</span> <span class="keyword">struct</span> sockaddr_storage *to, socklen_t tolen, <span class="keyword">struct</span> timeval timeout, <span class="keywordtype">size_t</span> *answersize); <a name="l00079"></a>00079 <a name="l00089"></a>00089 <a class="code" href="error_8h.html#aaa6d98f86f535cf87b83b89e91f488f9">ldns_status</a> <a class="code" href="net_8c.html#a42475d77dddb17b023b3fd026b32df02" title="Sends ptk to the nameserver at the resolver object.">ldns_send</a>(<a class="code" href="structldns__struct__pkt.html" title="DNS packet.">ldns_pkt</a> **pkt, <a class="code" href="structldns__struct__resolver.html" title="DNS stub resolver structure.">ldns_resolver</a> *r, <span class="keyword">const</span> <a class="code" href="structldns__struct__pkt.html" title="DNS packet.">ldns_pkt</a> *query_pkt); <a name="l00090"></a>00090 <a name="l00101"></a>00101 <a class="code" href="error_8h.html#aaa6d98f86f535cf87b83b89e91f488f9">ldns_status</a> <a class="code" href="net_8c.html#a807e96a5b5ba8e01e642a9a1ce2712e1" title="Sends and ldns_buffer (presumably containing a packet to the nameserver at the resolver object...">ldns_send_buffer</a>(<a class="code" href="structldns__struct__pkt.html" title="DNS packet.">ldns_pkt</a> **pkt, <a class="code" href="structldns__struct__resolver.html" title="DNS stub resolver structure.">ldns_resolver</a> *r, <a class="code" href="structldns__struct__buffer.html" title="implementation of buffers to ease operations">ldns_buffer</a> *qb, <a class="code" href="structldns__struct__rdf.html" title="Resource record data field.">ldns_rdf</a> *tsig_mac); <a name="l00102"></a>00102 <a name="l00110"></a>00110 <span class="keywordtype">int</span> <a class="code" href="net_8c.html#a734323eed74db2d1db4404a061686a6b" title="Create a tcp socket to the specified address.">ldns_tcp_connect</a>(<span class="keyword">const</span> <span class="keyword">struct</span> sockaddr_storage *to, socklen_t tolen, <span class="keyword">struct</span> timeval timeout); <a name="l00111"></a>00111 <a name="l00118"></a>00118 <span class="keywordtype">int</span> <a class="code" href="net_8c.html#a0f6a8295466fbecd78ae1a601398b15c">ldns_udp_connect</a>(<span class="keyword">const</span> <span class="keyword">struct</span> sockaddr_storage *to, <span class="keyword">struct</span> timeval timeout); <a name="l00119"></a>00119 <a name="l00129"></a>00129 ssize_t <a class="code" href="net_8c.html#a690205442102fe4b606b5679241fce04" title="send a query via tcp to a server.">ldns_tcp_send_query</a>(<a class="code" href="structldns__struct__buffer.html" title="implementation of buffers to ease operations">ldns_buffer</a> *qbin, <span class="keywordtype">int</span> sockfd, <span class="keyword">const</span> <span class="keyword">struct</span> sockaddr_storage *to, socklen_t tolen); <a name="l00130"></a>00130 <a name="l00140"></a>00140 ssize_t <a class="code" href="net_8c.html#af4cb429eb90f49cab4cb8e61081682c6" title="send a query via udp to a server.">ldns_udp_send_query</a>(<a class="code" href="structldns__struct__buffer.html" title="implementation of buffers to ease operations">ldns_buffer</a> *qbin, <span class="keywordtype">int</span> sockfd, <span class="keyword">const</span> <span class="keyword">struct</span> sockaddr_storage *to, socklen_t tolen); <a name="l00141"></a>00141 <a name="l00151"></a>00151 uint8_t *<a class="code" href="net_8c.html#a0ec64fcdbe349ca15283fee443d06737" title="Gives back a raw packet from the wire and reads the header data from the given socket.">ldns_tcp_read_wire_timeout</a>(<span class="keywordtype">int</span> sockfd, <span class="keywordtype">size_t</span> *size, <span class="keyword">struct</span> timeval timeout); <a name="l00152"></a>00152 <a name="l00162"></a>00162 uint8_t *<a class="code" href="net_8c.html#a3f7bd944f2cb1ea28bd8dd056c16e07d" title="This routine may block.">ldns_tcp_read_wire</a>(<span class="keywordtype">int</span> sockfd, <span class="keywordtype">size_t</span> *size); <a name="l00163"></a>00163 <a name="l00174"></a>00174 uint8_t *<a class="code" href="net_8c.html#a555370e0ed25b4b254eb26463e52b629" title="Gives back a raw packet from the wire and reads the header data from the given socket.">ldns_udp_read_wire</a>(<span class="keywordtype">int</span> sockfd, <span class="keywordtype">size_t</span> *size, <span class="keyword">struct</span> sockaddr_storage *fr, socklen_t *frlen); <a name="l00175"></a>00175 <a name="l00184"></a>00184 <span class="keyword">struct </span>sockaddr_storage * <a class="code" href="net_8c.html#a897b9376491b14bb57cdda6e6511464f" title="returns the native sockaddr representation from the rdf.">ldns_rdf2native_sockaddr_storage</a>(<span class="keyword">const</span> <a class="code" href="structldns__struct__rdf.html" title="Resource record data field.">ldns_rdf</a> *rd, uint16_t port, <span class="keywordtype">size_t</span> *size); <a name="l00185"></a>00185 <a name="l00192"></a>00192 <a class="code" href="structldns__struct__rdf.html" title="Resource record data field.">ldns_rdf</a> * <a class="code" href="net_8c.html#a88f2c363ffaec397410555b4f2fb9668" title="returns an rdf with the sockaddr info.">ldns_sockaddr_storage2rdf</a>(<span class="keyword">struct</span> sockaddr_storage *sock, uint16_t *port); <a name="l00193"></a>00193 <a name="l00202"></a>00202 <a class="code" href="error_8h.html#aaa6d98f86f535cf87b83b89e91f488f9">ldns_status</a> <a class="code" href="net_8c.html#a28efbc4d7b37d8e25db8d524e0ae1a54" title="Prepares the resolver for an axfr query The query is sent and the answers can be read with ldns_axfr_...">ldns_axfr_start</a>(<a class="code" href="structldns__struct__resolver.html" title="DNS stub resolver structure.">ldns_resolver</a> *resolver, <a class="code" href="structldns__struct__rdf.html" title="Resource record data field.">ldns_rdf</a> *domain, <a class="code" href="rr_8h.html#aa11e99c7e7c630e03373f2a2cafc4ee9">ldns_rr_class</a> c); <a name="l00203"></a>00203 <a name="l00204"></a>00204 <span class="preprocessor">#ifdef __cplusplus</span> <a name="l00205"></a>00205 <span class="preprocessor"></span>} <a name="l00206"></a>00206 <span class="preprocessor">#endif</span> <a name="l00207"></a>00207 <span class="preprocessor"></span> <a name="l00208"></a>00208 <span class="preprocessor">#endif </span><span class="comment">/* LDNS_NET_H */</span> </pre></div></div> </div> <hr class="footer"/><address class="footer"><small>Generated on Wed Jan 11 2012 for ldns by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address> </body> </html>