Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Add userland support for SCTP and manpages.



details:   https://anonhg.NetBSD.org/src/rev/255fe9eb28bc
branches:  trunk
changeset: 365140:255fe9eb28bc
user:      rjs <rjs%NetBSD.org@localhost>
date:      Thu Aug 02 08:40:47 2018 +0000

description:
Add userland support for SCTP and manpages.

diffstat:

 distrib/sets/lists/base/shl.mi  |    6 +-
 distrib/sets/lists/comp/mi      |   24 +-
 distrib/sets/lists/debug/shl.mi |    6 +-
 lib/libc/net/Makefile.inc       |    9 +-
 lib/libc/net/sctp_bindx.3       |  120 ++++
 lib/libc/net/sctp_connectx.3    |  111 ++++
 lib/libc/net/sctp_freepaddrs.3  |   75 +++
 lib/libc/net/sctp_getaddrlen.3  |   93 +++
 lib/libc/net/sctp_getassocid.3  |   79 +++
 lib/libc/net/sctp_getpaddrs.3   |  106 ++++
 lib/libc/net/sctp_opt_info.3    |  129 +++++
 lib/libc/net/sctp_peeloff.3     |   85 +++
 lib/libc/net/sctp_send.3        |  359 ++++++++++++++
 lib/libc/net/sctp_sendmsg.3     |  339 ++++++++++++++
 lib/libc/net/sctp_sys_calls.c   |  963 ++++++++++++++++++++++++++++++++++++++++
 lib/libc/shlib_version          |    4 +-
 16 files changed, 2497 insertions(+), 11 deletions(-)

diffs (truncated from 2640 to 300 lines):

diff -r 558889a4ef38 -r 255fe9eb28bc distrib/sets/lists/base/shl.mi
--- a/distrib/sets/lists/base/shl.mi    Thu Aug 02 07:47:30 2018 +0000
+++ b/distrib/sets/lists/base/shl.mi    Thu Aug 02 08:40:47 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.843 2018/07/31 13:04:09 rjs Exp $
+# $NetBSD: shl.mi,v 1.844 2018/08/02 08:40:47 rjs Exp $
 #
 # Note:        Don't delete entries from here - mark them as "obsolete" instead,
 #      unless otherwise stated below.
@@ -18,7 +18,7 @@
 ./lib/libblacklist.so.0.0                      base-sys-shlib          dynamicroot
 ./lib/libc.so                                  base-sys-shlib          dynamicroot
 ./lib/libc.so.12                               base-sys-shlib          dynamicroot
-./lib/libc.so.12.210                           base-sys-shlib          dynamicroot
+./lib/libc.so.12.211                           base-sys-shlib          dynamicroot
 ./lib/libcrypt.so                              base-sys-shlib          dynamicroot
 ./lib/libcrypt.so.1                            base-sys-shlib          dynamicroot
 ./lib/libcrypt.so.1.0                          base-sys-shlib          dynamicroot
@@ -221,7 +221,7 @@
 ./usr/lib/libc++.so.1.0                                base-sys-shlib          compatfile,libcxx
 ./usr/lib/libc.so                              base-sys-shlib          compatfile
 ./usr/lib/libc.so.12                           base-sys-shlib          compatfile
-./usr/lib/libc.so.12.210                       base-sys-shlib          compatfile
+./usr/lib/libc.so.12.211                       base-sys-shlib          compatfile
 ./usr/lib/libcdk.so                            base-obsolete           compatfile,obsolete
 ./usr/lib/libcom_err.so                                base-krb5-shlib         compatfile,kerberos
 ./usr/lib/libcom_err.so.8                      base-krb5-shlib         compatfile,kerberos
diff -r 558889a4ef38 -r 255fe9eb28bc distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Thu Aug 02 07:47:30 2018 +0000
+++ b/distrib/sets/lists/comp/mi        Thu Aug 02 08:40:47 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.2214 2018/07/31 16:44:28 khorben Exp $
+#      $NetBSD: mi,v 1.2215 2018/08/02 08:40:47 rjs Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.comp                           comp-sys-root
@@ -16992,6 +16992,17 @@
 ./usr/share/man/html3/scrl.html                        comp-c-htmlman          html
 ./usr/share/man/html3/scroll.html              comp-c-htmlman          html
 ./usr/share/man/html3/scrollok.html            comp-c-htmlman          html
+./usr/share/man/html3/sctp_bindx.html          comp-c-htmlman          html
+./usr/share/man/html3/sctp_connectx.html       comp-c-htmlman          html
+./usr/share/man/html3/sctp_freepaddrs.html     comp-c-htmlman          html
+./usr/share/man/html3/sctp_getaddrlen.html     comp-c-htmlman          html
+./usr/share/man/html3/sctp_getassocid.html     comp-c-htmlman          html
+./usr/share/man/html3/sctp_getpaddrs.html      comp-c-htmlman          html
+./usr/share/man/html3/sctp_opt_info.html       comp-c-htmlman          html
+./usr/share/man/html3/sctp_peeloff.html                comp-c-htmlman          html
+./usr/share/man/html3/sctp_recvmsg.html                comp-c-htmlman          html
+./usr/share/man/html3/sctp_send.html           comp-c-htmlman          html
+./usr/share/man/html3/sctp_sendmsg.html                comp-c-htmlman          html
 ./usr/share/man/html3/sdp.html                 comp-c-htmlman          html
 ./usr/share/man/html3/sdp_attr2desc.html       comp-obsolete           obsolete
 ./usr/share/man/html3/sdp_change_service.html  comp-obsolete           obsolete
@@ -24777,6 +24788,17 @@
 ./usr/share/man/man3/scrl.3                    comp-c-man              .man
 ./usr/share/man/man3/scroll.3                  comp-c-man              .man
 ./usr/share/man/man3/scrollok.3                        comp-c-man              .man
+./usr/share/man/man3/sctp_bindx.3              comp-c-man              .man
+./usr/share/man/man3/sctp_connectx.3           comp-c-man              .man
+./usr/share/man/man3/sctp_freepaddrs.3         comp-c-man              .man
+./usr/share/man/man3/sctp_getaddrlen.3         comp-c-man              .man
+./usr/share/man/man3/sctp_getassocid.3         comp-c-man              .man
+./usr/share/man/man3/sctp_getpaddrs.3          comp-c-man              .man
+./usr/share/man/man3/sctp_opt_info.3           comp-c-man              .man
+./usr/share/man/man3/sctp_peeloff.3            comp-c-man              .man
+./usr/share/man/man3/sctp_recvmsg.3            comp-c-man              .man
+./usr/share/man/man3/sctp_send.3               comp-c-man              .man
+./usr/share/man/man3/sctp_sendmsg.3            comp-c-man              .man
 ./usr/share/man/man3/sdp.3                     comp-c-man              .man
 ./usr/share/man/man3/sdp_attr2desc.3           comp-obsolete           obsolete
 ./usr/share/man/man3/sdp_change_service.3      comp-obsolete           obsolete
diff -r 558889a4ef38 -r 255fe9eb28bc distrib/sets/lists/debug/shl.mi
--- a/distrib/sets/lists/debug/shl.mi   Thu Aug 02 07:47:30 2018 +0000
+++ b/distrib/sets/lists/debug/shl.mi   Thu Aug 02 08:40:47 2018 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: shl.mi,v 1.202 2018/07/31 22:29:55 kre Exp $
+# $NetBSD: shl.mi,v 1.203 2018/08/02 08:40:48 rjs Exp $
 ./usr/lib/libbfd_g.a                                           comp-c-debuglib debuglib,compatfile,binutils
 ./usr/libdata/debug/lib                                                base-sys-usr    debug,dynamicroot,compatdir
 ./usr/libdata/debug/lib/libblacklist.so.0.0.debug              comp-sys-debug  debug,dynamicroot
-./usr/libdata/debug/lib/libc.so.12.210.debug                   comp-sys-debug  debug,dynamicroot
+./usr/libdata/debug/lib/libc.so.12.211.debug                   comp-sys-debug  debug,dynamicroot
 ./usr/libdata/debug/lib/libcrypt.so.1.0.debug                  comp-sys-debug  debug,dynamicroot
 ./usr/libdata/debug/lib/libcrypto.so.12.0.debug                        comp-sys-debug  debug,dynamicroot,openssl=10
 ./usr/libdata/debug/lib/libcrypto.so.13.0.debug                        comp-sys-debug  debug,dynamicroot,openssl=11
@@ -72,7 +72,7 @@
 ./usr/libdata/debug/usr/lib/libbsdmalloc.so.0.0.debug          comp-sys-debug  debug,compatfile
 ./usr/libdata/debug/usr/lib/libbz2.so.1.1.debug                        comp-sys-debug  debug,compatfile
 ./usr/libdata/debug/usr/lib/libc++.so.1.0.debug                        comp-sys-debug  debug,compatfile,libcxx
-./usr/libdata/debug/usr/lib/libc.so.12.210.debug               comp-sys-debug  debug,compatfile
+./usr/libdata/debug/usr/lib/libc.so.12.211.debug               comp-sys-debug  debug,compatfile
 ./usr/libdata/debug/usr/lib/libcom_err.so.8.0.debug            comp-krb5-debug debug,compatfile,kerberos
 ./usr/libdata/debug/usr/lib/libcrypt.so.1.0.debug              comp-sys-debug  debug,compatfile
 ./usr/libdata/debug/usr/lib/libcrypto.so.12.0.debug            comp-crypto-debug       debug,compatfile,openssl=10
diff -r 558889a4ef38 -r 255fe9eb28bc lib/libc/net/Makefile.inc
--- a/lib/libc/net/Makefile.inc Thu Aug 02 07:47:30 2018 +0000
+++ b/lib/libc/net/Makefile.inc Thu Aug 02 08:40:47 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.87 2017/06/18 04:03:44 manu Exp $
+#      $NetBSD: Makefile.inc,v 1.88 2018/08/02 08:40:48 rjs Exp $
 #      @(#)Makefile.inc        8.2 (Berkeley) 9/5/93
 
 # net sources
@@ -13,7 +13,7 @@
        iso_addr.c linkaddr.c \
        nsdispatch.c nslexer.l nsparser.y nsap_addr.c \
        rcmd.c recv.c send.c sethostent.c \
-       sockatmark.c
+       sctp_sys_calls.c sockatmark.c
 
 .if (${MKHESIOD} != "no")
 SRCS+= hesiod.c
@@ -145,3 +145,8 @@
        inet6_rth_space.3 inet6_rth_getaddr.3 \
        rcmd.3 rcmd_af.3 rcmd.3 iruserok_sa.3 rcmd.3 rresvport_af.3 \
        rcmd.3 orcmd_af.3
+
+# SCTP
+MAN+=  sctp_bindx.3 sctp_connectx.3 sctp_freepaddrs.3 sctp_getaddrlen.3 \
+       sctp_getassocid.3 sctp_getpaddrs.3 sctp_opt_info.3 sctp_peeloff.3 \
+       sctp_recvmsg.3 sctp_send.3 sctp_sendmsg.3
diff -r 558889a4ef38 -r 255fe9eb28bc lib/libc/net/sctp_bindx.3
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/net/sctp_bindx.3 Thu Aug 02 08:40:47 2018 +0000
@@ -0,0 +1,120 @@
+.\"    $NetBSD: sctp_bindx.3,v 1.1 2018/08/02 08:40:48 rjs Exp $
+.\"
+.\" Copyright (c) 1983, 1991, 1993
+.\"    The Regents of the University of California.  All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"     From: @(#)send.2       8.2 (Berkeley) 2/21/94
+.\"
+.Dd August 1, 2018
+.Dt SCTP_BINDX 3
+.Os
+.Sh NAME
+.Nm sctp_bindx
+.Nd bind or unbind an SCTP socket to a list of addresses.
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In sys/types.h
+.In sys/socket.h
+.In netinet/sctp.h
+.Ft int
+.Fn sctp_bindx "int s" "struct sockaddr *addrs" "int num" "int type"
+.Sh DESCRIPTION
+The
+.Fn sctp_bindx
+call binds or unbinds a address or a list of addresses to an
+SCTP endpoint.
+This allows a user to bind a subset of
+addresses.
+The
+.Fn sctp_bindx
+call operates similarly to
+.Fn bind
+but allows a list of addresses and also allows a bind or an
+unbind.
+The argument
+.Fa s
+must be a valid SCTP socket descriptor.
+The argument
+.Fa addrs
+is a list of addresses (where the list may be only 1 in
+length) that the user wishes to bind or unbind to the
+socket.
+The argument
+.Fa type
+must be one of the following values.
+.Pp
+.Dv SCTP_BINDX_ADD_ADDR
+This value indicates that the listed address(es) need to
+be added to the endpoint.
+.Pp
+.Dv SCTP_BINDX_DEL_ADDR
+This value indicates that the listed address(es) need to
+be removed from the endpoint.
+.Pp
+Note that when a user adds or deletes an address to an
+association if the dynamic address flag
+.Va net.inet.sctp.auto_asconf
+is enabled any associations in the endpoint will attempt to
+have the address(es) added dynamically to the existing
+association.
+.Sh RETURN VALUES
+The call returns 0 on success and -1 upon failure.
+.Sh ERRORS
+The
+.Fn sctp_bindx
+function can return the following errors:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+This value is returned if the
+.Fa type
+field is not one of the allowed values (see above).
+.It Bq Er ENOMEM
+This value is returned if the number of addresses
+being added causes a memory allocation failure in
+the call.
+.It Bq Er EBADF
+The argument
+.Fa s
+is not a valid descriptor.
+.It Bq Er ENOTSOCK
+The argument
+.Fa s
+is not a socket.
+.El
+.Sh SEE ALSO
+.Xr bind 2 ,
+.Xr sctp 4
+.Rs
+.%R RFC
+.%N 6458
+.%T "Sockets API Extensions for the Stream Control Transmission Protocol (SCTP)"
+.%D December 2011
+.Re 
+.Sh HISTORY
+This function first appeared in
+.Nx 9.0 .
diff -r 558889a4ef38 -r 255fe9eb28bc lib/libc/net/sctp_connectx.3
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/libc/net/sctp_connectx.3      Thu Aug 02 08:40:47 2018 +0000
@@ -0,0 +1,111 @@
+.\"    $NetBSD: sctp_connectx.3,v 1.1 2018/08/02 08:40:48 rjs Exp $
+.\"
+.\" Copyright (c) 1983, 1991, 1993
+.\"    The Regents of the University of California.  All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.Dd August 1, 2018
+.Dt SCTP_CONNECTX 3
+.Os
+.Sh NAME
+.Nm sctp_connectx
+.Nd connect an SCTP socket with multiple destination addresses
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.In sys/types.h
+.In sys/socket.h
+.In netinet/sctp.h
+.Ft int
+.Fn sctp_connectx "int sd" "struct sockaddr *addrs" "int addrcnt" "sctp_assoc_t *id"
+.Sh DESCRIPTION
+The
+.Fn sctp_connectx
+call attempts to initiate an association to a peer SCTP
+endpoint.
+The call operates similarly to
+.Fn connect



Home | Main Index | Thread Index | Old Index