7 * DNS resolver code header file.
8 * \author Adam Dunkels <adam@dunkels.com>
12 * Copyright (c) 2002-2003, Adam Dunkels.
13 * All rights reserved.
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 * 3. The name of the author may not be used to endorse or promote
24 * products derived from this software without specific prior
27 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
28 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
29 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
31 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
33 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
35 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
36 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
37 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 * This file is part of the uIP TCP/IP stack.
41 * $Id: resolv.h,v 1.3 2008/08/13 20:12:18 andrewlxia Exp $
47 #include <uip/uipopt.h>
49 typedef int uip_udp_appstate_t;
50 void resolv_appcall(void);
51 #define UIP_UDP_APPCALL resolv_appcall
56 * Callback function which is called when a hostname is found.
58 * This function must be implemented by the module that uses the DNS
59 * resolver. It is called when a hostname is found, or when a hostname
62 * \param name A pointer to the name that was looked up. \param
63 * ipaddr A pointer to a 4-byte array containing the IP address of the
64 * hostname, or NULL if the hostname could not be found.
66 void resolv_found(char *name, u16_t *ipaddr);
69 void resolv_conf(u16_t *dnsserver);
70 u16_t *resolv_getserver(void);
71 void resolv_init(void);
72 u16_t *resolv_lookup(char *name);
73 void resolv_query(char *name);
75 #endif /* __RESOLV_H__ */