resolv.h

00001 /**
00002  * \addtogroup resolv
00003  * @{
00004  */
00005 /**
00006  * \file
00007  * DNS resolver code header file.
00008  * \author Adam Dunkels <adam@dunkels.com>
00009  */
00010 
00011 /*
00012  * Copyright (c) 2002-2003, Adam Dunkels.
00013  * All rights reserved.
00014  *
00015  * Redistribution and use in source and binary forms, with or without
00016  * modification, are permitted provided that the following conditions
00017  * are met:
00018  * 1. Redistributions of source code must retain the above copyright
00019  *    notice, this list of conditions and the following disclaimer.
00020  * 2. Redistributions in binary form must reproduce the above copyright
00021  *    notice, this list of conditions and the following disclaimer in the
00022  *    documentation and/or other materials provided with the distribution.
00023  * 3. The name of the author may not be used to endorse or promote
00024  *    products derived from this software without specific prior
00025  *    written permission.
00026  *
00027  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
00028  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00029  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00030  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
00031  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00032  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
00033  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00034  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00035  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00036  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00037  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038  *
00039  * This file is part of the uIP TCP/IP stack.
00040  *
00041  * $Id: resolv.h,v 1.4 2006/06/11 21:46:37 adam Exp $
00042  *
00043  */
00044 #ifndef __RESOLV_H__
00045 #define __RESOLV_H__
00046 
00047 typedef int uip_udp_appstate_t;
00048 void resolv_appcall(void);
00049 #define UIP_UDP_APPCALL resolv_appcall
00050 
00051 #include "uipopt.h"
00052 
00053 /**
00054  * Callback function which is called when a hostname is found.
00055  *
00056  * This function must be implemented by the module that uses the DNS
00057  * resolver. It is called when a hostname is found, or when a hostname
00058  * was not found.
00059  *
00060  * \param name A pointer to the name that was looked up.  \param
00061  * ipaddr A pointer to a 4-byte array containing the IP address of the
00062  * hostname, or NULL if the hostname could not be found.
00063  */
00064 void resolv_found(char *name, u16_t *ipaddr);
00065 
00066 /* Functions. */
00067 void resolv_conf(u16_t *dnsserver);
00068 u16_t *resolv_getserver(void);
00069 void resolv_init(void);
00070 u16_t *resolv_lookup(char *name);
00071 void resolv_query(char *name);
00072 
00073 #endif /* __RESOLV_H__ */
00074 
00075 /** @} */

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  doxygen 1.4.6