00001 /* $Id: addr_resolv.h 3553 2011-05-05 06:14:19Z nanang $ */00002 /* 00003 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)00004 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>00005 *00006 * This program is free software; you can redistribute it and/or modify00007 * it under the terms of the GNU General Public License as published by00008 * the Free Software Foundation; either version 2 of the License, or00009 * (at your option) any later version.00010 *00011 * This program is distributed in the hope that it will be useful,00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the00014 * GNU General Public License for more details.00015 *00016 * You should have received a copy of the GNU General Public License00017 * along with this program; if not, write to the Free Software00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 */00020 #ifndef __PJ_ADDR_RESOLV_H__00021 #define __PJ_ADDR_RESOLV_H__00022
00028 #include <pj/sock.h>00029
00030 PJ_BEGIN_DECL00031
00065typedefstruct pj_hostent00066 {
00067char *h_name;
00068char **h_aliases;
00069inth_addrtype;
00070inth_length;
00071char **h_addr_list;
00072 } pj_hostent;
00073
00075#define h_addr h_addr_list[0]00076
00080typedefstruct pj_addrinfo00081 {
00082charai_canonname[PJ_MAX_HOSTNAME];
00083pj_sockaddrai_addr;
00084 } pj_addrinfo;
00085
00086
00101 PJ_DECL(pj_status_t) pj_gethostbyname(const pj_str_t *name, pj_hostent *he);
00102
00103
00116 PJ_DECL(pj_status_t) pj_gethostip(int af, pj_sockaddr *addr);
00117
00118
00132 PJ_DECL(pj_status_t) pj_getdefaultipinterface(int af,
00133 pj_sockaddr *addr);
00134
00135
00155 PJ_DECL(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *name,
00156 unsigned *count, pj_addrinfo ai[]);
00157
00158
00159
00162 PJ_END_DECL00163
00164 #endif /* __PJ_ADDR_RESOLV_H__ */00165
PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.