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