summaryrefslogtreecommitdiffstats
path: root/sys/sys/socket.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add feature to force the selection of source IP addressdenis2020-10-291-2/+4
| | | | | | | Based/previous work on an idea from deraadt@ Input from claudio@, djm@, deraadt@, sthen@ OK deraadt@
* implement SO_DOMAIN and SO_PROTOCOL so that the domain and the protocolrobert2019-07-221-1/+3
| | | | | | | | can also be retrieved with getsockopt(3) it looks like these will also be in the next issue of posix: http://austingroupbugs.net/view.php?id=840#c2263 ok claudio@, sthen@
* prepare sysctl net mib to allow runtime tuning of rx q pressure thresholdsdlg2019-07-031-2/+25
| | | | | | | | | this renames the PF_LINK bit of the mib from "link_layer" to "link". then it makes it a node that could be used for generic link layer bits. the first of these is an "ifrxq" node where the "pressure_return" and "pressure_drop" things go. ok visa@ deraadt@
* AF_LOCAL was a failed attempt (by POSIX?) to seem less UNIX-specific, butguenther2018-04-081-4/+4
| | | | | | | AF_UNIX is both the historical _and_ standard name, so prefer and recommend it in the headers, manpages, and kernel. ok miller@ deraadt@ schwarze@
* new socketoption SO_ZEROIZE: zero out all mbufs sent over socketmarkus2017-05-311-1/+2
| | | | ok deraadt bluhm
* Introduce sstosa() for converting sockaddr_storage with a type safebluhm2017-05-041-1/+9
| | | | | | | inline function instead of casting it to sockaddr. While there, use inline instead of __inline for all these conversions. Some struct sockaddr casts can be avoided completely. OK dhill@ mpi@
* Automatically create a default lo(4) interface per rdomain.mpi2016-11-141-2/+4
| | | | | | | | | | | | | | | | | | In order to stop abusing lo0 for all rdomains, a new loopback interface will be created every time a rdomain is created. The unit number will be the same as the rdomain, i.e. lo1 will be attached to rdomain 1. If this loopback interface is already in use it wont be possible to create the corresponding rdomain. In order to know which lo(4) interface is attached to a rdomain, its index is stored in the rtable/rdomain map. This is a long overdue since the introduction of rtable/rdomain. It also fixes a recent regression due to resetting the rdomain of an incoming packet reported by semarie@, Andreas Bartelt and Nils Frohberg. ok claudio@
* Hide RT_TABLEID_MAX behind __BSD_VISIBLEjca2016-09-281-4/+7
| | | | Alternate define location suggested by deraadt@ and kettenis@, ok kettenis@
* More #include cleanup per POSIX:guenther2016-09-121-1/+10
| | | | | | | | | | | - <sys/types.h>: don't pull in <sys/select.h> - <sys/select.h>: don't pull in <sys/time.h>, but rather declare timeval and timespec locally - <sys/time.h>: *do* always pull in <sys/select.h> - <sys/socket.h>: declare timeval if __BSD_VISIBLE for struct splice Ports testing and fixed by ajacoutot@ ok deraadt@ millert@
* Introduce a new sysctl NET_RT_IFNAMES that returns only ifnames to ifindexclaudio2015-10-231-2/+4
| | | | | | | | mappings. This will be used by if_nameindex(3), if_nametoindex(3) and if_indextoname(3) soon to fix the issues in pledge because of inet6 link local addressing. OK mpi@ benno@ deraadt@ The libc version will follow soon so better start updating your kernels
* At guenther's suggestion replace dnssocket() with a SOCK_DNS flag onderaadt2015-10-201-2/+3
| | | | | | | | | socket(). Without pledge, all other socket behaviours become permitted, except this one case: connect/send* only works to *:53. In pledge mode, a very few are further restricted. Some backwards compatibility for the dnssocket/dnsconnect calls will remain in the tree temporarily so that people can build through the transition. ok tedu guenther semarie
* In socketpair(), need to mask the type argument when testing for dgram.guenther2015-07-171-1/+4
| | | | | based on jeremy@'s diff ok jeremy@ deraadt@
* Delete option COMPAT_43: support for pre-sa_len binaries has been obsoleteguenther2015-01-211-12/+1
| | | | | | | | for a couple decades. Keep the OSIOCGIFCONF ioctl to support COMPAT_LINUX but move the rest of the Linux-specific ioctl() handling into linux_socket.c This lets struct osockaddr finally move from sys/socket.h to protocols/talkd.h ok krw@ deraadt@ mpi@
* Per POSIX, <sys/socket.h> needs to expose struct iovec, and may do soguenther2015-01-181-14/+3
| | | | | | | | | by pulling in <sys/uio.h>, so do so. Remove some stuff that we can trust <sys/uio.h> to also provide, like cdefs.h, _types.h, and exposing size_t and ssize_t pointed out by naddy@ ok deraadt@
* Add sockatmark()guenther2014-08-311-1/+2
| | | | ok millert@ manpage feedback jmc@
* Add additional kernel interfaces for setting close-on-exec on fdsguenther2014-08-311-12/+28
| | | | | | | when creating them: pipe2(), dup3(), accept4(), MSG_CMSG_CLOEXEC, SOCK_CLOEXEC. Includes SOCK_NONBLOCK support. ok matthew@
* Use internal types instead of the old BSD u_int#_t types in theguenther2013-04-021-5/+5
| | | | | | standard portion of the header. Most of the diff from James Turner (james (at) calminferno.net)
* Improve POSIX/SUS compliance of <netdb.h>, <sys/socket.h>, and <sys/un.h>.guenther2012-09-151-11/+45
| | | | | Much ports testing of various versions by naddy@ and jasper@ ok matthew@, miller@
* tedu struct omsghdrderaadt2012-04-111-13/+1
|
* SCM_CREDS can go away, since everything uses the newer APIs.deraadt2012-04-041-20/+1
| | | | ports tree checked by naddy
* remove IP_JUMBO, SO_JUMBO, and RTF_JUMBO.dlg2012-03-171-2/+1
| | | | no objection from mcbride@ krw@ markus@ deraadt@
* add support for MSG_NOSIGNAL.fgsch2011-12-031-1/+2
| | | | linux bits compiled on i386 by sebastia@, mikeb@ ok
* Provide namespace-safe alignment macros in <machine/_types.h>, withguenther2011-09-081-13/+9
| | | | | | | | compat names kept in <machine/param.h>. In <sys/socket.h>, pull in <sys/_types.h> instead of the namespace polluting <machine/param.h> and completely eliminate __CMSG_ALIGN, replaced by _ALIGN ok deraadt@
* Remove COMPAT_OLDSOCK since no nothing sets MSG_COMPAT anymore.deraadt2011-07-081-6/+2
| | | | | | The song and dance for handling 16-bit af_family on big-endian machines remains untouched. ok claudio miod tedu guenther
* surround splice structure with __BSD_VISIBLE (the right one, noticed bymikeb2011-07-081-1/+3
| | | | | bluhm, jasper and millert -- an epic fail on my side), style nits from deraadt, millert, ok guenther, kettenis, millert, ports tests by jasper
* this must be included my previous commit.yasuoka2011-07-081-2/+5
| | | | | | | | | Include PIPEX in kernel by default. And add new sysctl variable `net.pipex.enable' to enable PIPEX. By default, pipex is disabled and it will not process packets from wire. Update man pages and update HOWTO_PIPEX_NPPPD.txt for testers. discussed with dlg@, ok deraadt@ mcbride@ claudio@
* Implement an idle timeout for the socket splicing. A new `sp_idle'mikeb2011-07-041-1/+2
| | | | | | | field of the `splice' structure can be used to specify a period of inactivity after which splicing will be dissolved. ETIMEDOUT error retrieved with a SO_ERROR indicates the idle timeout expiration. With comments from and OK bluhm.
* Push COMPAT_FREEBSD in front of a whale. Buggy, out of date, noguenther2011-04-051-3/+2
| | | | | | one has been weeding it, and it makes life harder. Toasts of Brennivin for its passing from many; diff ok henning@
* Add socket option SO_SPLICE to splice together two TCP sockets.bluhm2011-01-071-1/+10
| | | | | | | The data received on the source socket will automatically be sent on the drain socket. This allows to write relay daemons with zero data copy. ok markus@
* remove compat_bsdos supporttedu2010-07-051-2/+2
|
* Fix the naming of interfaces and variables for rdomains and rtablesguenther2010-07-031-4/+4
| | | | | | | | | | | | 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
* remove support for compat_sunos (and m68k4k). ok deraadt guenthertedu2010-07-021-2/+2
|
* Put SO_PEERCRED into the non-flag areaderaadt2010-07-011-3/+3
| | | | suggested by guenther
* remove compat_osf1 support from the kerneltedu2010-06-301-2/+2
| | | | ok deraadt miod
* Add getsockopt SOL_SOCKET SO_PEERCRED support. This behaves similar toderaadt2010-06-301-1/+11
| | | | | | | getpeereid(2), but also supplies the remote pid. This is supplied in a 'struct sockpeercred' (unlike Linux -- they showed how little they know about real unix by calling theirs 'struct ucred'). ok guenther ajacoutot
* Remove COMPAT_HPUX. No one wanted to support it and its fewmets wereguenther2010-06-291-3/+2
| | | | | blocking other cleanups ok miod@
* Implement a way to get information about a rtable. Currently only the rtableidclaudio2010-04-211-2/+5
| | | | | | | and rdomainid are returned. This is necessary to know where L2 information of a table is stored (which will be needed soon by bgpd). Also while there change the errno for non-existing routing tables to ENOENT. 'Fine' deraadt@
* Add setrdomain() and getrdomain() system calls. Committing now toguenther2009-11-271-1/+3
| | | | | | | | catch the libc major bump per request from deraadt@ Diff by reyk. ok guenther@
* tab indent SO_RDOMAIN, like all the other SO_* defines.jsg2009-06-111-2/+2
|
* Initial support for routing domains. This allows to bind interfaces toclaudio2009-06-051-1/+5
| | | | | | | | | alternate routing table and separate them from other interfaces in distinct routing tables. The same network can now be used in any doamin at the same time without causing conflicts. This diff is mostly mechanical and adds the necessary rdomain checks accross net and netinet. L2 and IPv4 are mostly covered still missing pf and IPv6. input and tested by jsg@, phessler@ and reyk@. "put it in" deraadt@
* netstat statistics for pflow(4) via pseudo familygollo2008-09-161-2/+16
| | | | ok cluadio@ henning@
* Add SO_BINDANY socket option from BSD/OS.markus2008-05-091-1/+2
| | | | | | | | | The option allows a socket to be bound to addresses which are not local to the machine. In order to receive packets for these addresses SO_BINDANY needs to be combined with matching outgoing pf(4) divert rules, see pf.conf(5). ok beck@
* Make the SO_TIMESTAMP sockopt work. When set, this allows the user tockuethe2008-05-021-1/+3
| | | | | | | | | get a timestamp of when the datagram was accepted (by udp(4), for example) rather than having to take a timestamp with gettimeofday(2) when recv(2) returns - possibly several hundreds of microseconds later. May be of use to those interested in precision network timing schemes or QoS for media applications. Tested on alpha, amd64, i386 and sparc64. manpage suggestions from jmc, ok deraadt
* Import MPLS (Multi Protocol Label Switching)norby2008-04-231-3/+6
| | | | | | | | | | | | | MPLS support partly based on the (abandoned?) AYAME project. Basic LSR (Label Switch Router) functionality is present, but not fully functional yet. It is currently possible to insert entries in the LIB (Label Information Base) with route(8), but setting the operation type is not supported yet. Imported to allow more people to work on this in the coming weeks. ok claudio@ laurent@ dlg@
* typos; ok jmc@martynas2007-11-271-2/+2
| | | | sys/dev/pci/pciide.c from naddy@
* updatecomment and manpage toemtion optional seventh level (rtable id)henning2007-09-241-2/+3
| | | | From: Pierre Riteau <pierre.riteau@free.fr>
* Add sysctl to retrieve the routing table statisitcs. Will be used by netstatclaudio2006-03-311-2/+4
| | | | instead of kvm access. OK henning@
* Experimental support for opportunitic use of jumbograms where only some hostsmcbride2005-05-271-1/+2
| | | | | | | | | | | | | | on the local network support them. This adds a new socket option, SO_JUMBO, and a new route flag, RTF_JUMBO. If _both_ the socket option is set and the route for the host has RTF_JUMBO set, ip_output will fragment the packet to the largest possible size for the link, ignoring the card's MTU. The semantics of this feature will be evolving rapidly; talk to us if you intend to use it. ok deraadt@ marius@
* Add sysctl for dumping the SPDhshoexer2005-04-041-2/+4
| | | | ok deraadt, ok markus some time ago
* fix a typo, don't #define PF_RTIP to something nonmexistanthenning2005-03-221-2/+2
| | | | | nothing in our tree uses it (well, would have been spotted then) netbsd PR kern/29624 via jmc@, agreed on by claudio some time ago