Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Release 1.0
[palacios.git] / geekos / include / uip / resolv.h
1 /**
2  * \addtogroup resolv
3  * @{
4  */
5 /**
6  * \file
7  * DNS resolver code header file.
8  * \author Adam Dunkels <adam@dunkels.com>
9  */
10
11 /*
12  * Copyright (c) 2002-2003, Adam Dunkels.
13  * All rights reserved.
14  *
15  * Redistribution and use in source and binary forms, with or without
16  * modification, are permitted provided that the following conditions
17  * are met:
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
25  *    written permission.
26  *
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.
38  *
39  * This file is part of the uIP TCP/IP stack.
40  *
41  * $Id: resolv.h,v 1.3 2008/08/13 20:12:18 andrewlxia Exp $
42  *
43  */
44 #ifndef __RESOLV_H__
45 #define __RESOLV_H__
46
47 #include <uip/uipopt.h>
48
49 typedef int uip_udp_appstate_t;
50 void resolv_appcall(void);
51 #define UIP_UDP_APPCALL resolv_appcall
52
53
54
55 /**
56  * Callback function which is called when a hostname is found.
57  *
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
60  * was not found.
61  *
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.
65  */
66 void resolv_found(char *name, u16_t *ipaddr);
67
68 /* Functions. */
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);
74
75 #endif /* __RESOLV_H__ */
76
77 /** @} */