Mon Aug 13 06:00:21 2018 UTC ()
Various improvements.
More markup, sort errors, fix -1.


(wiz)
diff -r1.1 -r1.2 src/lib/libc/net/sctp_bindx.3
diff -r1.1 -r1.2 src/lib/libc/net/sctp_connectx.3
diff -r1.1 -r1.2 src/lib/libc/net/sctp_freepaddrs.3
diff -r1.1 -r1.2 src/lib/libc/net/sctp_getaddrlen.3
diff -r1.1 -r1.2 src/lib/libc/net/sctp_getassocid.3
diff -r1.1 -r1.2 src/lib/libc/net/sctp_getpaddrs.3
diff -r1.1 -r1.2 src/lib/libc/net/sctp_opt_info.3
diff -r1.1 -r1.2 src/lib/libc/net/sctp_peeloff.3
diff -r1.1 -r1.2 src/lib/libc/net/sctp_recvmsg.3
diff -r1.1 -r1.2 src/lib/libc/net/sctp_send.3
diff -r1.1 -r1.2 src/lib/libc/net/sctp_sendmsg.3

cvs diff -r1.1 -r1.2 src/lib/libc/net/sctp_bindx.3 (expand / switch to unified diff)

--- src/lib/libc/net/sctp_bindx.3 2018/08/02 08:40:48 1.1
+++ src/lib/libc/net/sctp_bindx.3 2018/08/13 06:00:21 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: sctp_bindx.3,v 1.1 2018/08/02 08:40:48 rjs Exp $ 1.\" $NetBSD: sctp_bindx.3,v 1.2 2018/08/13 06:00:21 wiz Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE. 28.\" SUCH DAMAGE.
29.\" 29.\"
30.\" From: @(#)send.2 8.2 (Berkeley) 2/21/94 30.\" From: @(#)send.2 8.2 (Berkeley) 2/21/94
31.\" 31.\"
32.Dd August 1, 2018 32.Dd August 1, 2018
33.Dt SCTP_BINDX 3 33.Dt SCTP_BINDX 3
34.Os 34.Os
35.Sh NAME 35.Sh NAME
36.Nm sctp_bindx 36.Nm sctp_bindx
37.Nd bind or unbind an SCTP socket to a list of addresses. 37.Nd bind or unbind an SCTP socket to a list of addresses
38.Sh LIBRARY 38.Sh LIBRARY
39.Lb libc 39.Lb libc
40.Sh SYNOPSIS 40.Sh SYNOPSIS
41.In sys/types.h 41.In sys/types.h
42.In sys/socket.h 42.In sys/socket.h
43.In netinet/sctp.h 43.In netinet/sctp.h
44.Ft int 44.Ft int
45.Fn sctp_bindx "int s" "struct sockaddr *addrs" "int num" "int type" 45.Fn sctp_bindx "int s" "struct sockaddr *addrs" "int num" "int type"
46.Sh DESCRIPTION 46.Sh DESCRIPTION
47The 47The
48.Fn sctp_bindx 48.Fn sctp_bindx
49call binds or unbinds a address or a list of addresses to an 49call binds or unbinds a address or a list of addresses to an
50SCTP endpoint. 50SCTP endpoint.
@@ -73,48 +73,48 @@ This value indicates that the listed add @@ -73,48 +73,48 @@ This value indicates that the listed add
73be added to the endpoint. 73be added to the endpoint.
74.Pp 74.Pp
75.Dv SCTP_BINDX_DEL_ADDR 75.Dv SCTP_BINDX_DEL_ADDR
76This value indicates that the listed address(es) need to 76This value indicates that the listed address(es) need to
77be removed from the endpoint. 77be removed from the endpoint.
78.Pp 78.Pp
79Note that when a user adds or deletes an address to an 79Note that when a user adds or deletes an address to an
80association if the dynamic address flag 80association if the dynamic address flag
81.Va net.inet.sctp.auto_asconf 81.Va net.inet.sctp.auto_asconf
82is enabled any associations in the endpoint will attempt to 82is enabled any associations in the endpoint will attempt to
83have the address(es) added dynamically to the existing 83have the address(es) added dynamically to the existing
84association. 84association.
85.Sh RETURN VALUES 85.Sh RETURN VALUES
86The call returns 0 on success and -1 upon failure. 86The call returns 0 on success and \-1 upon failure.
87.Sh ERRORS 87.Sh ERRORS
88The 88The
89.Fn sctp_bindx 89.Fn sctp_bindx
90function can return the following errors: 90function can return the following errors:
91.Bl -tag -width Er 91.Bl -tag -width Er
 92.It Bq Er EBADF
 93The argument
 94.Fa s
 95is not a valid descriptor.
92.It Bq Er EINVAL 96.It Bq Er EINVAL
93This value is returned if the 97This value is returned if the
94.Fa type 98.Fa type
95field is not one of the allowed values (see above). 99field is not one of the allowed values (see above).
96.It Bq Er ENOMEM 100.It Bq Er ENOMEM
97This value is returned if the number of addresses 101This value is returned if the number of addresses
98being added causes a memory allocation failure in 102being added causes a memory allocation failure in
99the call. 103the call.
100.It Bq Er EBADF 
101The argument 
102.Fa s 
103is not a valid descriptor. 
104.It Bq Er ENOTSOCK 104.It Bq Er ENOTSOCK
105The argument 105The argument
106.Fa s 106.Fa s
107is not a socket. 107is not a socket.
108.El 108.El
109.Sh SEE ALSO 109.Sh SEE ALSO
110.Xr bind 2 , 110.Xr bind 2 ,
111.Xr sctp 4 111.Xr sctp 4
112.Rs 112.Rs
113.%R RFC 113.%R RFC
114.%N 6458 114.%N 6458
115.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)" 115.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)"
116.%D December 2011 116.%D December 2011
117.Re  117.Re
118.Sh HISTORY 118.Sh HISTORY
119This function first appeared in 119This function first appeared in
120.Nx 9.0 . 120.Nx 9.0 .

cvs diff -r1.1 -r1.2 src/lib/libc/net/sctp_connectx.3 (expand / switch to unified diff)

--- src/lib/libc/net/sctp_connectx.3 2018/08/02 08:40:48 1.1
+++ src/lib/libc/net/sctp_connectx.3 2018/08/13 06:00:21 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: sctp_connectx.3,v 1.1 2018/08/02 08:40:48 rjs Exp $ 1.\" $NetBSD: sctp_connectx.3,v 1.2 2018/08/13 06:00:21 wiz Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
@@ -66,46 +66,46 @@ a random nonce. @@ -66,46 +66,46 @@ a random nonce.
66.Pp 66.Pp
67If the peer SCTP stack does not list one or more of 67If the peer SCTP stack does not list one or more of
68the provided addresses in its response message then 68the provided addresses in its response message then
69the extra addresses sent in the 69the extra addresses sent in the
70.Fn sctp_connectx 70.Fn sctp_connectx
71call will be silently discarded from the association. 71call will be silently discarded from the association.
72On 72On
73successful completion the provided 73successful completion the provided
74.Fa id 74.Fa id
75will be 75will be
76filled in with the association identification of the newly 76filled in with the association identification of the newly
77forming association. 77forming association.
78.Sh RETURN VALUES 78.Sh RETURN VALUES
79The call returns 0 on success and -1 upon failure. 79The call returns 0 on success and \-1 upon failure.
80.Sh ERRORS 80.Sh ERRORS
81The 81The
82.Fn sctp_connectx 82.Fn sctp_connectx
83function can return the following errors: 83function can return the following errors:
84.Bl -tag -width Er 84.Bl -tag -width Er
85.It Bq Er EINVAL 
86An address listed has an invalid family or no 
87addresses were provided. 
88.It Bq Er E2BIG 85.It Bq Er E2BIG
89The size of the address list exceeds the amount of 86The size of the address list exceeds the amount of
90data provided. 87data provided.
91.It Bq Er EBADF 88.It Bq Er EBADF
92The argument 89The argument
93.Fa s 90.Fa s
94is not a valid descriptor. 91is not a valid descriptor.
 92.It Bq Er EINVAL
 93An address listed has an invalid family or no
 94addresses were provided.
95.It Bq Er ENOTSOCK 95.It Bq Er ENOTSOCK
96The argument 96The argument
97.Fa s 97.Fa s
98is not a socket. 98is not a socket.
99.El 99.El
100.Sh SEE ALSO 100.Sh SEE ALSO
101.Xr connect 2 , 101.Xr connect 2 ,
102.Xr sctp 4 102.Xr sctp 4
103.Rs 103.Rs
104.%R RFC 104.%R RFC
105.%N 6458 105.%N 6458
106.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)" 106.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)"
107.%D December 2011 107.%D December 2011
108.Re  108.Re
109.Sh HISTORY 109.Sh HISTORY
110This function first appeared in 110This function first appeared in
111.Nx 9.0 . 111.Nx 9.0 .

cvs diff -r1.1 -r1.2 src/lib/libc/net/sctp_freepaddrs.3 (expand / switch to unified diff)

--- src/lib/libc/net/sctp_freepaddrs.3 2018/08/02 08:40:48 1.1
+++ src/lib/libc/net/sctp_freepaddrs.3 2018/08/13 06:00:21 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: sctp_freepaddrs.3,v 1.1 2018/08/02 08:40:48 rjs Exp $ 1.\" $NetBSD: sctp_freepaddrs.3,v 1.2 2018/08/13 06:00:21 wiz Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
@@ -43,33 +43,32 @@ @@ -43,33 +43,32 @@
43.In sys/socket.h 43.In sys/socket.h
44.In netinet/sctp.h 44.In netinet/sctp.h
45.Ft void 45.Ft void
46.Fn sctp_freepaddrs "struct sockaddr *" 46.Fn sctp_freepaddrs "struct sockaddr *"
47.Ft void 47.Ft void
48.Fn sctp_freeladdrs "struct sockaddr *" 48.Fn sctp_freeladdrs "struct sockaddr *"
49.Sh DESCRIPTION 49.Sh DESCRIPTION
50The 50The
51.Fn sctp_freepaddrs 51.Fn sctp_freepaddrs
52and 52and
53.Fn sctp_freeladdrs 53.Fn sctp_freeladdrs
54functions are used to release the memory allocated by previous 54functions are used to release the memory allocated by previous
55calls to 55calls to
56.Fn sctp_getpaddrs 56.Xr sctp_getpaddrs 3
57or 57or
58.Fn sctp_getladdrs 58.Xr sctp_getladdrs 3
59respectively. 59respectively.
60.Sh RETURN VALUES 60.Sh RETURN VALUES
61none. 61none.
62.Sh SEE ALSO 62.Sh SEE ALSO
63.Xr sctp_getladdrs 3 , 63.Xr sctp_getladdrs 3 ,
64.Xr sctp_getpaddrs 3 , 64.Xr sctp_getpaddrs 3 ,
65.Xr sctp 4 65.Xr sctp 4
66.Rs 66.Rs
67.%R RFC 67.%R RFC
68.%N 6458 68.%N 6458
69.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)" 69.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)"
70.%D December 2011 70.%D December 2011
71.Re  71.Re
72.Sh HISTORY 72.Sh HISTORY
73These functions first appeared in 73These functions first appeared in
74.Nx 9.0 . 74.Nx 9.0 .
75 

cvs diff -r1.1 -r1.2 src/lib/libc/net/sctp_getaddrlen.3 (expand / switch to unified diff)

--- src/lib/libc/net/sctp_getaddrlen.3 2018/08/02 08:40:48 1.1
+++ src/lib/libc/net/sctp_getaddrlen.3 2018/08/13 06:00:21 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: sctp_getaddrlen.3,v 1.1 2018/08/02 08:40:48 rjs Exp $ 1.\" $NetBSD: sctp_getaddrlen.3,v 1.2 2018/08/13 06:00:21 wiz Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
@@ -59,35 +59,35 @@ system calls. @@ -59,35 +59,35 @@ system calls.
59If for some reason a SCTP socket cannot 59If for some reason a SCTP socket cannot
60be created or the 60be created or the
61.Fn getsockopt 61.Fn getsockopt
62call fails, an error will be returned 62call fails, an error will be returned
63with 63with
64.Va errno 64.Va errno
65set as specified in the 65set as specified in the
66.Fn socket 66.Fn socket
67or 67or
68.Fn getsockopt 68.Fn getsockopt
69system call. 69system call.
70.Sh RETURN VALUES 70.Sh RETURN VALUES
71The call returns the number of bytes that the operating 71The call returns the number of bytes that the operating
72system expects for the specific address family or -1. 72system expects for the specific address family or \-1.
73.Sh ERRORS 73.Sh ERRORS
74The 74The
75.Fn sctp_getaddrlen 75.Fn sctp_getaddrlen
76function can return the following errors: 76function can return the following errors:
77.Bl -tag -width Er 77.Bl -tag -width Er
78.It Bq Er EINVAL 78.It Bq Er EINVAL
79The address family specified does NOT exist. 79The address family specified does NOT exist.
80.El 80.El
81.Sh SEE ALSO 81.Sh SEE ALSO
82.Xr getsockopt 2 , 82.Xr getsockopt 2 ,
83.Xr socket 2 , 83.Xr socket 2 ,
84.Xr sctp 4 84.Xr sctp 4
85.Rs 85.Rs
86.%R RFC 86.%R RFC
87.%N 6458 87.%N 6458
88.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)" 88.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)"
89.%D December 2011 89.%D December 2011
90.Re  90.Re
91.Sh HISTORY 91.Sh HISTORY
92This function first appeared in 92This function first appeared in
93.Nx 9.0 . 93.Nx 9.0 .

cvs diff -r1.1 -r1.2 src/lib/libc/net/sctp_getassocid.3 (expand / switch to unified diff)

--- src/lib/libc/net/sctp_getassocid.3 2018/08/02 08:40:48 1.1
+++ src/lib/libc/net/sctp_getassocid.3 2018/08/13 06:00:21 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: sctp_getassocid.3,v 1.1 2018/08/02 08:40:48 rjs Exp $ 1.\" $NetBSD: sctp_getassocid.3,v 1.2 2018/08/13 06:00:21 wiz Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
@@ -22,58 +22,58 @@ @@ -22,58 +22,58 @@
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE. 28.\" SUCH DAMAGE.
29.\" 29.\"
30.Dd August 1, 2018 30.Dd August 1, 2018
31.Dt SCTP_GETASSOCID 3 31.Dt SCTP_GETASSOCID 3
32.Os 32.Os
33.Sh NAME 33.Sh NAME
34.Nm sctp_getassocid 34.Nm sctp_getassocid
35.Nd return an association id for a specified socket address. 35.Nd return an association id for a specified socket address
36.Sh LIBRARY 36.Sh LIBRARY
37.Lb libc 37.Lb libc
38.Sh SYNOPSIS 38.Sh SYNOPSIS
39.In sys/types.h 39.In sys/types.h
40.In sys/socket.h 40.In sys/socket.h
41.In netinet/sctp.h 41.In netinet/sctp.h
42.Ft sctp_assoc_t 42.Ft sctp_assoc_t
43.Fn sctp_getassocid "int s" "struct sockaddr *addr" 43.Fn sctp_getassocid "int s" "struct sockaddr *addr"
44.Sh DESCRIPTION 44.Sh DESCRIPTION
45The 45The
46.Fn sctp_getassocid 46.Fn sctp_getassocid
47call attempts to look up the specified socket address 47call attempts to look up the specified socket address
48.Fa addr 48.Fa addr
49and find the respective association identification. 49and find the respective association identification.
50.Sh RETURN VALUES 50.Sh RETURN VALUES
51The call returns the association id upon success and 51The call returns the association id upon success and
520 is returned upon failure. 520 is returned upon failure.
53.Sh ERRORS 53.Sh ERRORS
54The 54The
55.Fn sctp_getassocid 55.Fn sctp_getassocid
56function can return the following errors: 56function can return the following errors:
57.Bl -tag -width Er 57.Bl -tag -width Er
58.It Bq Er ENOENT 
59The address does not have an association setup to it. 
60.It Bq Er EBADF 58.It Bq Er EBADF
61The argument 59The argument
62.Fa s 60.Fa s
63is not a valid descriptor. 61is not a valid descriptor.
 62.It Bq Er ENOENT
 63The address does not have an association setup to it.
64.It Bq Er ENOTSOCK 64.It Bq Er ENOTSOCK
65The argument 65The argument
66.Fa s 66.Fa s
67is not a socket. 67is not a socket.
68.El 68.El
69.Sh SEE ALSO 69.Sh SEE ALSO
70.Xr sctp 4 70.Xr sctp 4
71.Rs 71.Rs
72.%R RFC 72.%R RFC
73.%N 6458 73.%N 6458
74.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)" 74.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)"
75.%D December 2011 75.%D December 2011
76.Re  76.Re
77.Sh HISTORY 77.Sh HISTORY
78This function first appeared in 78This function first appeared in
79.Nx 9.0 . 79.Nx 9.0 .

cvs diff -r1.1 -r1.2 src/lib/libc/net/sctp_getpaddrs.3 (expand / switch to unified diff)

--- src/lib/libc/net/sctp_getpaddrs.3 2018/08/02 08:40:48 1.1
+++ src/lib/libc/net/sctp_getpaddrs.3 2018/08/13 06:00:21 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: sctp_getpaddrs.3,v 1.1 2018/08/02 08:40:48 rjs Exp $ 1.\" $NetBSD: sctp_getpaddrs.3,v 1.2 2018/08/13 06:00:21 wiz Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
@@ -52,55 +52,55 @@ The @@ -52,55 +52,55 @@ The
52function is used to get the list of the peers addresses. 52function is used to get the list of the peers addresses.
53The 53The
54.Fn sctp_getladdrs 54.Fn sctp_getladdrs
55function is used to get the list of the local addresses. 55function is used to get the list of the local addresses.
56The association of interest is identified by the 56The association of interest is identified by the
57.Fa asocid 57.Fa asocid
58argument. 58argument.
59The addresses are returned in a newly allocated 59The addresses are returned in a newly allocated
60array of socket addresses returned in the argument 60array of socket addresses returned in the argument
61.Fa addrs 61.Fa addrs
62upon success. 62upon success.
63.Pp 63.Pp
64After the caller is finished, the function 64After the caller is finished, the function
65.Fn sctp_freepaddrs 65.Xr sctp_freepaddrs 3
66or 66or
67.Fn sctp_freeladdrs 67.Xr sctp_freeladdrs 3
68should be used to release the memory allocated by these 68should be used to release the memory allocated by these
69calls. 69calls.
70.Sh RETURN VALUES 70.Sh RETURN VALUES
71The call returns -1 upon failure and a count of 71The call returns \-1 upon failure and a count of
72the number of addresses returned in 72the number of addresses returned in
73.Fa addrs 73.Fa addrs
74upon success. 74upon success.
75.Sh ERRORS 75.Sh ERRORS
76The functions can return the following errors: 76The functions can return the following errors:
77.Bl -tag -width Er 77.Bl -tag -width Er
 78.It Bq Er EBADF
 79The argument
 80.Fa s
 81is not a valid descriptor.
78.It Bq Er EINVAL 82.It Bq Er EINVAL
79An address listed has an invalid family or no 83An address listed has an invalid family or no
80addresses were provided. 84addresses were provided.
81.It Bq Er ENOMEM 85.It Bq Er ENOMEM
82The call cannot allocate memory to hold the 86The call cannot allocate memory to hold the
83socket addresses. 87socket addresses.
84.It Bq Er EBADF 
85The argument 
86.Fa s 
87is not a valid descriptor. 
88.It Bq Er ENOTSOCK 88.It Bq Er ENOTSOCK
89The argument 89The argument
90.Fa s 90.Fa s
91is not a socket. 91is not a socket.
92.El 92.El
93.Sh SEE ALSO 93.Sh SEE ALSO
94.Xr getsockopt 2 , 94.Xr getsockopt 2 ,
95.Xr sctp_freeladdrs 3 , 95.Xr sctp_freeladdrs 3 ,
96.Xr sctp_freepaddrs 3 , 96.Xr sctp_freepaddrs 3 ,
97.Xr sctp 4 97.Xr sctp 4
98.Rs 98.Rs
99.%R RFC 99.%R RFC
100.%N 6458 100.%N 6458
101.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)" 101.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)"
102.%D December 2011 102.%D December 2011
103.Re  103.Re
104.Sh HISTORY 104.Sh HISTORY
105These functions first appeared in 105These functions first appeared in
106.Nx 9.0 . 106.Nx 9.0 .

cvs diff -r1.1 -r1.2 src/lib/libc/net/sctp_opt_info.3 (expand / switch to unified diff)

--- src/lib/libc/net/sctp_opt_info.3 2018/08/02 08:40:48 1.1
+++ src/lib/libc/net/sctp_opt_info.3 2018/08/13 06:00:21 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: sctp_opt_info.3,v 1.1 2018/08/02 08:40:48 rjs Exp $ 1.\" $NetBSD: sctp_opt_info.3,v 1.2 2018/08/13 06:00:21 wiz Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
@@ -80,50 +80,50 @@ socket options. @@ -80,50 +80,50 @@ socket options.
80.Pp 80.Pp
81.Dv SCTP_DEFAULT_SNDINFO 81.Dv SCTP_DEFAULT_SNDINFO
82.Pp 82.Pp
83.Dv SCTP_DEFAULT_PRINFO 83.Dv SCTP_DEFAULT_PRINFO
84.Pp 84.Pp
85.Dv SCTP_STATUS 85.Dv SCTP_STATUS
86.Pp 86.Pp
87.Dv SCTP_GET_PEER_ADDR_INFO 87.Dv SCTP_GET_PEER_ADDR_INFO
88.Pp 88.Pp
89.Dv SCTP_PEER_AUTH_CHUNKS 89.Dv SCTP_PEER_AUTH_CHUNKS
90.Pp 90.Pp
91.Dv SCTP_LOCAL_AUTH_CHUNKS 91.Dv SCTP_LOCAL_AUTH_CHUNKS
92.Sh RETURN VALUES 92.Sh RETURN VALUES
93The call returns 0 on success and -1 upon error. 93The call returns 0 on success and \-1 upon error.
94.Sh ERRORS 94.Sh ERRORS
95The 95The
96.Fn sctp_opt_info 96.Fn sctp_opt_info
97function can return the following errors: 97function can return the following errors:
98.Bl -tag -width Er 98.Bl -tag -width Er
 99.It Bq Er EBADF
 100The argument
 101.Fa s
 102is not a valid descriptor.
99.It Bq Er EINVAL 103.It Bq Er EINVAL
100The argument 104The argument
101.Fa arg 105.Fa arg
102value was invalid. 106value was invalid.
 107.It Bq Er ENOTSOCK
 108The argument
 109.Fa s
 110is not a socket.
103.It Bq Er EOPNOTSUPP 111.It Bq Er EOPNOTSUPP
104The argument 112The argument
105.Fa opt 113.Fa opt
106was not one of the above listed SCTP socket 114was not one of the above listed SCTP socket
107options. 115options.
108.It Bq Er EBADF 
109The argument 
110.Fa s 
111is not a valid descriptor. 
112.It Bq Er ENOTSOCK 
113The argument 
114.Fa s 
115is not a socket. 
116.El 116.El
117.Sh SEE ALSO 117.Sh SEE ALSO
118.Xr getsockopt 2 , 118.Xr getsockopt 2 ,
119.Xr getsockopt2 2, 119.Xr getsockopt2 2 ,
120.Xr sctp 4 120.Xr sctp 4
121.Rs 121.Rs
122.%R RFC 122.%R RFC
123.%N 6458 123.%N 6458
124.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)" 124.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)"
125.%D December 2011 125.%D December 2011
126.Re  126.Re
127.Sh HISTORY 127.Sh HISTORY
128This function first appeared in 128This function first appeared in
129.Nx 9.0 . 129.Nx 9.0 .

cvs diff -r1.1 -r1.2 src/lib/libc/net/sctp_peeloff.3 (expand / switch to unified diff)

--- src/lib/libc/net/sctp_peeloff.3 2018/08/02 08:40:48 1.1
+++ src/lib/libc/net/sctp_peeloff.3 2018/08/13 06:00:21 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: sctp_peeloff.3,v 1.1 2018/08/02 08:40:48 rjs Exp $ 1.\" $NetBSD: sctp_peeloff.3,v 1.2 2018/08/13 06:00:21 wiz Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
@@ -38,48 +38,48 @@ @@ -38,48 +38,48 @@
38.Sh SYNOPSIS 38.Sh SYNOPSIS
39.In sys/types.h 39.In sys/types.h
40.In sys/socket.h 40.In sys/socket.h
41.In netinet/sctp.h 41.In netinet/sctp.h
42.Ft int 42.Ft int
43.Fn sctp_peeloff "int s" "sctp_assoc_t id" 43.Fn sctp_peeloff "int s" "sctp_assoc_t id"
44.Sh DESCRIPTION 44.Sh DESCRIPTION
45The 45The
46.Fn sctp_peeloff 46.Fn sctp_peeloff
47function attempts detach the association specified by 47function attempts detach the association specified by
48.Fa id 48.Fa id
49into its own separate socket. 49into its own separate socket.
50.Sh RETURN VALUES 50.Sh RETURN VALUES
51The call returns -1 on failure and the new socket descriptor 51The call returns \-1 on failure and the new socket descriptor
52upon success. 52upon success.
53.Sh ERRORS 53.Sh ERRORS
54The 54The
55.Fn sctp_peeloff 55.Fn sctp_peeloff
56function can return the following errors: 56function can return the following errors:
57.Bl -tag -width Er 57.Bl -tag -width Er
58.It Bq Er ENOTCONN 
59The 
60.Fa id 
61given to the call does not map to a valid 
62association. 
63.It Bq Er E2BIG 58.It Bq Er E2BIG
64The size of the address list exceeds the amount of 59The size of the address list exceeds the amount of
65data provided. 60data provided.
66.It Bq Er EBADF 61.It Bq Er EBADF
67The argument 62The argument
68.Fa s 63.Fa s
69is not a valid descriptor. 64is not a valid descriptor.
 65.It Bq Er ENOTCONN
 66The
 67.Fa id
 68given to the call does not map to a valid
 69association.
70.It Bq Er ENOTSOCK 70.It Bq Er ENOTSOCK
71The argument 71The argument
72.Fa s 72.Fa s
73is not a socket. 73is not a socket.
74.El 74.El
75.Sh SEE ALSO 75.Sh SEE ALSO
76.Xr sctp 4 76.Xr sctp 4
77.Rs 77.Rs
78.%R RFC 78.%R RFC
79.%N 6458 79.%N 6458
80.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)" 80.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)"
81.%D December 2011 81.%D December 2011
82.Re  82.Re
83.Sh HISTORY 83.Sh HISTORY
84This function first appeared in 84This function first appeared in
85.Nx 9.0 . 85.Nx 9.0 .

cvs diff -r1.1 -r1.2 src/lib/libc/net/sctp_recvmsg.3 (expand / switch to unified diff)

--- src/lib/libc/net/sctp_recvmsg.3 2018/08/02 10:18:19 1.1
+++ src/lib/libc/net/sctp_recvmsg.3 2018/08/13 06:00:21 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: sctp_recvmsg.3,v 1.1 2018/08/02 10:18:19 rjs Exp $ 1.\" $NetBSD: sctp_recvmsg.3,v 1.2 2018/08/13 06:00:21 wiz Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
@@ -41,39 +41,42 @@ @@ -41,39 +41,42 @@
41.In netinet/sctp.h 41.In netinet/sctp.h
42.Ft ssize_t 42.Ft ssize_t
43.Fo sctp_recvmsg 43.Fo sctp_recvmsg
44.Fa "int s" "void *msg" "size_t len" "struct sockaddr * restrict from" 44.Fa "int s" "void *msg" "size_t len" "struct sockaddr * restrict from"
45.Fa "socklen_t * restrict fromlen" "struct sctp_sndrcvinfo *sinfo" "int *flags" 45.Fa "socklen_t * restrict fromlen" "struct sctp_sndrcvinfo *sinfo" "int *flags"
46.Fc 46.Fc
47.Sh DESCRIPTION 47.Sh DESCRIPTION
48The 48The
49.Fn sctp_recvmsg 49.Fn sctp_recvmsg
50system call 50system call
51is used to receive a message from another SCTP endpoint. 51is used to receive a message from another SCTP endpoint.
52The 52The
53.Fn sctp_recvmsg 53.Fn sctp_recvmsg
54call is used by one-to-one (SOCK_STREAM) type sockets after a 54call is used by one-to-one
55successful 55.Dv ( SOCK_STREAM )
 56type sockets after a successful
56.Fn connect 57.Fn connect
57call or after the application has performed a 58call or after the application has performed a
58.Fn listen 59.Fn listen
59followed by a successful 60followed by a successful
60.Fn accept . 61.Fn accept .
61For a one-to-many (SOCK_SEQPACKET) type socket, an endpoint may call 62For a one-to-many
 63.Dv ( SOCK_SEQPACKET )
 64type socket, an endpoint may call
62.Fn sctp_recvmsg 65.Fn sctp_recvmsg
63after having implicitly started an association via one 66after having implicitly started an association via one
64of the send calls including 67of the send calls including
65.Fn sctp_sendmsg , 68.Fn sctp_sendmsg ,
66.Fn sendto 69.Fn sendto ,
67and 70and
68.Fn sendmsg . 71.Fn sendmsg .
69Or, an application may also receive a message after having 72Or, an application may also receive a message after having
70called 73called
71.Fn listen 74.Fn listen
72with a positive backlog to enable the reception of new associations. 75with a positive backlog to enable the reception of new associations.
73.Pp 76.Pp
74The address of the sender is held in the 77The address of the sender is held in the
75.Fa from 78.Fa from
76argument with 79argument with
77.Fa fromlen 80.Fa fromlen
78specifying its size. 81specifying its size.
79At the completion of a successful 82At the completion of a successful
@@ -97,27 +100,27 @@ receive buffer, then the @@ -97,27 +100,27 @@ receive buffer, then the
97.Fa flags 100.Fa flags
98argument will 101argument will
99.Em not 102.Em not
100have the 103have the
101.Dv MSG_EOF 104.Dv MSG_EOF
102flag applied. 105flag applied.
103If the message is a complete message then 106If the message is a complete message then
104the 107the
105.Fa flags 108.Fa flags
106argument will have 109argument will have
107.Dv MSG_EOF 110.Dv MSG_EOF
108set. 111set.
109Locally detected errors are 112Locally detected errors are
110indicated by a return value of -1 with 113indicated by a return value of \-1 with
111.Va errno 114.Va errno
112set accordingly. 115set accordingly.
113The 116The
114.Fa flags 117.Fa flags
115argument may also hold the value 118argument may also hold the value
116.Dv MSG_NOTIFICATION . 119.Dv MSG_NOTIFICATION .
117When this 120When this
118occurs it indicates that the message received is 121occurs it indicates that the message received is
119.Em not 122.Em not
120from 123from
121the peer endpoint, but instead is a notification from the 124the peer endpoint, but instead is a notification from the
122SCTP stack (see 125SCTP stack (see
123.Xr sctp 4 126.Xr sctp 4
@@ -211,93 +214,95 @@ value will be one of the TSNs that was u @@ -211,93 +214,95 @@ value will be one of the TSNs that was u
211message. 214message.
212.Pp 215.Pp
213The 216The
214.Fa sinfo->sinfo_cumtsn 217.Fa sinfo->sinfo_cumtsn
215field holds the current cumulative acknowledgment point of 218field holds the current cumulative acknowledgment point of
216the transport association. 219the transport association.
217Note that this may be larger 220Note that this may be larger
218or smaller than the TSN assigned to the message itself. 221or smaller than the TSN assigned to the message itself.
219.Pp 222.Pp
220The 223The
221.Fa sinfo->sinfo_assoc_id 224.Fa sinfo->sinfo_assoc_id
222is the unique association identification that was assigned 225is the unique association identification that was assigned
223to the association. 226to the association.
224For one-to-many (SOCK_SEQPACKET) type 227For one-to-many
225sockets this value can be used to send data to the peer without 228.Dv ( SOCK_SEQPACKET )
 229type sockets this value can be used to send data to the peer without
226the use of an address field. 230the use of an address field.
227It is also quite useful in 231It is also quite useful in
228setting various socket options on the specific association 232setting various socket options on the specific association
229(see 233(see
230.Xr sctp 4 ) . 234.Xr sctp 4 ) .
231.Pp 235.Pp
232The 236The
233.Fa sinfo->info_timetolive 237.Fa sinfo->info_timetolive
234field is not used by 238field is not used by
235.Fn sctp_recvmsg . 239.Fn sctp_recvmsg .
236.Sh RETURN VALUES 240.Sh RETURN VALUES
237The call returns the number of bytes received, or -1 241The call returns the number of bytes received, or \-1
238if an error occurred. 242if an error occurred.
239.Sh ERRORS 243.Sh ERRORS
240The 244The
241.Fn sctp_recvmsg 245.Fn sctp_recvmsg
242system call 246system call
243fails if: 247fails if:
244.Bl -tag -width Er 248.Bl -tag -width Er
 249.It Bq Er EAGAIN
 250The socket is marked non-blocking and the requested operation
 251would block.
245.It Bq Er EBADF 252.It Bq Er EBADF
246An invalid descriptor was specified. 253An invalid descriptor was specified.
247.It Bq Er ENOTSOCK 254.It Bq Er ECONNRESET
248The argument 255An abort was received by the stack while the user was
249.Fa s 256attempting to send data to the peer.
250is not a socket. 
251.It Bq Er EFAULT 257.It Bq Er EFAULT
252An invalid user space address was specified for an argument. 258An invalid user space address was specified for an argument.
 259.It Bq Er EHOSTUNREACH
 260The remote host was unreachable.
253.It Bq Er EMSGSIZE 261.It Bq Er EMSGSIZE
254The socket requires that message be sent atomically, 262The socket requires that message be sent atomically,
255and the size of the message to be sent made this impossible. 263and the size of the message to be sent made this impossible.
256.It Bq Er EAGAIN 
257The socket is marked non-blocking and the requested operation 
258would block. 
259.It Bq Er ENOBUFS 264.It Bq Er ENOBUFS
260The system was unable to allocate an internal buffer. 265The system was unable to allocate an internal buffer.
261The operation may succeed when buffers become available. 266The operation may succeed when buffers become available.
262.It Bq Er ENOBUFS 267This error is also returned when
263The output queue for a network interface was full. 268the output queue for a network interface was full.
264This generally indicates that the interface has stopped sending, 269This generally indicates that the interface has stopped sending,
265but may be caused by transient congestion. 270but may be caused by transient congestion.
266.It Bq Er EHOSTUNREACH 
267The remote host was unreachable. 
268.It Bq Er ENOTCONN 
269On a one-to-one style socket no association exists. 
270.It Bq Er ECONNRESET 
271An abort was received by the stack while the user was 
272attempting to send data to the peer. 
273.It Bq Er ENOENT 271.It Bq Er ENOENT
274On a one to many style socket no address is specified 272On a one to many style socket no address is specified
275so that the association cannot be located or the 273so that the association cannot be located or the
276SCTP_ABORT flag was specified on a non-existing association. 274.Dv SCTP_ABORT
 275flag was specified on a non-existing association.
 276.It Bq Er ENOTCONN
 277On a one-to-one style socket no association exists.
 278.It Bq Er ENOTSOCK
 279The argument
 280.Fa s
 281is not a socket.
277.It Bq Er EPIPE 282.It Bq Er EPIPE
278The socket is unable to send anymore data 283The socket is unable to send anymore data
279.Dv ( SBS_CANTSENDMORE 284.Dv ( SBS_CANTSENDMORE
280has been set on the socket). 285has been set on the socket).
281This typically means that the socket 286This typically means that the socket
282is not connected and is a one-to-one style socket. 287is not connected and is a one-to-one style socket.
283.El 288.El
284.Sh SEE ALSO 289.Sh SEE ALSO
 290.Xr getsockopt 2 ,
285.Xr recv 2 , 291.Xr recv 2 ,
286.Xr select 2 , 292.Xr select 2 ,
 293.Xr sendmsg 2 ,
 294.Xr setsockopt 2 ,
287.Xr socket 2 , 295.Xr socket 2 ,
288.Xr write 2 , 296.Xr write 2 ,
289.Xr getsockopt 2 , 
290.Xr setsockopt 2 , 
291.Xr sctp_send 3 , 297.Xr sctp_send 3 ,
292.Xr sctp_sendmsg 3 , 298.Xr sctp_sendmsg 3 ,
293.Xr sendmsg 2 , 
294.Xr sctp 4 299.Xr sctp 4
295.Rs 300.Rs
296.%R RFC 301.%R RFC
297.%N 6458 302.%N 6458
298.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)" 303.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)"
299.%D December 2011 304.%D December 2011
300.Re  305.Re
301.Sh HISTORY 306.Sh HISTORY
302This function first appeared in 307This function first appeared in
303.Nx 9.0 . 308.Nx 9.0 .

cvs diff -r1.1 -r1.2 src/lib/libc/net/sctp_send.3 (expand / switch to unified diff)

--- src/lib/libc/net/sctp_send.3 2018/08/02 08:40:48 1.1
+++ src/lib/libc/net/sctp_send.3 2018/08/13 06:00:21 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: sctp_send.3,v 1.1 2018/08/02 08:40:48 rjs Exp $ 1.\" $NetBSD: sctp_send.3,v 1.2 2018/08/13 06:00:21 wiz Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
@@ -47,76 +47,82 @@ @@ -47,76 +47,82 @@
47.Fc 47.Fc
48.Ft ssize_t 48.Ft ssize_t
49.Fo sctp_sendx 49.Fo sctp_sendx
50.Fa "int sd" "const void *msg" "size_t len" "struct sockaddr *addrs" 50.Fa "int sd" "const void *msg" "size_t len" "struct sockaddr *addrs"
51.Fa "int addrcnt" "const struct sctp_sndrcvinfo *sinfo" "int flags" 51.Fa "int addrcnt" "const struct sctp_sndrcvinfo *sinfo" "int flags"
52.Fc 52.Fc
53.Sh DESCRIPTION 53.Sh DESCRIPTION
54The 54The
55.Fn sctp_send 55.Fn sctp_send
56system call 56system call
57is used to transmit a message to another SCTP endpoint. 57is used to transmit a message to another SCTP endpoint.
58.Fn sctp_send 58.Fn sctp_send
59may be used to send data to an existing association for both 59may be used to send data to an existing association for both
60one-to-many (SOCK_SEQPACKET) and one-to-one (SOCK_STREAM) socket types. 60one-to-many
 61.Dv ( SOCK_SEQPACKET )
 62and one-to-one
 63.Dv ( SOCK_STREAM )
 64socket types.
61The length of the message 65The length of the message
62.Fa msg 66.Fa msg
63is given by 67is given by
64.Fa len . 68.Fa len .
65If the message is too long to pass atomically through the 69If the message is too long to pass atomically through the
66underlying protocol, 70underlying protocol,
67.Va errno 71.Va errno
68is set to 72is set to
69.Er EMSGSIZE , 73.Er EMSGSIZE ,
70-1 is returned, and 74\-1 is returned, and
71the message is not transmitted. 75the message is not transmitted.
72.Pp 76.Pp
73No indication of failure to deliver is implicit in a 77No indication of failure to deliver is implicit in a
74.Fn sctp_send . 78.Fn sctp_send .
75Locally detected errors are indicated by a return value of -1. 79Locally detected errors are indicated by a return value of \-1.
76.Pp 80.Pp
77If no space is available at the socket to hold 81If no space is available at the socket to hold
78the message to be transmitted, then 82the message to be transmitted, then
79.Fn sctp_send 83.Fn sctp_send
80normally blocks, unless the socket has been placed in 84normally blocks, unless the socket has been placed in
81non-blocking I/O mode. 85non-blocking I/O mode.
82The 86The
83.Xr select 2 87.Xr select 2
84system call may be used to determine when it is possible to 88system call may be used to determine when it is possible to
85send more data on one-to-one type (SOCK_STREAM) sockets. 89send more data on one-to-one type
 90.Dv ( SOCK_STREAM )
 91sockets.
86.Pp 92.Pp
87The 93The
88.Fa sinfo 94.Fa sinfo
89structure is used to control various SCTP features 95structure is used to control various SCTP features
90and has the following format: 96and has the following format:
91.Bd -literal 97.Bd -literal
92struct sctp_sndrcvinfo { 98struct sctp_sndrcvinfo {
93 uint16_t sinfo_stream; /* Stream sending to */ 99 uint16_t sinfo_stream; /* Stream sending to */
94 uint16_t sinfo_ssn; /* valid for recv only */ 100 uint16_t sinfo_ssn; /* valid for recv only */
95 uint16_t sinfo_flags; /* flags to control sending */ 101 uint16_t sinfo_flags; /* flags to control sending */
96 uint32_t sinfo_ppid; /* ppid field */ 102 uint32_t sinfo_ppid; /* ppid field */
97 uint32_t sinfo_context; /* context field */ 103 uint32_t sinfo_context; /* context field */
98 uint32_t sinfo_timetolive; /* timetolive for PR-SCTP */ 104 uint32_t sinfo_timetolive; /* timetolive for PR-SCTP */
99 uint32_t sinfo_tsn; /* valid for recv only */ 105 uint32_t sinfo_tsn; /* valid for recv only */
100 uint32_t sinfo_cumtsn; /* valid for recv only */ 106 uint32_t sinfo_cumtsn; /* valid for recv only */
101 sctp_assoc_t sinfo_assoc_id; /* The association id */ 107 sctp_assoc_t sinfo_assoc_id; /* The association id */
102}; 108};
103.Ed 109.Ed
104.Pp 110.Pp
105The 111The
106.Fa sinfo->sinfo_ppid 112.Fa sinfo->sinfo_ppid
107argument is an opaque 32 bit value that is passed transparently 113argument is an opaque 32 bit value that is passed transparently
108through the stack to the peer endpoint. It will be available on 114through the stack to the peer endpoint.
109reception of a message (see 115It will be available on reception of a message (see
110.Xr sctp_recvmsg 3 ) . 116.Xr sctp_recvmsg 3 ) .
111Note that the stack passes this value without regard to byte 117Note that the stack passes this value without regard to byte
112order. 118order.
113.Pp 119.Pp
114The 120The
115.Fa sinfo->sinfo_flags 121.Fa sinfo->sinfo_flags
116argument may include one or more of the following: 122argument may include one or more of the following:
117.Bd -literal 123.Bd -literal
118#define SCTP_EOF 0x0100 /* Start a shutdown procedures */ 124#define SCTP_EOF 0x0100 /* Start a shutdown procedures */
119#define SCTP_ABORT 0x0200 /* Send an ABORT to peer */ 125#define SCTP_ABORT 0x0200 /* Send an ABORT to peer */
120#define SCTP_UNORDERED 0x0400 /* Message is un-ordered */ 126#define SCTP_UNORDERED 0x0400 /* Message is un-ordered */
121#define SCTP_ADDR_OVER 0x0800 /* Override the primary-address */ 127#define SCTP_ADDR_OVER 0x0800 /* Override the primary-address */
122#define SCTP_SENDALL 0x1000 /* Send this on all associations */ 128#define SCTP_SENDALL 0x1000 /* Send this on all associations */
@@ -152,27 +158,29 @@ The flag @@ -152,27 +158,29 @@ The flag
152.Dv SCTP_ADDR_OVER 158.Dv SCTP_ADDR_OVER
153is used to specify that a specific address should be used. 159is used to specify that a specific address should be used.
154Normally 160Normally
155SCTP will use only one of a multi-homed peers addresses as the primary 161SCTP will use only one of a multi-homed peers addresses as the primary
156address to send to. 162address to send to.
157By default, no matter what the 163By default, no matter what the
158.Fa to 164.Fa to
159argument is, this primary address is used to send data. 165argument is, this primary address is used to send data.
160By specifying 166By specifying
161this flag, the user is asking the stack to ignore the primary address 167this flag, the user is asking the stack to ignore the primary address
162and instead use the specified address not only as a lookup mechanism 168and instead use the specified address not only as a lookup mechanism
163to find the association but also as the actual address to send to. 169to find the association but also as the actual address to send to.
164.Pp 170.Pp
165For a one-to-many type (SOCK_SEQPACKET) socket the flag 171For a one-to-many type
 172.Dv ( SOCK_SEQPACKET )
 173socket the flag
166.Dv SCTP_SENDALL 174.Dv SCTP_SENDALL
167can be used as a convenient way to make one send call and have 175can be used as a convenient way to make one send call and have
168all associations that are under the socket get a copy of the message. 176all associations that are under the socket get a copy of the message.
169Note that this mechanism is quite efficient and makes only one actual 177Note that this mechanism is quite efficient and makes only one actual
170copy of the data which is shared by all the associations for sending. 178copy of the data which is shared by all the associations for sending.
171.Pp 179.Pp
172The remaining flags are used for the partial reliability extension (RFC3758) 180The remaining flags are used for the partial reliability extension (RFC3758)
173and will only be effective if the peer endpoint supports this extension. 181and will only be effective if the peer endpoint supports this extension.
174This option specifies what local policy the local endpoint should use 182This option specifies what local policy the local endpoint should use
175in skipping data. 183in skipping data.
176If none of these options are set, then data is 184If none of these options are set, then data is
177never skipped over. 185never skipped over.
178.Pp 186.Pp
@@ -274,86 +282,87 @@ This allows the @@ -274,86 +282,87 @@ This allows the
274user the equivalent behavior as doing a 282user the equivalent behavior as doing a
275.Fn sctp_connectx 283.Fn sctp_connectx
276followed by a 284followed by a
277.Fn sctp_send 285.Fn sctp_send
278to the association. 286to the association.
279Note that if the 287Note that if the
280.Fa sinfo->sinfo_assoc_id 288.Fa sinfo->sinfo_assoc_id
281field is 0, then the first address will be used to look up 289field is 0, then the first address will be used to look up
282the association in place of the association id. 290the association in place of the association id.
283If both 291If both
284an address and an association id are specified, the association 292an address and an association id are specified, the association
285id has priority. 293id has priority.
286.Sh RETURN VALUES 294.Sh RETURN VALUES
287The call returns the number of characters sent, or -1 295The call returns the number of characters sent, or \-1
288if an error occurred. 296if an error occurred.
289.Sh ERRORS 297.Sh ERRORS
290The 298The
291.Fn sctp_send 299.Fn sctp_send
292system call 300system call
293fails if: 301fails if:
294.Bl -tag -width Er 302.Bl -tag -width Er
 303.It Bq Er EAGAIN
 304The socket is marked non-blocking and the requested operation
 305would block.
295.It Bq Er EBADF 306.It Bq Er EBADF
296An invalid descriptor was specified. 307An invalid descriptor was specified.
297.It Bq Er ENOTSOCK 308.It Bq Er ECONNRESET
298The argument 309An abort was received by the stack while the user was
299.Fa s 310attempting to send data to the peer.
300is not a socket. 
301.It Bq Er EFAULT 311.It Bq Er EFAULT
302An invalid user space address was specified for an argument. 312An invalid user space address was specified for an argument.
 313.It Bq Er EHOSTUNREACH
 314The remote host was unreachable.
303.It Bq Er EMSGSIZE 315.It Bq Er EMSGSIZE
304The socket requires that message be sent atomically, 316The socket requires that message be sent atomically,
305and the size of the message to be sent made this impossible. 317and the size of the message to be sent made this impossible.
306.It Bq Er EAGAIN 
307The socket is marked non-blocking and the requested operation 
308would block. 
309.It Bq Er ENOBUFS 318.It Bq Er ENOBUFS
310The system was unable to allocate an internal buffer. 319The system was unable to allocate an internal buffer.
311The operation may succeed when buffers become available. 320The operation may succeed when buffers become available.
312.It Bq Er ENOBUFS 321This error is also returned when
313The output queue for a network interface was full. 322the output queue for a network interface was full.
314This generally indicates that the interface has stopped sending, 323This generally indicates that the interface has stopped sending,
315but may be caused by transient congestion. 324but may be caused by transient congestion.
316.It Bq Er EHOSTUNREACH 
317The remote host was unreachable. 
318.It Bq Er ENOTCONN 
319On a one-to-one style socket no association exists. 
320.It Bq Er ECONNRESET 
321An abort was received by the stack while the user was 
322attempting to send data to the peer. 
323.It Bq Er ENOENT 325.It Bq Er ENOENT
324On a one-to-many style socket no address is specified 326On a one-to-many style socket no address is specified
325so that the association cannot be located or the 327so that the association cannot be located or the
326SCTP_ABORT flag was specified on a non-existing association. 328.Dv SCTP_ABORT
 329flag was specified on a non-existing association.
 330.It Bq Er ENOTCONN
 331On a one-to-one style socket no association exists.
 332.It Bq Er ENOTSOCK
 333The argument
 334.Fa s
 335is not a socket.
327.It Bq Er EPIPE 336.It Bq Er EPIPE
328The socket is unable to send anymore data 337The socket is unable to send anymore data
329.Dv ( SBS_CANTSENDMORE 338.Dv ( SBS_CANTSENDMORE
330has been set on the socket). 339has been set on the socket).
331This typically means that the socket 340This typically means that the socket
332is not connected and is a one-to-one style socket. 341is not connected and is a one-to-one style socket.
333.El 342.El
334.Sh SEE ALSO 343.Sh SEE ALSO
335.Xr getsockopt 2 , 344.Xr getsockopt 2 ,
336.Xr recv 2 , 345.Xr recv 2 ,
337.Xr select 2 , 346.Xr select 2 ,
338.Xr sendmsg 2 , 347.Xr sendmsg 2 ,
339.Xr socket 2 , 348.Xr socket 2 ,
340.Xr write 2 349.Xr write 2 ,
341.Xr sctp_connectx 3 , 350.Xr sctp_connectx 3 ,
342.Xr sctp_recvmsg 3 , 351.Xr sctp_recvmsg 3 ,
343.Xr sctp_sendmsg 3 , 352.Xr sctp_sendmsg 3 ,
344.Xr sctp 4 353.Xr sctp 4
345.Rs 354.Rs
346.%R RFC 355.%R RFC
347.%N 6458 356.%N 6458
348.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)" 357.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)"
349.%D December 2011 358.%D December 2011
350.Re  359.Re
351.Sh HISTORY 360.Sh HISTORY
352These functions first appeared in 361These functions first appeared in
353.Nx 9.0 . 362.Nx 9.0 .
354.Sh BUGS 363.Sh BUGS
355Because 364Because
356.Fn sctp_send 365.Fn sctp_send
357may have multiple associations under one endpoint, a 366may have multiple associations under one endpoint, a
358select on write will only work for a one-to-one style 367select on write will only work for a one-to-one style
359socket. 368socket.

cvs diff -r1.1 -r1.2 src/lib/libc/net/sctp_sendmsg.3 (expand / switch to unified diff)

--- src/lib/libc/net/sctp_sendmsg.3 2018/08/02 08:40:48 1.1
+++ src/lib/libc/net/sctp_sendmsg.3 2018/08/13 06:00:21 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: sctp_sendmsg.3,v 1.1 2018/08/02 08:40:48 rjs Exp $ 1.\" $NetBSD: sctp_sendmsg.3,v 1.2 2018/08/13 06:00:21 wiz Exp $
2.\" 2.\"
3.\" Copyright (c) 1983, 1991, 1993 3.\" Copyright (c) 1983, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors 14.\" 3. Neither the name of the University nor the names of its contributors
@@ -52,77 +52,82 @@ @@ -52,77 +52,82 @@
52.Fo sctp_sendmsgx 52.Fo sctp_sendmsgx
53.Fa "int s" "const void *msg" "size_t len" "const struct sockaddr *to" 53.Fa "int s" "const void *msg" "size_t len" "const struct sockaddr *to"
54.Fa "int addrcnt" "uint32_t ppid" "uint32_t flags" "uint16_t stream_no" 54.Fa "int addrcnt" "uint32_t ppid" "uint32_t flags" "uint16_t stream_no"
55.Fa "uint32_t timetolive" "uint32_t context" 55.Fa "uint32_t timetolive" "uint32_t context"
56.Fc 56.Fc
57.Sh DESCRIPTION 57.Sh DESCRIPTION
58The 58The
59.Fn sctp_sendmsg 59.Fn sctp_sendmsg
60system call 60system call
61is used to transmit a message to another SCTP endpoint. 61is used to transmit a message to another SCTP endpoint.
62The 62The
63.Fn sctp_sendmsg 63.Fn sctp_sendmsg
64may be used at any time. 64may be used at any time.
65If the socket is a one-to-many type (SOCK_SEQPACKET) 65If the socket is a one-to-many type
 66.Dv ( SOCK_SEQPACKET )
66socket then an attempt to send to an address that no association exists to will 67socket then an attempt to send to an address that no association exists to will
67implicitly create a new association. 68implicitly create a new association.
68Data sent in such an instance will result in 69Data sent in such an instance will result in
69the data being sent on the third leg of the SCTP four-way handshake. 70the data being sent on the third leg of the SCTP four-way handshake.
70Note that if 71Note that if
71the socket is a one-to-one type (SOCK_STREAM) socket then an association must 72the socket is a one-to-one type
 73.Dv ( SOCK_STREAM )
 74socket then an association must
72be in existence (by use of the 75be in existence (by use of the
73.Xr connect 2 76.Xr connect 2
74system call). 77system call).
75Calling 78Calling
76.Fn sctp_sendmsg 79.Fn sctp_sendmsg
77or 80or
78.Fn sctp_sendmsgx 81.Fn sctp_sendmsgx
79on a non-connected one-to-one socket will result in 82on a non-connected one-to-one socket will result in
80.Va errno 83.Va errno
81being set to 84being set to
82.Er ENOTCONN , 85.Er ENOTCONN ,
83-1 being returned, and the message not being transmitted. 86\-1 being returned, and the message not being transmitted.
84.Pp 87.Pp
85The address of the target is given by 88The address of the target is given by
86.Fa to 89.Fa to
87with 90with
88.Fa tolen 91.Fa tolen
89specifying its size. 92specifying its size.
90The length of the message 93The length of the message
91.Fa msg 94.Fa msg
92is given by 95is given by
93.Fa len . 96.Fa len .
94If the message is too long to pass atomically through the 97If the message is too long to pass atomically through the
95underlying protocol, 98underlying protocol,
96.Va errno 99.Va errno
97is set to 100is set to
98.Er EMSGSIZE , 101.Er EMSGSIZE ,
99-1 is returned, and 102\-1 is returned, and
100the message is not transmitted. 103the message is not transmitted.
101.Pp 104.Pp
102No indication of failure to deliver is implicit in a 105No indication of failure to deliver is implicit in a
103.Xr sctp_sendmsg 3 106.Fn sctp_sendmsg
104call. 107call.
105Locally detected errors are indicated by a return value of -1. 108Locally detected errors are indicated by a return value of -1.
106.Pp 109.Pp
107If no space is available at the socket to hold 110If no space is available at the socket to hold
108the message to be transmitted, then 111the message to be transmitted, then
109.Xr sctp_sendmsg 3 112.Fn sctp_sendmsg
110normally blocks, unless the socket has been placed in 113normally blocks, unless the socket has been placed in
111non-blocking I/O mode. 114non-blocking I/O mode.
112The 115The
113.Xr select 2 116.Xr select 2
114system call may be used to determine when it is possible to 117system call may be used to determine when it is possible to
115send more data on one-to-one type (SOCK_STREAM) sockets. 118send more data on one-to-one type
 119.Dv ( SOCK_STREAM )
 120sockets.
116.Pp 121.Pp
117The 122The
118.Fa ppid 123.Fa ppid
119argument is an opaque 32 bit value that is passed transparently 124argument is an opaque 32 bit value that is passed transparently
120through the stack to the peer endpoint. 125through the stack to the peer endpoint.
121It will be available on 126It will be available on
122reception of a message (see 127reception of a message (see
123.Xr sctp_recvmsg 3 ) . 128.Xr sctp_recvmsg 3 ) .
124Note that the stack passes this value without regard to byte 129Note that the stack passes this value without regard to byte
125order. 130order.
126.Pp 131.Pp
127The 132The
128.Fa flags 133.Fa flags
@@ -165,27 +170,29 @@ The flag @@ -165,27 +170,29 @@ The flag
165.Dv SCTP_ADDR_OVER 170.Dv SCTP_ADDR_OVER
166is used to specify that an specific address should be used. 171is used to specify that an specific address should be used.
167Normally 172Normally
168SCTP will use only one of a multi-homed peers addresses as the primary 173SCTP will use only one of a multi-homed peers addresses as the primary
169address to send to. 174address to send to.
170By default, no matter what the 175By default, no matter what the
171.Fa to 176.Fa to
172argument is, this primary address is used to send data. 177argument is, this primary address is used to send data.
173By specifying 178By specifying
174this flag, the user is asking the stack to ignore the primary address 179this flag, the user is asking the stack to ignore the primary address
175and instead use the specified address not only as a lookup mechanism 180and instead use the specified address not only as a lookup mechanism
176to find the association but also as the actual address to send to. 181to find the association but also as the actual address to send to.
177.Pp 182.Pp
178For a one-to-many type (SOCK_SEQPACKET) socket the flag 183For a one-to-many type
 184.Dv ( SOCK_SEQPACKET )
 185socket the flag
179.Dv SCTP_SENDALL 186.Dv SCTP_SENDALL
180can be used as a convenient way to make one send call and have 187can be used as a convenient way to make one send call and have
181all associations that are under the socket get a copy of the message. 188all associations that are under the socket get a copy of the message.
182Note that this mechanism is quite efficient and makes only one actual 189Note that this mechanism is quite efficient and makes only one actual
183copy of the data which is shared by all the associations for sending. 190copy of the data which is shared by all the associations for sending.
184.Pp 191.Pp
185The remaining flags are used for the partial reliability extension (RFC3758) 192The remaining flags are used for the partial reliability extension (RFC3758)
186and will only be effective if the peer endpoint supports this extension. 193and will only be effective if the peer endpoint supports this extension.
187This option specifies what local policy the local endpoint should use 194This option specifies what local policy the local endpoint should use
188in skipping data. 195in skipping data.
189If none of these options are set, then data is 196If none of these options are set, then data is
190never skipped over. 197never skipped over.
191.Pp 198.Pp
@@ -252,88 +259,88 @@ is identical to @@ -252,88 +259,88 @@ is identical to
252.Fn sctp_sendmsg 259.Fn sctp_sendmsg
253with the exception that it takes an array of sockaddr structures in the 260with the exception that it takes an array of sockaddr structures in the
254argument 261argument
255.Fa to 262.Fa to
256and adds the additional argument 263and adds the additional argument
257.Fa addrcnt 264.Fa addrcnt
258which specifies how many addresses are in the array. 265which specifies how many addresses are in the array.
259This allows a 266This allows a
260caller to implicitly set up an association passing multiple addresses 267caller to implicitly set up an association passing multiple addresses
261as if 268as if
262.Fn sctp_connectx 269.Fn sctp_connectx
263had been called to set up the association. 270had been called to set up the association.
264.Sh RETURN VALUES 271.Sh RETURN VALUES
265The call returns the number of characters sent, or -1 272The call returns the number of characters sent, or \-1
266if an error occurred. 273if an error occurred.
267.Sh ERRORS 274.Sh ERRORS
268The 275The
269.Fn sctp_sendmsg 276.Fn sctp_sendmsg
270system call 277system call
271fails if: 278fails if:
272.Bl -tag -width Er 279.Bl -tag -width Er
 280.It Bq Er EAGAIN
 281The socket is marked non-blocking and the requested operation
 282would block.
273.It Bq Er EBADF 283.It Bq Er EBADF
274An invalid descriptor was specified. 284An invalid descriptor was specified.
275.It Bq Er ENOTSOCK 285.It Bq Er ECONNRESET
276The argument 286An abort was received by the stack while the user was
277.Fa s 287attempting to send data to the peer.
278is not a socket. 
279.It Bq Er EFAULT 288.It Bq Er EFAULT
280An invalid user space address was specified for an argument. 289An invalid user space address was specified for an argument.
 290.It Bq Er EHOSTUNREACH
 291The remote host was unreachable.
281.It Bq Er EMSGSIZE 292.It Bq Er EMSGSIZE
282The socket requires that message be sent atomically, 293The socket requires that message be sent atomically,
283and the size of the message to be sent made this impossible. 294and the size of the message to be sent made this impossible.
284.It Bq Er EAGAIN 
285The socket is marked non-blocking and the requested operation 
286would block. 
287.It Bq Er ENOBUFS 295.It Bq Er ENOBUFS
288The system was unable to allocate an internal buffer. 296The system was unable to allocate an internal buffer.
289The operation may succeed when buffers become available. 297The operation may succeed when buffers become available.
290.It Bq Er ENOBUFS 298This error is also returned when
291The output queue for a network interface was full. 299the output queue for a network interface was full.
292This generally indicates that the interface has stopped sending, 300This generally indicates that the interface has stopped sending,
293but may be caused by transient congestion. 301but may be caused by transient congestion.
294.It Bq Er EHOSTUNREACH 
295The remote host was unreachable. 
296.It Bq Er ENOTCONN 
297On a one-to-one style socket no association exists. 
298.It Bq Er ECONNRESET 
299An abort was received by the stack while the user was 
300attempting to send data to the peer. 
301.It Bq Er ENOENT 302.It Bq Er ENOENT
302On a one-to-many style socket no address is specified 303On a one-to-many style socket no address is specified
303so that the association cannot be located or the 304so that the association cannot be located or the
304.Dv SCTP_ABORT 305.Dv SCTP_ABORT
305flag was specified on a non-existing association. 306flag was specified on a non-existing association.
 307.It Bq Er ENOTCONN
 308On a one-to-one style socket no association exists.
 309.It Bq Er ENOTSOCK
 310The argument
 311.Fa s
 312is not a socket.
306.It Bq Er EPIPE 313.It Bq Er EPIPE
307The socket is unable to send anymore data 314The socket is unable to send anymore data
308.Dv ( SBS_CANTSENDMORE 315.Dv ( SBS_CANTSENDMORE
309has been set on the socket). 316has been set on the socket).
310This typically means that the socket 317This typically means that the socket
311is not connected and is a one-to-one style socket. 318is not connected and is a one-to-one style socket.
312.El 319.El
313.Sh SEE ALSO 320.Sh SEE ALSO
314.Xr connect 2 , 321.Xr connect 2 ,
315.Xr getsockopt 2 , 322.Xr getsockopt 2 ,
316.Xr recv 2 , 323.Xr recv 2 ,
317.Xr select 2 , 324.Xr select 2 ,
 325.Xr sendmsg 2 ,
318.Xr socket 2 , 326.Xr socket 2 ,
319.Xr write 2 , 327.Xr write 2 ,
320.Xr sctp_connectx 3 , 328.Xr sctp_connectx 3 ,
321.Xr sendmsg 2 , 
322.Xr sctp 4 329.Xr sctp 4
323.Rs 330.Rs
324.%R RFC 331.%R RFC
325.%N 6458 332.%N 6458
326.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)" 333.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)"
327.%D December 2011 334.%D December 2011
328.Re  335.Re
329.Sh HISTORY 336.Sh HISTORY
330These functions first appeared in 337These functions first appeared in
331.Nx 9.0 . 338.Nx 9.0 .
332.Sh BUGS 339.Sh BUGS
333Because in the one-to-many style socket 340Because in the one-to-many style socket
334.Fn sctp_sendmsg 341.Fn sctp_sendmsg
335or 342or
336.Fn sctp_sendmsgx 343.Fn sctp_sendmsgx
337may have multiple associations under one endpoint, a 344may have multiple associations under one endpoint, a
338select on write will only work for a one-to-one style 345select on write will only work for a one-to-one style
339socket. 346socket.