summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/getrtable.2
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2010-07-03 04:44:50 +0000
committerguenther <guenther@openbsd.org>2010-07-03 04:44:50 +0000
commit8bb39f085984c8f31e98e59d88cab46a5aa1548e (patch)
tree841fb14fb8115333f08970c7eca7ab1ad359933b /lib/libc/sys/getrtable.2
parentRegen. (diff)
downloadwireguard-openbsd-8bb39f085984c8f31e98e59d88cab46a5aa1548e.tar.xz
wireguard-openbsd-8bb39f085984c8f31e98e59d88cab46a5aa1548e.zip
Fix the naming of interfaces and variables for rdomains and rtables
and make it possible to bind sockets (including listening sockets!) to rtables and not just rdomains. This changes the name of the system calls, socket option, and ioctl. After building with this you should remove the files /usr/share/man/cat2/[gs]etrdomain.0. Since this removes the existing [gs]etrdomain() system calls, the libc major is bumped. Written by claudio@, criticized^Wcritiqued by me
Diffstat (limited to 'lib/libc/sys/getrtable.2')
-rw-r--r--lib/libc/sys/getrtable.263
1 files changed, 63 insertions, 0 deletions
diff --git a/lib/libc/sys/getrtable.2 b/lib/libc/sys/getrtable.2
new file mode 100644
index 00000000000..efda35b89fe
--- /dev/null
+++ b/lib/libc/sys/getrtable.2
@@ -0,0 +1,63 @@
+.\" $OpenBSD: getrtable.2,v 1.1 2010/07/03 04:44:51 guenther Exp $
+.\"
+.\" Copyright (c) 2009 Reyk Floeter <reyk@openbsd.org>
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd $Mdocdate: July 3 2010 $
+.Dt GETRTABLE 2
+.Os
+.Sh NAME
+.Nm getrtable ,
+.Nm setrtable
+.Nd "get and set the default routing domain of the current process"
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <sys/socket.h>
+.Ft int
+.Fn getrtable "void"
+.Ft int
+.Fn setrtable "int rtableid"
+.Sh DESCRIPTION
+.Fn getrtable
+and
+.Fn setrtable
+manipulate the routing table and routing domain associated with the current
+process.
+.Pp
+Only the superuser is allowed to change the process routing domain if
+it is already set to a non-zero value.
+.Sh RETURN VALUES
+A 0 is returned if the call succeeds, \-1 if it fails.
+.Sh ERRORS
+The call succeeds unless:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+The value of the
+.Fa rtableid
+argument is not a valid routing table.
+.It Bq Er EPERM
+The user is not the superuser and the routing domain of the
+calling process is already set to a non-zero value.
+.El
+.Sh SEE ALSO
+.Xr getsockopt 2 ,
+.Xr setsockopt 2 ,
+.Xr route 8
+.Sh HISTORY
+The
+.Fn getrtable
+and
+.Fn setrtable
+system calls appeared in
+.Ox 4.8 .