8 socklen_t msg_controllen;
40 #define SOCK_SEQPACKET 5
41 #define SOCK_PACKET 10
45 #define AF_UNIX AF_LOCAL
46 #define AF_FILE AF_LOCAL
50 #define AF_APPLETALK 5
59 #define AF_SECURITY 14
62 #define AF_ROUTE AF_NETLINK
71 #define AF_BLUETOOTH 31
75 #define PF_UNIX PF_LOCAL
76 #define PF_FILE PF_LOCAL
80 #define PF_APPLETALK 5
89 #define PF_SECURITY 14
92 #define PF_ROUTE PF_NETLINK
100 #define PF_WANPIPE 25
101 #define PF_BLUETOOTH 31
104 #define SO_REUSEADDR 2
107 #define SO_DONTROUTE 5
108 #define SO_BROADCAST 6
111 #define SO_KEEPALIVE 9
112 #define SO_OOBINLINE 10
113 #define SO_NO_CHECK 11
114 #define SO_PRIORITY 12
116 #define SO_BSDCOMPAT 14
117 #define SO_REUSEPORT 15
118 #define SO_PASSCRED 16
119 #define SO_PEERCRED 17
120 #define SO_RCVLOWAT 18
121 #define SO_SNDLOWAT 19
122 #define SO_RCVTIMEO 20
123 #define SO_SNDTIMEO 21
125 #define SO_SECURITY_AUTHENTICATION 22
126 #define SO_SECURITY_ENCRYPTION_TRANSPORT 23
127 #define SO_SECURITY_ENCRYPTION_NETWORK 24
129 #define SO_BINDTODEVICE 25
131 #define SO_ATTACH_FILTER 26
132 #define SO_DETACH_FILTER 27
134 #define SO_PEERNAME 28
135 #define SO_TIMESTAMP 29
136 #define SCM_TIMESTAMP SO_TIMESTAMP
138 #define SO_ACCEPTCONN 30
144 #define SOL_DECNET 261
146 #define SOL_PACKET 263
151 #define SOMAXCONN 128
153 #define MSG_OOB 0x0001
154 #define MSG_PEEK 0x0002
155 #define MSG_DONTROUTE 0x0004
156 #define MSG_CTRUNC 0x0008
157 #define MSG_PROXY 0x0010
158 #define MSG_TRUNC 0x0020
159 #define MSG_DONTWAIT 0x0040
160 #define MSG_EOR 0x0080
161 #define MSG_WAITALL 0x0100
162 #define MSG_FIN 0x0200
163 #define MSD_SYN 0x0400
164 #define MSG_CONFIRM 0x0800
165 #define MSG_RST 0x1000
166 #define MSG_ERRQUEUE 0x2000
167 #define MSG_NOSIGNAL 0x4000
168 #define MSG_MORE 0x8000
170 /* Internal use only!! to make CMSG_NXTHDR definition readable by mortals */
171 #define __CMSG_LEN(cmsg) (((cmsg)->cmsg_len + sizeof(long) - 1) & ~(long)(sizeof(long) - 1))
172 #define __CMSG_NEXT(cmsg) ((unsigned char *)(cmsg) + __CMSG_LEN(cmsg))
173 #define __MHDR_END(mhdr) ((unsigned char *)(mhdr)->msg_control + (mhdr)->msg_controllen)
175 #define CMSG_DATA(cmsg) ((unsigned char *) (((struct cmsghdr *)(cmsg)) + 1))
176 #define CMSG_NXTHDR(mhdr, cmsg) ((cmsg)->cmsg_len < sizeof (struct cmsghdr) ? (struct cmsghdr *)0 : \
177 (__CMSG_NEXT(cmsg) + sizeof (struct cmsghdr) >= __MHDR_END(mhdr) ? (struct cmsghdr *)0 : \
178 ((struct cmsghdr *)__CMSG_NEXT(cmsg))))
179 #define CMSG_FIRSTHDR(mhdr) ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
181 /* Are these valid? */
182 #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1))
183 #define CMSG_SPACE(len) (CMSG_ALIGN (len) + CMSG_ALIGN (sizeof (struct cmsghdr)))
184 #define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
186 #define SCM_RIGHTS 0x01
187 #define SCM_CREDENTIALS 0x02