00001 00002 /*************************************************************************** 00003 * avahi_resolver_handler.cpp - Avahi name resolver 00004 * 00005 * Created: Tue Feb 19 09:40:51 2008 00006 * Copyright 2006-2008 Tim Niemueller [www.niemueller.de] 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. A runtime exception applies to 00014 * this software (see LICENSE.GPL_WRE file mentioned below for details). 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Library General Public License for more details. 00020 * 00021 * Read the full text in the LICENSE.GPL_WRE file in the doc directory. 00022 */ 00023 00024 #include <netcomm/dns-sd/avahi_resolver_handler.h> 00025 00026 namespace fawkes { 00027 00028 /** @class AvahiResolverHandler <netcomm/dns-sd/avahi_resolver_handler.h> 00029 * Avahi resolver handler interface. 00030 * This interface has to be implemented to make use of the threaded 00031 * Avahi lookup of names and addresses. After you have ordered a 00032 * lookup this handler is called with the result. 00033 * 00034 * @ingroup NetComm 00035 * @author Tim Niemueller 00036 * 00037 * @fn void AvahiResolverHandler::resolved_name(char *name, struct sockaddr *addr, socklen_t addrlen) = 0 00038 * Name has been successfully resolved. 00039 * The ordered name lookup was successful for the given name resulting in 00040 * the given addr of addrlen bytes length. 00041 * Note that all of the parameters are given to the handler's ownership, that means 00042 * especially that the handler is responsible for freeing the associated memory 00043 * after it is done with the result using free() on name and addr. 00044 * @param name name that was resolved 00045 * @param addr resulting addr record, currently always of type struct sockaddr_in (only IPv4) 00046 * @param addrlen length of addr in bytes 00047 * 00048 * @fn void AvahiResolverHandler::resolved_address(struct sockaddr_in *addr, socklen_t addrlen, char *name) = 0 00049 * Address has been successfully resolved. 00050 * The ordered name lookup was successful for the given address resulting in 00051 * the given name. 00052 * Note that all of the parameters are given to the handler's ownership, that means 00053 * especially that the handler is responsible for freeing the associated memory 00054 * after it is done with the result using free() on name and addr. 00055 * @param name the resulting hostname 00056 * @param addr addr record, currently always of type struct sockaddr_in (only IPv4) 00057 * @param addrlen length of addr in bytes 00058 * 00059 * @fn void AvahiResolverHandler::name_resolution_failed(char *name) = 0 00060 * Name resolution failed. 00061 * The given hostname could not be resolved. 00062 * Note that the parameter name is given to the handler's ownership. This means 00063 * especially that the handler is responsible for freeing the memory with free() 00064 * after it is done with the variable. 00065 * @param name name whose lookup failed 00066 * 00067 * @fn void AvahiResolverHandler::address_resolution_failed(struct sockaddr_in *addr, socklen_t addrlen) = 0 00068 * Address resolution failed. 00069 * The given address could not be resolved. 00070 * Note that the parameter addr is given to the handler's ownership. This means 00071 * especially that the handler is responsible for freeing the memory with free() 00072 * after it is done with the variable. 00073 * @param addr address whose lookup failed 00074 * @param addrlen length of address 00075 */ 00076 00077 /** Virtual empty destructor. */ 00078 AvahiResolverHandler::~AvahiResolverHandler() 00079 { 00080 } 00081 00082 } // end namespace fawkes