Commit 34729dbc authored by Andreas Gustafsson's avatar Andreas Gustafsson

split lwres/net.h into separate Unix and Win32 version to facilitate

porting; rely on that header for networking definitions rather than redundantly
including OS-dependent headers from the various lwres .c files
parent 5d977731
......@@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
esyscmd([sed "s/^/# /" COPYRIGHT])dnl
AC_DIVERT_POP()dnl
AC_REVISION($Revision: 1.267 $)
AC_REVISION($Revision: 1.268 $)
AC_INIT(lib/dns/name.c)
AC_PREREQ(2.13)
......@@ -1617,6 +1617,12 @@ AC_OUTPUT(
lib/lwres/include/lwres/netdb.h
lib/lwres/include/lwres/platform.h
lib/lwres/man/Makefile
lib/lwres/unix/Makefile
lib/lwres/unix/include/Makefile
lib/lwres/unix/include/lwres/Makefile
lib/lwres/win32/Makefile
lib/lwres/win32/include/Makefile
lib/lwres/win32/include/lwres/Makefile
lib/tests/Makefile
lib/tests/include/Makefile
lib/tests/include/tests/Makefile
......
......@@ -13,7 +13,7 @@
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.24 2001/01/19 22:46:26 bwelling Exp $
# $Id: Makefile.in,v 1.25 2001/07/10 18:25:37 gson Exp $
srcdir = @srcdir@
VPATH = @srcdir@
......@@ -25,7 +25,8 @@ top_srcdir = @top_srcdir@
@BIND9_INCLUDES@
CINCLUDES = -I. -I./include -I${srcdir}/include ${ISC_INCLUDES}
CINCLUDES = -I${srcdir}/unix/include \
-I. -I./include -I${srcdir}/include ${ISC_INCLUDES}
CDEFINES =
CWARNINGS =
......@@ -45,7 +46,7 @@ SRCS = context.c gai_strerror.c getaddrinfo.c gethost.c \
LIBS = @LIBS@
SUBDIRS = include man
SUBDIRS = include man unix
TARGETS = timestamp
@BIND9_MAKE_RULES@
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: context.c,v 1.36 2001/07/02 20:46:28 bwelling Exp $ */
/* $Id: context.c,v 1.37 2001/07/10 18:25:39 gson Exp $ */
#include <config.h>
......@@ -26,12 +26,6 @@
#include <time.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <lwres/lwres.h>
#include <lwres/net.h>
#include <lwres/platform.h>
......
......@@ -19,26 +19,17 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: getaddrinfo.c,v 1.39 2001/06/28 06:02:18 mayer Exp $ */
/* $Id: getaddrinfo.c,v 1.40 2001/07/10 18:25:40 gson Exp $ */
#include <config.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <arpa/inet.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <lwres/lwres.h>
#include <lwres/net.h>
#include <lwres/netdb.h> /* XXX #include <netdb.h> */
#include <lwres/netdb.h>
#define SA(addr) ((struct sockaddr *)(addr))
#define SIN(addr) ((struct sockaddr_in *)(addr))
......
......@@ -15,12 +15,10 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: gethost.c,v 1.28 2001/03/06 23:12:15 bwelling Exp $ */
/* $Id: gethost.c,v 1.29 2001/07/10 18:25:41 gson Exp $ */
#include <config.h>
#include <sys/types.h>
#include <errno.h>
#include <string.h>
......
......@@ -15,17 +15,10 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: getipnode.c,v 1.28 2001/01/09 21:59:19 bwelling Exp $ */
/* $Id: getipnode.c,v 1.29 2001/07/10 18:25:42 gson Exp $ */
#include <config.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: getnameinfo.c,v 1.29 2001/03/05 23:14:03 bwelling Exp $ */
/* $Id: getnameinfo.c,v 1.30 2001/07/10 18:25:43 gson Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
......@@ -59,11 +59,6 @@
#include <config.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
#include <string.h>
......
......@@ -15,12 +15,10 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: getrrset.c,v 1.10 2001/07/02 21:28:53 gson Exp $ */
/* $Id: getrrset.c,v 1.11 2001/07/10 18:25:44 gson Exp $ */
#include <config.h>
#include <sys/types.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
......
......@@ -13,7 +13,7 @@
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.14 2001/01/09 21:59:38 bwelling Exp $
# $Id: Makefile.in,v 1.15 2001/07/10 18:25:47 gson Exp $
srcdir = @srcdir@
VPATH = @srcdir@
......@@ -24,7 +24,7 @@ top_srcdir = @top_srcdir@
# machine generated. The latter are handled specially in the
# install target below.
#
HEADERS = context.h lwbuffer.h lwpacket.h lwres.h result.h \
HEADERS = context.h lwbuffer.h lwpacket.h result.h \
int.h lang.h list.h net.h ipv6.h
SUBDIRS =
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lwconfig.c,v 1.32 2001/04/12 22:45:12 tale Exp $ */
/* $Id: lwconfig.c,v 1.33 2001/07/10 18:25:45 gson Exp $ */
/***
*** Module for parsing resolv.conf files.
......@@ -46,8 +46,6 @@
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <lwres/lwbuffer.h>
#include <lwres/lwres.h>
#include <lwres/net.h>
......
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lwresutil.c,v 1.28 2001/03/06 23:02:04 bwelling Exp $ */
/* $Id: lwresutil.c,v 1.29 2001/07/10 18:25:46 gson Exp $ */
#include <config.h>
......@@ -24,8 +24,6 @@
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <lwres/lwbuffer.h>
#include <lwres/lwres.h>
#include <lwres/result.h>
......
# Copyright (C) 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.1 2001/07/10 18:25:49 gson Exp $
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
SUBDIRS = include
TARGETS =
@BIND9_MAKE_RULES@
# Copyright (C) 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.1 2001/07/10 18:25:50 gson Exp $
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
SUBDIRS = lwres
TARGETS =
@BIND9_MAKE_RULES@
# Copyright (C) 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.1 2001/07/10 18:25:50 gson Exp $
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
HEADERS = net.h
SUBDIRS =
TARGETS =
@BIND9_MAKE_RULES@
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir}/lwres
install:: installdirs
for i in ${HEADERS}; do \
${INSTALL_DATA} $(srcdir)/$$i ${DESTDIR}${includedir}/lwres ; \
done
......@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: net.h,v 1.13 2001/07/07 00:03:26 bwelling Exp $ */
/* $Id: net.h,v 1.1 2001/07/10 18:25:50 gson Exp $ */
#ifndef LWRES_NET_H
#define LWRES_NET_H 1
......@@ -54,6 +54,7 @@
#include <sys/types.h>
#include <sys/socket.h> /* Contractual promise. */
#include <sys/un.h>
#include <netinet/in.h> /* Contractual promise. */
#include <arpa/inet.h> /* Contractual promise. */
......
# Copyright (C) 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.1 2001/07/10 18:25:50 gson Exp $
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
SUBDIRS = include
TARGETS =
@BIND9_MAKE_RULES@
# Copyright (C) 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.1 2001/07/10 18:25:50 gson Exp $
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
SUBDIRS = lwres
TARGETS =
@BIND9_MAKE_RULES@
# Copyright (C) 2001 Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.1 2001/07/10 18:25:50 gson Exp $
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
HEADERS = net.h
SUBDIRS =
TARGETS =
@BIND9_MAKE_RULES@
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir}/lwres
install:: installdirs
for i in ${HEADERS}; do \
${INSTALL_DATA} $(srcdir)/$$i ${DESTDIR}${includedir}/lwres ; \
done
/*
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: net.h,v 1.1 2001/07/10 18:25:50 gson Exp $ */
#ifndef LWRES_NET_H
#define LWRES_NET_H 1
/*****
***** Module Info
*****/
/*
* Basic Networking Types
*
* This module is responsible for defining the following basic networking
* types:
*
* struct in_addr
* struct in6_addr
* struct sockaddr
* struct sockaddr_in
* struct sockaddr_in6
*
* It ensures that the AF_ and PF_ macros are defined.
*
* It declares ntoh[sl]() and hton[sl]().
*
* It declares lwres_net_aton(), lwres_net_ntop(), and lwres_net_pton().
*
* It ensures that INADDR_LOOPBACK, INADDR_ANY and IN6ADDR_ANY_INIT
* are defined.
*/
/***
*** Imports.
***/
#include <lwres/platform.h> /* Required for LWRES_PLATFORM_*. */
#include <winsock.h>
/* XXXAG Remainder of file needs to be rewritten for win32 */
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#ifdef LWRES_PLATFORM_NEEDNETINETIN6H
#include <netinet/in6.h> /* Required on UnixWare. */
#endif
#ifdef LWRES_PLATFORM_NEEDNETINET6IN6H
#include <netinet6/in6.h> /* Required on BSD/OS for in6_pktinfo. */
#endif
#include <lwres/lang.h>
#ifdef LWRES_PLATFORM_HAVEINADDR6
#define in6_addr in_addr6 /* Required for pre RFC2133 implementations. */
#endif
/*
* Required for some pre RFC2133 implementations.
* IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT were added in
* draft-ietf-ipngwg-bsd-api-04.txt or draft-ietf-ipngwg-bsd-api-05.txt.
* If 's6_addr' is defined then assume that there is a union and three
* levels otherwise assume two levels required.
*/
#ifndef IN6ADDR_ANY_INIT
#ifdef s6_addr
#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
#else
#define IN6ADDR_ANY_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
#endif
#endif
#ifndef IN6ADDR_LOOPBACK_INIT
#ifdef s6_addr
#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
#else
#define IN6ADDR_LOOPBACK_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } }
#endif
#endif
#ifndef AF_INET6
#define AF_INET6 99
#endif
#ifndef PF_INET6
#define PF_INET6 AF_INET6
#endif
#ifndef LWRES_PLATFORM_HAVEIPV6
#include <lwres/ipv6.h> /* Contractual promise. */
#endif
#ifndef INADDR_LOOPBACK
#define INADDR_LOOPBACK 0x7f000001UL
#endif
LWRES_LANG_BEGINDECLS
const char *
lwres_net_ntop(int af, const void *src, char *dst, size_t size);
int
lwres_net_pton(int af, const char *src, void *dst);
int
lwres_net_aton(const char *cp, struct in_addr *addr);
LWRES_LANG_ENDDECLS
#endif /* LWRES_NET_H */
......@@ -1776,7 +1776,19 @@
./lib/lwres/man/lwres_resutil.docbook SGML 2001
./lib/lwres/man/lwres_resutil.html X 2001
./lib/lwres/man/resolver.5 MAN 2000,2001
./lib/lwres/unix/Makefile MAKE 2001
./lib/lwres/unix/.cvsignore X 2001
./lib/lwres/unix/include/Makefile MAKE 2001
./lib/lwres/unix/include/.cvsignore X 2001
./lib/lwres/unix/include/lwres/Makefile MAKE 2001
./lib/lwres/unix/include/lwres/.cvsignore X 2001
./lib/lwres/version.c C 2000,2001
./lib/lwres/win32/Makefile MAKE 2001
./lib/lwres/win32/.cvsignore X 2001
./lib/lwres/win32/include/Makefile MAKE 2001
./lib/lwres/win32/include/.cvsignore X 2001
./lib/lwres/win32/include/lwres/Makefile MAKE 2001
./lib/lwres/win32/include/lwres/.cvsignore X 2001
./lib/tests/.cvsignore X 1999,2000,2001
./lib/tests/Makefile.in MAKE 1998,1999,2000,2001
./lib/tests/include/.cvsignore X 1999,2000,2001
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment