1 /** 2 * \addtogroup resolv 3 * @{ 4 */ 5 /** 6 * \file 7 * DNS resolver code header file. 8 * \author Adam Dunkels <[email protected]> 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.4 2006/06/11 21:46:37 adam Exp $ 42 * 43 */ 44 #ifndef __RESOLV_H__ 45 #define __RESOLV_H__ 46 47 typedef int uip_udp_appstate_t; 48 void resolv_appcall(void); 49 #define UIP_UDP_APPCALL resolv_appcall 50 51 #include "uipopt.h" 52 53 /** 54 * Callback function which is called when a hostname is found. 55 * 56 * This function must be implemented by the module that uses the DNS 57 * resolver. It is called when a hostname is found, or when a hostname 58 * was not found. 59 * 60 * \param name A pointer to the name that was looked up. \param 61 * ipaddr A pointer to a 4-byte array containing the IP address of the 62 * hostname, or NULL if the hostname could not be found. 63 */ 64 void resolv_found(char *name, u16_t *ipaddr); 65 66 /* Functions. */ 67 void resolv_conf(u16_t *dnsserver); 68 u16_t *resolv_getserver(void); 69 void resolv_init(void); 70 u16_t *resolv_lookup(char *name); 71 void resolv_query(char *name); 72 73 #endif /* __RESOLV_H__ */ 74 75 /** @} */ 76