Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / ntp / sntp / internet.h
blob88b7de1a2e59240adeb25ea31b68c57a93c949ef
1 /* $NetBSD: internet.h,v 1.2 2003/12/04 16:23:38 drochner Exp $ */
3 /* Copyright (C) 1996 N.M. Maclaren
4 Copyright (C) 1996 The University of Cambridge
6 This includes all of the 'Internet' headers and definitions used across
7 modules, including those for handling timeouts. No changes should be needed
8 for any version of Unix with Internet (IP version 5) addressing, but would be
9 for other addressing domains. It needs <sys/socket.h> only because AF_INET is
10 needed by gethostbyaddr and is defined there rather than in <netdb.h>, for some
11 damn-fool reason. */
15 #include <setjmp.h>
16 #include <signal.h>
18 #include <unistd.h>
19 #include <sys/types.h>
20 #include <netinet/in.h>
21 #include <sys/socket.h>
25 /* It is most unclear whether these should be here or in kludges.h, as they are
26 kludges to keep 32-bit address dependencies out of the main body of internet.c,
27 to allow for the much heralded arrival of IP version 6. It will be interesting
28 to see whether the universal availability of 64-bit integers arrives first. */
30 #define local_to_address(x,y) ((x)->s_addr = htonl((unsigned long)y))
31 #define network_to_address(x,y) ((x)->s_addr = (y))
33 #define NTP_PORT htons((unsigned short)123) /* If not in /etc/services */
34 #define port_to_integer(x) (ntohs((unsigned short)(x)))
37 #if defined(_SS_MAXSIZE) || defined(_SS_SIZE)
38 #define HAVE_IPV6
39 #endif
41 /* Defined in internet.c */
42 #ifdef HAVE_IPV6
43 extern void find_address (struct sockaddr_storage *address,
44 struct sockaddr_storage *anywhere,
45 int *port, char *hostname, int timespan);
46 #else
47 extern void find_address (struct in_addr *address, struct in_addr *anywhere,
48 int *port, char *hostname, int timespan);
49 #endif