My fork of the HTTPServer (working)

Dependents:   DGWWebServer LAN2

Committer:
screamer
Date:
Mon Aug 06 09:23:14 2012 +0000
Revision:
0:7a64fbb4069d
[mbed] converted /DGWWebServer/HTTPServer

Who changed what in which revision?

UserRevisionLine numberNew contents of line
screamer 0:7a64fbb4069d 1 /**
screamer 0:7a64fbb4069d 2 * lwip DNS resolver header file.
screamer 0:7a64fbb4069d 3
screamer 0:7a64fbb4069d 4 * Author: Jim Pettinato
screamer 0:7a64fbb4069d 5 * April 2007
screamer 0:7a64fbb4069d 6
screamer 0:7a64fbb4069d 7 * ported from uIP resolv.c Copyright (c) 2002-2003, Adam Dunkels.
screamer 0:7a64fbb4069d 8 *
screamer 0:7a64fbb4069d 9 * Redistribution and use in source and binary forms, with or without
screamer 0:7a64fbb4069d 10 * modification, are permitted provided that the following conditions
screamer 0:7a64fbb4069d 11 * are met:
screamer 0:7a64fbb4069d 12 * 1. Redistributions of source code must retain the above copyright
screamer 0:7a64fbb4069d 13 * notice, this list of conditions and the following disclaimer.
screamer 0:7a64fbb4069d 14 * 2. Redistributions in binary form must reproduce the above copyright
screamer 0:7a64fbb4069d 15 * notice, this list of conditions and the following disclaimer in the
screamer 0:7a64fbb4069d 16 * documentation and/or other materials provided with the distribution.
screamer 0:7a64fbb4069d 17 * 3. The name of the author may not be used to endorse or promote
screamer 0:7a64fbb4069d 18 * products derived from this software without specific prior
screamer 0:7a64fbb4069d 19 * written permission.
screamer 0:7a64fbb4069d 20 *
screamer 0:7a64fbb4069d 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
screamer 0:7a64fbb4069d 22 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
screamer 0:7a64fbb4069d 23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
screamer 0:7a64fbb4069d 24 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
screamer 0:7a64fbb4069d 25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
screamer 0:7a64fbb4069d 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
screamer 0:7a64fbb4069d 27 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
screamer 0:7a64fbb4069d 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
screamer 0:7a64fbb4069d 29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
screamer 0:7a64fbb4069d 30 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
screamer 0:7a64fbb4069d 31 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
screamer 0:7a64fbb4069d 32 */
screamer 0:7a64fbb4069d 33
screamer 0:7a64fbb4069d 34 #ifndef __LWIP_DNS_H__
screamer 0:7a64fbb4069d 35 #define __LWIP_DNS_H__
screamer 0:7a64fbb4069d 36
screamer 0:7a64fbb4069d 37 #include "lwip/opt.h"
screamer 0:7a64fbb4069d 38 #include "lwip/err.h"
screamer 0:7a64fbb4069d 39
screamer 0:7a64fbb4069d 40 #if LWIP_DNS /* don't build if not configured for use in lwipopts.h */
screamer 0:7a64fbb4069d 41
screamer 0:7a64fbb4069d 42 #ifdef __cplusplus
screamer 0:7a64fbb4069d 43 extern "C" {
screamer 0:7a64fbb4069d 44 #endif
screamer 0:7a64fbb4069d 45
screamer 0:7a64fbb4069d 46 /** DNS timer period */
screamer 0:7a64fbb4069d 47 #define DNS_TMR_INTERVAL 1000
screamer 0:7a64fbb4069d 48
screamer 0:7a64fbb4069d 49 /** DNS field TYPE used for "Resource Records" */
screamer 0:7a64fbb4069d 50 #define DNS_RRTYPE_A 1 /* a host address */
screamer 0:7a64fbb4069d 51 #define DNS_RRTYPE_NS 2 /* an authoritative name server */
screamer 0:7a64fbb4069d 52 #define DNS_RRTYPE_MD 3 /* a mail destination (Obsolete - use MX) */
screamer 0:7a64fbb4069d 53 #define DNS_RRTYPE_MF 4 /* a mail forwarder (Obsolete - use MX) */
screamer 0:7a64fbb4069d 54 #define DNS_RRTYPE_CNAME 5 /* the canonical name for an alias */
screamer 0:7a64fbb4069d 55 #define DNS_RRTYPE_SOA 6 /* marks the start of a zone of authority */
screamer 0:7a64fbb4069d 56 #define DNS_RRTYPE_MB 7 /* a mailbox domain name (EXPERIMENTAL) */
screamer 0:7a64fbb4069d 57 #define DNS_RRTYPE_MG 8 /* a mail group member (EXPERIMENTAL) */
screamer 0:7a64fbb4069d 58 #define DNS_RRTYPE_MR 9 /* a mail rename domain name (EXPERIMENTAL) */
screamer 0:7a64fbb4069d 59 #define DNS_RRTYPE_NULL 10 /* a null RR (EXPERIMENTAL) */
screamer 0:7a64fbb4069d 60 #define DNS_RRTYPE_WKS 11 /* a well known service description */
screamer 0:7a64fbb4069d 61 #define DNS_RRTYPE_PTR 12 /* a domain name pointer */
screamer 0:7a64fbb4069d 62 #define DNS_RRTYPE_HINFO 13 /* host information */
screamer 0:7a64fbb4069d 63 #define DNS_RRTYPE_MINFO 14 /* mailbox or mail list information */
screamer 0:7a64fbb4069d 64 #define DNS_RRTYPE_MX 15 /* mail exchange */
screamer 0:7a64fbb4069d 65 #define DNS_RRTYPE_TXT 16 /* text strings */
screamer 0:7a64fbb4069d 66
screamer 0:7a64fbb4069d 67 /** DNS field CLASS used for "Resource Records" */
screamer 0:7a64fbb4069d 68 #define DNS_RRCLASS_IN 1 /* the Internet */
screamer 0:7a64fbb4069d 69 #define DNS_RRCLASS_CS 2 /* the CSNET class (Obsolete - used only for examples in some obsolete RFCs) */
screamer 0:7a64fbb4069d 70 #define DNS_RRCLASS_CH 3 /* the CHAOS class */
screamer 0:7a64fbb4069d 71 #define DNS_RRCLASS_HS 4 /* Hesiod [Dyer 87] */
screamer 0:7a64fbb4069d 72 #define DNS_RRCLASS_FLUSH 0x800 /* Flush bit */
screamer 0:7a64fbb4069d 73
screamer 0:7a64fbb4069d 74 /** Callback which is invoked when a hostname is found.
screamer 0:7a64fbb4069d 75 * A function of this type must be implemented by the application using the DNS resolver.
screamer 0:7a64fbb4069d 76 * @param name pointer to the name that was looked up.
screamer 0:7a64fbb4069d 77 * @param ipaddr pointer to a struct ip_addr containing the IP address of the hostname,
screamer 0:7a64fbb4069d 78 * or NULL if the name could not be found (or on any other error).
screamer 0:7a64fbb4069d 79 * @param callback_arg a user-specified callback argument passed to dns_gethostbyname
screamer 0:7a64fbb4069d 80 */
screamer 0:7a64fbb4069d 81 typedef void (*dns_found_callback)(const char *name, struct ip_addr *ipaddr, void *callback_arg);
screamer 0:7a64fbb4069d 82
screamer 0:7a64fbb4069d 83
screamer 0:7a64fbb4069d 84 void dns_init(void);
screamer 0:7a64fbb4069d 85
screamer 0:7a64fbb4069d 86 void dns_tmr(void);
screamer 0:7a64fbb4069d 87
screamer 0:7a64fbb4069d 88 void dns_setserver(u8_t numdns, struct ip_addr *dnsserver);
screamer 0:7a64fbb4069d 89
screamer 0:7a64fbb4069d 90 struct ip_addr dns_getserver(u8_t numdns);
screamer 0:7a64fbb4069d 91
screamer 0:7a64fbb4069d 92 err_t dns_gethostbyname(const char *hostname, struct ip_addr *addr,
screamer 0:7a64fbb4069d 93 dns_found_callback found, void *callback_arg);
screamer 0:7a64fbb4069d 94
screamer 0:7a64fbb4069d 95 #if DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC
screamer 0:7a64fbb4069d 96 int dns_local_removehostname(const char *hostname);
screamer 0:7a64fbb4069d 97 int dns_local_removehostaddr(const struct ip_addr *addr);
screamer 0:7a64fbb4069d 98 err_t dns_local_addhost(const char *hostname, const struct ip_addr *addr);
screamer 0:7a64fbb4069d 99 #endif /* DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC */
screamer 0:7a64fbb4069d 100
screamer 0:7a64fbb4069d 101 #ifdef __cplusplus
screamer 0:7a64fbb4069d 102 }
screamer 0:7a64fbb4069d 103 #endif
screamer 0:7a64fbb4069d 104
screamer 0:7a64fbb4069d 105 #endif /* LWIP_DNS */
screamer 0:7a64fbb4069d 106
screamer 0:7a64fbb4069d 107 #endif /* __LWIP_DNS_H__ */