]>
Commit | Line | Data |
---|---|---|
0b202697 | 1 | /* $Id$ */ |
2 | ||
48e671d5 | 3 | #ifndef _FAKE_SOCKET_H |
4 | #define _FAKE_SOCKET_H | |
5 | ||
7b0737a4 | 6 | #include "includes.h" |
48e671d5 | 7 | #include "sys/types.h" |
8 | ||
9 | #ifndef HAVE_STRUCT_SOCKADDR_STORAGE | |
5daf7064 | 10 | # define _SS_MAXSIZE 128 /* Implementation specific max size */ |
995edaac | 11 | # define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr)) |
48e671d5 | 12 | |
13 | struct sockaddr_storage { | |
995edaac | 14 | struct sockaddr ss_sa; |
15 | char __ss_pad2[_SS_PADSIZE]; | |
48e671d5 | 16 | }; |
995edaac | 17 | # define ss_family ss_sa.sa_family |
48e671d5 | 18 | #endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */ |
19 | ||
20 | #ifndef IN6_IS_ADDR_LOOPBACK | |
5daf7064 | 21 | # define IN6_IS_ADDR_LOOPBACK(a) \ |
48e671d5 | 22 | (((u_int32_t *) (a))[0] == 0 && ((u_int32_t *) (a))[1] == 0 && \ |
23 | ((u_int32_t *) (a))[2] == 0 && ((u_int32_t *) (a))[3] == htonl (1)) | |
24 | #endif /* !IN6_IS_ADDR_LOOPBACK */ | |
25 | ||
26 | #ifndef HAVE_STRUCT_IN6_ADDR | |
27 | struct in6_addr { | |
28 | u_int8_t s6_addr[16]; | |
29 | }; | |
30 | #endif /* !HAVE_STRUCT_IN6_ADDR */ | |
31 | ||
32 | #ifndef HAVE_STRUCT_SOCKADDR_IN6 | |
33 | struct sockaddr_in6 { | |
34 | unsigned short sin6_family; | |
35 | u_int16_t sin6_port; | |
36 | u_int32_t sin6_flowinfo; | |
37 | struct in6_addr sin6_addr; | |
38 | }; | |
39 | #endif /* !HAVE_STRUCT_SOCKADDR_IN6 */ | |
40 | ||
41 | #ifndef AF_INET6 | |
42 | /* Define it to something that should never appear */ | |
43 | #define AF_INET6 AF_MAX | |
44 | #endif | |
45 | ||
46 | #endif /* !_FAKE_SOCKET_H */ | |
47 |