DEFINITIONS
This source file includes following functions.
- SA_LEN
- SA_LEN
- SA_LEN
- SET_SA_LEN
- SET_SA_LEN
- SIN_LEN
- SET_SIN_LEN
- SIN_LEN
- SET_SIN_LEN
- IN_CLASSD
- IN_MULTICAST
- IN_EXPERIMENTAL
1
2
3
4
5
6
7
8
9
10
11 #ifndef SOCKPORT_H
12 #define SOCKPORT_H
13
14 #ifndef SA_LEN
15 # ifdef HAVE_SA_LEN
16 # define SA_LEN(sa) (sa)->sa_len
17 # else
18 # ifdef INET6
19 # define SA_LEN(sa) \
20 (((sa)->sa_family == AF_INET6) ? sizeof(struct sockaddr_in6) \
21 : sizeof(struct sockaddr))
22 # else
23
24 # define SA_LEN(sa) (sizeof(struct sockaddr))
25 # endif
26 # endif
27 #endif
28
29 #ifdef HAVE_SA_LEN
30 # define SET_SA_LEN(sa, len) (sa)->sa_len = (len)
31 #else
32 # define SET_SA_LEN(sa, len) (len)
33 #endif
34
35 #ifdef HAVE_SIN_LEN
36 # define SIN_LEN(si) (si)->sin_len
37 # define SET_SIN_LEN(si,len) (si)->sin_len = (len)
38 #else
39 # define SIN_LEN(si) sizeof(struct sockaddr_in)
40 # define SET_SIN_LEN(si,len)
41 #endif
42
43 #ifndef IN_MULTICAST
44 # define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000)
45 # define IN_MULTICAST(i) IN_CLASSD(i)
46 #endif
47
48 #ifndef IN_EXPERIMENTAL
49 # define IN_EXPERIMENTAL(i) ((((long)(i)) & 0xe0000000) == 0xe0000000)
50 #endif
51
52 #ifndef IN_CLASSA_NSHIFT
53 # define IN_CLASSA_NSHIFT 24
54 #endif
55
56 #ifndef IN_LOOPBACKNET
57 # define IN_LOOPBACKNET 127
58 #endif
59
60 #ifndef AF_UNSPEC
61 # define AF_UNSPEC 0
62 #endif
63
64 #ifndef PF_UNSPEC
65 # define PF_UNSPEC AF_UNSPEC
66 #endif
67
68 #ifndef PF_INET
69 # define PF_INET AF_INET
70 #endif
71
72 #if defined(HOST_NOT_FOUND) && !defined(h_errno) && !defined(__CYGWIN__)
73 extern int h_errno;
74 #endif
75
76 #endif