2002-04-12 03:35:39 +00:00
|
|
|
/* $Id: fake-socket.h,v 1.3 2002/04/12 03:35:40 tim Exp $ */
|
2001-02-09 01:55:35 +00:00
|
|
|
|
2000-01-14 04:45:46 +00:00
|
|
|
#ifndef _FAKE_SOCKET_H
|
|
|
|
#define _FAKE_SOCKET_H
|
|
|
|
|
2002-04-12 03:35:39 +00:00
|
|
|
#include "includes.h"
|
2000-01-14 04:45:46 +00:00
|
|
|
#include "sys/types.h"
|
|
|
|
|
|
|
|
#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
|
2000-05-31 01:20:11 +00:00
|
|
|
# define _SS_MAXSIZE 128 /* Implementation specific max size */
|
2000-09-16 05:21:28 +00:00
|
|
|
# define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr))
|
2000-01-14 04:45:46 +00:00
|
|
|
|
|
|
|
struct sockaddr_storage {
|
2000-09-16 05:21:28 +00:00
|
|
|
struct sockaddr ss_sa;
|
|
|
|
char __ss_pad2[_SS_PADSIZE];
|
2000-01-14 04:45:46 +00:00
|
|
|
};
|
2000-09-16 05:21:28 +00:00
|
|
|
# define ss_family ss_sa.sa_family
|
2000-01-14 04:45:46 +00:00
|
|
|
#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
|
|
|
|
|
|
|
|
#ifndef IN6_IS_ADDR_LOOPBACK
|
2000-05-31 01:20:11 +00:00
|
|
|
# define IN6_IS_ADDR_LOOPBACK(a) \
|
2000-01-14 04:45:46 +00:00
|
|
|
(((u_int32_t *) (a))[0] == 0 && ((u_int32_t *) (a))[1] == 0 && \
|
|
|
|
((u_int32_t *) (a))[2] == 0 && ((u_int32_t *) (a))[3] == htonl (1))
|
|
|
|
#endif /* !IN6_IS_ADDR_LOOPBACK */
|
|
|
|
|
|
|
|
#ifndef HAVE_STRUCT_IN6_ADDR
|
|
|
|
struct in6_addr {
|
|
|
|
u_int8_t s6_addr[16];
|
|
|
|
};
|
|
|
|
#endif /* !HAVE_STRUCT_IN6_ADDR */
|
|
|
|
|
|
|
|
#ifndef HAVE_STRUCT_SOCKADDR_IN6
|
|
|
|
struct sockaddr_in6 {
|
|
|
|
unsigned short sin6_family;
|
|
|
|
u_int16_t sin6_port;
|
|
|
|
u_int32_t sin6_flowinfo;
|
|
|
|
struct in6_addr sin6_addr;
|
|
|
|
};
|
|
|
|
#endif /* !HAVE_STRUCT_SOCKADDR_IN6 */
|
|
|
|
|
|
|
|
#ifndef AF_INET6
|
|
|
|
/* Define it to something that should never appear */
|
|
|
|
#define AF_INET6 AF_MAX
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* !_FAKE_SOCKET_H */
|
|
|
|
|