Print this page
Clearview IPMP manpages
| Split |
Close |
| Expand all |
| Collapse all |
--- old/./socket.h.txt
+++ new/./socket.h.txt
1 1 Headers socket.h(3HEAD)
2 2
3 3
4 4
5 5 NAME
6 6 socket.h, socket - Internet Protocol family
7 7
8 8 SYNOPSIS
9 9 #include <sys/socket.h>
10 10
11 11
12 12 DESCRIPTION
13 13 The <sys/socket.h> header defines the unsigned integral type
14 14 sa_family_t through typedef.
15 15
16 16
17 17 The <sys/socket.h> header defines the sockaddr structure
18 18 that includes the following members:
19 19
20 20 sa_family_t sa_family /* address family */
21 21 char sa_data[] /* socket address (variable-length
22 22 data) */
23 23
24 24
25 25
26 26 libxnet Interfaces
27 27 The <sys/socket.h> header defines the msghdr structure for
28 28 libxnet interfaces that includes the following members:
29 29
30 30 void *msg_name /* optional address */
31 31 socklen_t msg_namelen /* size of address */
32 32 struct iovec *msg_iov /* scatter/gather array */
33 33 int msg_iovlen /* members in msg_iov */
34 34 void *msg_control /* ancillary data, see below */
35 35 socklen_t msg_controllen /* ancillary data buffer len */
36 36 int msg_flags /* flags on received message */
37 37
38 38
39 39
40 40 The <sys/socket.h> header defines the cmsghdr structure for
41 41 libxnet that includes the following members:
42 42
43 43 socklen_t cmsg_len /* data byte count, including hdr */
44 44 int cmsg_level /* originating protocol */
45 45 int cmsg_type /* protocol-specific type */
46 46
47 47
48 48
49 49 Ancillary data consists of a sequence of pairs, each con-
50 50 sisting of a cmsghdr structure followed by a data array. The
51 51 data array contains the ancillary data message, and the
52 52 cmsghdr structure contains descriptive information that
53 53 allows an application to correctly parse the data.
54 54
55 55
56 56
57 57
58 58
59 59
60 60 SunOS 5.11 Last change: 03 Aug 2006 1
61 61
62 62
63 63
64 64
65 65
66 66
67 67 Headers socket.h(3HEAD)
68 68
69 69
70 70
71 71 The values for cmsg_level will be legal values for the level
72 72 argument to the getsockopt() and setsockopt() functions. The
73 73 SCM_RIGHTS type is supported for level SOL_SOCKET.
74 74
75 75
76 76 Ancillary data is also possible at the socket level. The
77 77 <sys/socket.h> header defines the following macros for use
78 78 as the cmsg_type values when cmsg_level is SOL_SOCKET.
79 79
80 80 SCM_RIGHTS Indicates that the data array contains the
81 81 access rights to be sent or received.
82 82
83 83
84 84 SCM_UCRED Indicates that the data array contains a
|
↓ open down ↓ |
84 lines elided |
↑ open up ↑ |
85 85 ucred_t to be received. The ucred_t is the
86 86 credential of the sending process at the time
87 87 the message was sent. This is a Sun-specific,
88 88 Evolving interface. See ucred_get(3C).
89 89
90 90
91 91
92 92 The IPv4 data formats generally use the same values for data
93 93 passed back in cmsghdr as for setsockopt() to enable the
94 94 feature. The IPv4 data formats are listed below with the
95 - assocated payload for each.
95 + associated payload for each.
96 96
97 97 IPPROTO_IP
98 98 IP_RECVDSTADDR
99 99
100 100 ipaddr_t, IP address
101 101
102 102
103 103 IPPROTO_IP
104 104 IP_RECVOPTS
105 105
106 106 variable-length IP options, up to 40 bytes
107 107
108 108
109 109 IPPROTO_IP
110 110 IP_RECVIF
111 111
112 112 uint_t, ifIndex number
113 113
114 114
115 115 IPPROTO_IP
116 116 IP_RECVSLLA
117 117
118 118 struct sockaddr_dl, link layer address
119 119
120 120
121 121 IPPROTO_IP
122 122 IP_RECVTTL
123 123
124 124
125 125
126 126 SunOS 5.11 Last change: 03 Aug 2006 2
127 127
128 128
129 129
130 130
131 131
132 132
133 133 Headers socket.h(3HEAD)
134 134
135 135
136 136
137 137 uint8_t
138 138
139 139
|
↓ open down ↓ |
34 lines elided |
↑ open up ↑ |
140 140 SOL_SOCKET
141 141 SO_RECVUCRED
142 142
143 143 ucred_t - cmsghdr.cmsg_type is SCM_UCRED, not
144 144 SO_RECVUCRED
145 145
146 146
147 147
148 148 The IPv6 data formats use different values for enabling the
149 149 option and for passing the value back to the application.
150 - The IPv6 data formats are listed below with the assocated
150 + The IPv6 data formats are listed below with the associated
151 151 payload for each.
152 152
153 153 IPPROTO_IPV6
154 154 IPV6_RECVPKTINFO
155 155
156 156 in_pktinfo, cmsg_type IPV6_PKTINFO
157 157
158 158
159 159 IPPROTO_IPV6
160 160 IPV6_RECVTCLASS
161 161
162 162 uint_t, cmsg_type IPV6_TCLASS
163 163
164 164
165 165 IPPROTO_IPV6
166 166 IPV6_RECVPATHMTU
167 167
168 168 ip6_mtuinfo, cmsg_type IPV6_PATHMTU
169 169
170 170
171 171 IPPROTO_IPV6
172 172 IPV6_RECVHOPLIMIT
173 173
174 174 uint_t, cmsg_type IPV6_HOPLIMIT
175 175
176 176
177 177 IPPROTO_IPV6
178 178 IPV6_RECVHOPOPTS
179 179
180 180 variable-length IPv6 options, cmsg_type IPV6_HOPOPTS
181 181
182 182
183 183 IPPROTO_IPV6
184 184 IPV6_RECVDSTOPTS
185 185
186 186 variable-length IPv6 options, cmsg_type IPV6_DSTOPTS
187 187
188 188
189 189
190 190
191 191
192 192 SunOS 5.11 Last change: 03 Aug 2006 3
193 193
194 194
195 195
196 196
197 197
198 198
199 199 Headers socket.h(3HEAD)
200 200
201 201
202 202
203 203 IPPROTO_IPV6
204 204 IPV6_RECVRTHDR
205 205
206 206 variable-length IPv6 options, cmsg_type IPV6_RTHDR
207 207
208 208
209 209 IPPROTO_IPV6
210 210 IPV6_RECVRTHDRDSTOPTS
211 211
212 212 variable-length IPv6 options, cmsg_type IPV6_DSTOPTS
213 213
214 214
215 215
216 216 The <sys/socket.h> header defines the following macros to
217 217 gain access to the data arrays in the ancillary data associ-
218 218 ated with a message header:
219 219
220 220 CMSG_DATA(cmsg)
221 221
222 222 If the argument is a pointer to a cmsghdr structure,
223 223 this macro returns an unsigned character pointer to the
224 224 data array associated with the cmsghdr structure.
225 225
226 226
227 227 CMSG_NXTHDR(mhdr, cmsg)
228 228
229 229 If the first argument is a pointer to a msghdr structure
230 230 and the second argument is a pointer to a cmsghdr struc-
231 231 ture in the ancillary data, pointed to by the
232 232 msg_control field of that msghdr structure, this macro
233 233 returns a pointer to the next cmsghdr structure, or a
234 234 null pointer if this structure is the last cmsghdr in
235 235 the ancillary data.
236 236
237 237
238 238 CMSG_FIRSTHDR(mhdr)
239 239
240 240 If the argument is a pointer to a msghdr structure, this
241 241 macro returns a pointer to the first cmsghdr structure
242 242 in the ancillary data associated with this msghdr struc-
243 243 ture, or a null pointer if there is no ancillary data
244 244 associated with the msghdr structure.
245 245
246 246
247 247 CMSG_SPACE(len)
248 248
249 249 Given the length of an ancillary data object,
250 250 CMSG_SPACE() returns the space required by the object
251 251 and its cmsghdr structure, including any padding needed
252 252 to satisfy alignment requirements. This macro can be
253 253 used, for example, to allocate space dynamically for the
254 254 ancillary data. This macro should not be used to
255 255
256 256
257 257
258 258 SunOS 5.11 Last change: 03 Aug 2006 4
259 259
260 260
261 261
262 262
263 263
264 264
265 265 Headers socket.h(3HEAD)
266 266
267 267
268 268
269 269 initialize the cmsg_len member of a cmsghdr structure.
270 270 Use the CMSG_LEN() macro instead.
271 271
272 272
273 273 CMSG_LEN(len)
274 274
275 275 Given the length of an ancillary data object, CMSG_LEN()
276 276 returns the value to store in the cmsg_len member of the
277 277 cmsghdr structure, taking into account any padding
278 278 needed to satisfy alignment requirements.
279 279
280 280
281 281
282 282 The <sys/socket.h> header defines the linger structure that
283 283 includes the following members:
284 284
285 285 int l_onoff /* indicates whether linger option is enabled */
286 286 int l_linger /* linger time, in seconds */
287 287
288 288
289 289
290 290 The <sys/socket.h> header defines the following macros:
291 291
|
↓ open down ↓ |
131 lines elided |
↑ open up ↑ |
292 292 SOCK_DGRAM Datagram socket
293 293
294 294
295 295 SOCK_STREAM Byte-stream socket
296 296
297 297
298 298 SOCK_SEQPACKET Sequenced-packet socket
299 299
300 300
301 301
302 - The <sys/socket.h> header defines the following macro for
303 - use as the level argument of setsockopt() and getsockopt().
302 + The *<sys/socket.h>* header defines the following macros for
303 + use as the *level* argument of *setsockopt()* and
304 + getsockopt()*.
304 305
305 - SOL_SOCKET Options to be accessed at socket level, not
306 - protocol level.
306 + *SOL_SOCKET* Options to be accessed at the socket level,
307 + not the protocol level.
307 308
309 + *SOL_ROUTE* Options to be accessed at the routing socket
310 + level, not the protocol level.
308 311
309 312
310 313 The <sys/socket.h> header defines the following macros for
311 314 use as the option_name argument in getsockopt() or set-
312 315 sockopt() calls:
313 316
314 317 SO_DEBUG Debugging information is being recorded.
315 318
316 319
317 320 SO_ACCEPTCONN Socket is accepting connections.
318 321
319 322
320 323
321 324
322 325
323 326
324 327 SunOS 5.11 Last change: 03 Aug 2006 5
325 328
326 329
327 330
328 331
329 332
330 333
331 334 Headers socket.h(3HEAD)
332 335
333 336
334 337
335 338 SO_BROADCAST Transmission of broadcast messages is sup-
336 339 ported.
337 340
338 341
339 342 SO_REUSEADDR Reuse of local addresses is supported.
340 343
341 344
342 345 SO_KEEPALIVE Connections are kept alive with periodic
343 346 messages.
344 347
345 348
346 349 SO_LINGER Socket lingers on close.
347 350
348 351
349 352 SO_OOBINLINE Out-of-band data is transmitted in line.
350 353
351 354
352 355 SO_SNDBUF Send buffer size.
353 356
354 357
355 358 SO_RCVBUF Receive buffer size.
356 359
357 360
358 361 SO_ERROR Socket error status.
359 362
360 363
361 364 SO_TYPE Socket type.
362 365
363 366
364 367 SO_RECVUCRED Request the reception of user credential
365 368 ancillary data. This is a Sun-specific,
366 369 Evolving interface. See ucred_get(3C).
367 370
368 371
369 372 SO_MAC_EXEMPT Mandatory Access Control (MAC) exemption
370 373 for unlabeled peers. This option is avail-
371 374 able only if the system is configured with
372 375 Trusted Extensions.
373 376
374 377
375 378 SO_ALLZONES Bypass zone boundaries (privileged).
376 379
377 380
378 381
379 382 The <sys/socket.h> header defines the following macros for
380 383 use as the valid values for the msg_flags field in the
381 384 msghdr structure, or the flags parameter in recvfrom(),
382 385 recvmsg(), sendto(), or sendmsg() calls:
383 386
384 387 MSG_CTRUNC Control data truncated.
385 388
386 389
387 390
388 391
389 392
390 393 SunOS 5.11 Last change: 03 Aug 2006 6
391 394
392 395
393 396
394 397
395 398
396 399
397 400 Headers socket.h(3HEAD)
398 401
399 402
400 403
401 404 MSG_EOR Terminates a record (if supported by the pro-
402 405 tocol).
403 406
404 407
405 408 MSG_OOB Out-of-band data.
406 409
407 410
408 411 MSG_PEEK Leave received data in queue.
409 412
410 413
411 414 MSG_TRUNC Normal data truncated.
412 415
413 416
414 417 MSG_WAITALL Wait for complete message.
415 418
416 419
417 420
418 421 The <sys/socket.h> header defines the following macros:
419 422
420 423 AF_UNIX UNIX domain sockets
421 424
422 425
423 426 AF_INET Internet domain sockets
424 427
425 428
426 429
427 430 The <sys/socket.h> header defines the following macros:
428 431
429 432 SHUT_RD Disables further receive operations.
430 433
431 434
432 435 SHUT_WR Disables further send operations.
433 436
434 437
435 438 SHUT_RDWR Disables further send and receive operations.
436 439
437 440
438 441 libsocket Interfaces
439 442 The <sys/socket.h> header defines the msghdr structure for
440 443 libsocket interfaces that includes the following members:
441 444
442 445 void *msg_name /* optional address */
443 446 socklen_t msg_namelen /* size of address */
444 447 struct iovec *msg_iov /* scatter/gather array */
445 448 int msg_iovlen /* # elements in msg_iov */
446 449 caddr_t msg_accrights /* access rights sent/received */
447 450
448 451
449 452
450 453 The msg_name and msg_namelen parameters specify the destina-
451 454 tion address when the socket is unconnected The msg_name can
452 455 be specified as a NULL pointer if no names are desired or
453 456
454 457
455 458
456 459 SunOS 5.11 Last change: 03 Aug 2006 7
457 460
458 461
459 462
460 463
461 464
462 465
463 466 Headers socket.h(3HEAD)
464 467
465 468
466 469
467 470 required. The msg_iov and msg_iovlen parameters describe
468 471 the scatter-gather locations, as described in read(2). The
469 472 msg_accrights parameter specifies the buffer in which access
470 473 rights sent along with the message are received. The
471 474 msg_accrightslen specifies the length of the buffer.
472 475
473 476 ATTRIBUTES
474 477 See attributes(5) for descriptions of the following attri-
475 478 butes:
476 479
477 480
478 481
479 482 ____________________________________________________________
480 483 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
481 484 |_____________________________|_____________________________|
482 485 | Interface Stability | Standard |
483 486 |_____________________________|_____________________________|
484 487
485 488
486 489 SEE ALSO
487 490 accept(3SOCKET), accept(3XNET), bind(3SOCKET), bind(3XNET),
488 491 connect(3SOCKET), connect(3XNET), getpeername(3SOCKET),
489 492 getpeername(3XNET), getpeerucred(3C), getsockname(3SOCKET),
490 493 getsockname(3XNET), getsockopt(3SOCKET), getsockopt(3XNET),
491 494 libsocket(3LIB), listen(3SOCKET), listen(3XNET),
492 495 recv(3SOCKET), recv(3XNET), recvfrom(3SOCKET),
493 496 recvfrom(3XNET), recvmsg(3SOCKET), recvmsg(3XNET),
494 497 send(3SOCKET), send(3XNET), sendmsg(3SOCKET),
495 498 sendmsg(3XNET), sendto(3SOCKET), sendto(3XNET),
496 499 setsockopt(3SOCKET), setsockopt(3XNET), shutdown(3SOCKET),
497 500 shutdown(3XNET), socket(3SOCKET), socket(3XNET),
498 501 socketpair(3SOCKET) socketpair(3XNET),
499 502 ucred_get(3C)attributes(5), standards(5)
500 503
501 504
502 505
503 506
504 507
505 508
506 509
507 510
508 511
509 512
510 513
511 514
512 515
513 516
514 517
515 518
516 519
517 520
518 521
519 522
520 523
521 524
522 525 SunOS 5.11 Last change: 03 Aug 2006 8
523 526
524 527
525 528
|
↓ open down ↓ |
208 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX