2 udns_ntop() and udns_pton() routines, which are either
3 - wrappers for inet_ntop() and inet_pton() or
4 - reimplementations of those routines.
6 Copyright (C) 2005 Michael Tokarev <mjt@corpit.ru>
7 This file is part of UDNS library, an async DNS stub resolver.
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or (at your option) any later version.
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library, in file named COPYING.LGPL; if not,
21 write to the Free Software Foundation, Inc., 59 Temple Place,
22 Suite 330, Boston, MA 02111-1307 USA
31 #ifdef HAVE_INET_PTON_NTOP
33 #include <sys/types.h>
34 #include <sys/socket.h>
35 #include <arpa/inet.h>
37 const char *dns_ntop(int af, const void *src, char *dst, int size) {
38 return inet_ntop(af, src, dst, size);
41 int dns_pton(int af, const char *src, void *dst) {
42 return inet_pton(af, src, dst);
47 #define inet_XtoX_prefix udns_
48 #include "inet_XtoX.c"