10 socklen_t msg_controllen;
42 #define SOCK_SEQPACKET 5
44 #define SOCK_PACKET 10
46 /* linux extensions */
47 #define SOCK_CLOEXEC 02000000
48 #define SOCK_NONBLOCK 04000
52 #define PF_UNIX PF_LOCAL
53 #define PF_FILE PF_LOCAL
57 #define PF_APPLETALK 5
66 #define PF_SECURITY 14
69 #define PF_ROUTE PF_NETLINK
78 #define PF_BLUETOOTH 31
83 #define PF_IEEE802154 36
88 #define AF_UNSPEC PF_UNSPEC
89 #define AF_LOCAL PF_LOCAL
90 #define AF_UNIX AF_LOCAL
91 #define AF_FILE AF_LOCAL
92 #define AF_INET PF_INET
93 #define AF_AX25 PF_AX25
95 #define AF_APPLETALK PF_APPLETALK
96 #define AF_NETROM PF_NETROM
97 #define AF_BRIDGE PF_BRIDGE
98 #define AF_ATMPVC PF_ATMPVC
100 #define AF_INET6 PF_INET6
101 #define AF_ROSE PF_ROSE
102 #define AF_DECnet PF_DECnet
103 #define AF_NETBEUI PF_NETBEUI
104 #define AF_SECURITY PF_SECURITY
105 #define AF_KEY PF_KEY
106 #define AF_NETLINK PF_NETLINK
107 #define AF_ROUTE AF_NETLINK
108 #define AF_PACKET PF_PACKET
109 #define AF_ASH PF_ASH
110 #define AF_ECONET PF_ECONET
111 #define AF_ATMSVC PF_ATMSVC
112 #define AF_SNA PF_SNA
113 #define AF_IRDA PF_IRDA
114 #define AF_PPPOX PF_PPPOX
115 #define AF_WANPIPE PF_WANPIPE
116 #define AF_BLUETOOTH PF_BLUETOOTH
117 #define AF_IUCV PF_IUCV
118 #define AF_RXRPC PF_RXRPC
119 #define AF_ISDN PF_ISDN
120 #define AF_PHONET PF_PHONET
121 #define AF_IEEE802154 PF_IEEE802154
122 #define AF_CAIF PF_CAIF
123 #define AF_ALG PF_ALG
124 #define AF_MAX PF_MAX
127 #define SO_REUSEADDR 2
130 #define SO_DONTROUTE 5
131 #define SO_BROADCAST 6
134 #define SO_KEEPALIVE 9
135 #define SO_OOBINLINE 10
136 #define SO_NO_CHECK 11
137 #define SO_PRIORITY 12
139 #define SO_BSDCOMPAT 14
140 #define SO_REUSEPORT 15
141 #define SO_PASSCRED 16
142 #define SO_PEERCRED 17
143 #define SO_RCVLOWAT 18
144 #define SO_SNDLOWAT 19
145 #define SO_RCVTIMEO 20
146 #define SO_SNDTIMEO 21
148 #define SO_SECURITY_AUTHENTICATION 22
149 #define SO_SECURITY_ENCRYPTION_TRANSPORT 23
150 #define SO_SECURITY_ENCRYPTION_NETWORK 24
152 #define SO_BINDTODEVICE 25
154 #define SO_ATTACH_FILTER 26
155 #define SO_DETACH_FILTER 27
157 #define SO_PEERNAME 28
158 #define SO_TIMESTAMP 29
159 #define SCM_TIMESTAMP SO_TIMESTAMP
161 #define SO_ACCEPTCONN 30
167 #define SOL_DECNET 261
169 #define SOL_PACKET 263
174 #define SOMAXCONN 128
176 #define MSG_OOB 0x0001
177 #define MSG_PEEK 0x0002
178 #define MSG_DONTROUTE 0x0004
179 #define MSG_CTRUNC 0x0008
180 #define MSG_PROXY 0x0010
181 #define MSG_TRUNC 0x0020
182 #define MSG_DONTWAIT 0x0040
183 #define MSG_EOR 0x0080
184 #define MSG_WAITALL 0x0100
185 #define MSG_FIN 0x0200
186 #define MSD_SYN 0x0400
187 #define MSG_CONFIRM 0x0800
188 #define MSG_RST 0x1000
189 #define MSG_ERRQUEUE 0x2000
190 #define MSG_NOSIGNAL 0x4000
191 #define MSG_MORE 0x8000
192 #define MSG_WAITFORONE 0x10000
193 #define MSG_CMSG_CLOEXEC 0x40000000
195 /* Internal use only!! to make CMSG_NXTHDR definition readable by mortals */
196 #define __CMSG_LEN(cmsg) (((cmsg)->cmsg_len + sizeof(long) - 1) & ~(long)(sizeof(long) - 1))
197 #define __CMSG_NEXT(cmsg) ((unsigned char *)(cmsg) + __CMSG_LEN(cmsg))
198 #define __MHDR_END(mhdr) ((unsigned char *)(mhdr)->msg_control + (mhdr)->msg_controllen)
200 #define CMSG_DATA(cmsg) ((unsigned char *) (((struct cmsghdr *)(cmsg)) + 1))
201 #define CMSG_NXTHDR(mhdr, cmsg) ((cmsg)->cmsg_len < sizeof (struct cmsghdr) ? (struct cmsghdr *)0 : \
202 (__CMSG_NEXT(cmsg) + sizeof (struct cmsghdr) >= __MHDR_END(mhdr) ? (struct cmsghdr *)0 : \
203 ((struct cmsghdr *)__CMSG_NEXT(cmsg))))
204 #define CMSG_FIRSTHDR(mhdr) ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) 0)
206 /* Are these valid? */
207 #define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) & (size_t) ~(sizeof (size_t) - 1))
208 #define CMSG_SPACE(len) (CMSG_ALIGN (len) + CMSG_ALIGN (sizeof (struct cmsghdr)))
209 #define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
211 #define SCM_RIGHTS 0x01
212 #define SCM_CREDENTIALS 0x02