aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/un.h
Commit message (Collapse)AuthorAgeFilesLines
* unix(4): Add SOL_LOCAL:LOCAL_CREDS_PERSISTENTConrad Meyer2020-11-031-0/+1
| | | | | | | | | | | | This option is intended to be semantically identical to Linux's SOL_SOCKET:SO_PASSCRED. For now, it is mutually exclusive with the pre-existing sockopt SOL_LOCAL:LOCAL_CREDS. Reviewed by: markj (penultimate version) Differential Revision: https://reviews.freebsd.org/D27011 Notes: svn path=/head/; revision=367287
* Add SOL_LOCAL symbolic constant for unix socket option level.Konstantin Belousov2020-08-031-0/+2
| | | | | | | | | | | | | The constant seems to exists on MacOS X >= 10.8. Requested by: swills Reviewed by: allanjude, kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25933 Notes: svn path=/head/; revision=363813
* Make the path length of UNIX domain sockets specified by a #define.Jonathan T. Looney2020-04-141-1/+9
| | | | | | | | | | | | Also, add a comment describing the historical context for this length. Reviewed by: bz, jhb, kbowling (previous version) MFC after: 2 weeks Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D24272 Notes: svn path=/head/; revision=359921
* sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326023
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Add placeholder constants to reserve a portion of the socket optionJohn Baldwin2013-02-011-0/+3
| | | | | | | | | name space for use by downstream vendors to add custom options. MFC after: 2 weeks Notes: svn path=/head/; revision=246210
* Similar to r245823, use decimal constants for UNIX domain socket options.John Baldwin2013-01-221-3/+3
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=245824
* Now that portalfs doesn't directly invoke uipc_connect2(), make it aRobert Watson2008-10-061-7/+2
| | | | | | | | | static symbol. MFC after: 3 days Notes: svn path=/head/; revision=183650
* Further minor cleanups to UNIX domain sockets:Robert Watson2008-10-031-10/+1
| | | | | | | | | | | | | | | | | | - Staticize and locally prototype functions uipc_ctloutput(), unp_dispose(), unp_init(), and unp_externalize(), none of which have been required outside of uipc_usrreq.c since uipc_proto.c was removed. - Remove stale prototype for uipc_usrreq(), which has not existed in the code since 1997 - Forward declare and staticize uipc_usrreqs structure in uipc_usrreq.c and not un.h. - Comment on why uipc_connect2() is still non-static -- it is used directly by fifofs. - Remove stale comments, tidy up whitespace. MFC after: 3 days (where applicable) Notes: svn path=/head/; revision=183572
* Implement unix(4) socket options LOCAL_CREDS and LOCAL_CONNWAIT.Matthew N. Dodd2005-04-131-1/+3
| | | | | | | | | | | - Add unp_addsockcred() (for LOCAL_CREDS). - Add an argument to unp_connect2() to differentiate between PRU_CONNECT and PRU_CONNECT2. (for LOCAL_CONNWAIT) Obtained from: NetBSD (with some changes) Notes: svn path=/head/; revision=144978
* /* -> /*- for license, minor formatting changesWarner Losh2005-01-071-1/+1
| | | | Notes: svn path=/head/; revision=139825
* Remove advertising clause from University of California Regent's license,Warner Losh2004-04-071-4/+0
| | | | | | | | | per letter dated July 22, 1999. Approved by: core Notes: svn path=/head/; revision=127976
* Export uipc_connect2() from uipc_usrreq.c instead of unp_connect2(),Robert Watson2004-03-311-1/+1
| | | | | | | | | | | | | and consume that interface in portalfs and fifofs instead. In the new world order, unp_connect2() assumes that the unpcb mutex is held, whereas uipc_connect2() validates that the passed sockets are UNIX domain sockets, then grabs the mutex. NB: the portalfs and fifofs code gets down and dirty with UNIX domain sockets. Maybe this is a bad thing. Notes: svn path=/head/; revision=127652
* o Merge <machine/ansi.h> and <machine/types.h> into a new headerMike Barcroft2002-08-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | called <machine/_types.h>. o <machine/ansi.h> will continue to live so it can define MD clock macros, which are only MD because of gratuitous differences between architectures. o Change all headers to make use of this. This mainly involves changing: #ifdef _BSD_FOO_T_ typedef _BSD_FOO_T_ foo_t; #undef _BSD_FOO_T_ #endif to: #ifndef _FOO_T_DECLARED typedef __foo_t foo_t; #define _FOO_T_DECLARED #endif Concept by: bde Reviewed by: jake, obrien Notes: svn path=/head/; revision=102227
* Change spelling of `u_char' to `unsigned char' to avoid requiringMike Barcroft2002-06-191-1/+1
| | | | | | | <sys/types.h> as a prerequisite. Notes: svn path=/head/; revision=98445
* Add typedef of sa_family_t to <sys/un.h>, per POSIX and X/Open. HideMike Barcroft2002-04-201-1/+14
| | | | | | | portions of <sys/un.h> when a standard has been requested. Notes: svn path=/head/; revision=95100
* Remove __PAlfred Perlstein2002-03-191-7/+7
| | | | Notes: svn path=/head/; revision=92719
* Hopefully improve control message passing over Unix domain sockets.David Malone2001-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Allow the sending of more than one control message at a time over a unix domain socket. This should cover the PR 29499. 2) This requires that unp_{ex,in}ternalize and unp_scan understand mbufs with more than one control message at a time. 3) Internalize and externalize used to work on the mbuf in-place. This made life quite complicated and the code for sizeof(int) < sizeof(file *) could end up doing the wrong thing. The patch always create a new mbuf/cluster now. This resulted in the change of the prototype for the domain externalise function. 4) You can now send SCM_TIMESTAMP messages. 5) Always use CMSG_DATA(cm) to determine the start where the data in unp_{ex,in}ternalize. It was using ((struct cmsghdr *)cm + 1) in some places, which gives the wrong alignment on the alpha. (NetBSD made this fix some time ago). This results in an ABI change for discriptor passing and creds passing on the alpha. (Probably on the IA64 and Spare ports too). 6) Fix userland programs to use CMSG_* macros too. 7) Be more careful about freeing mbufs containing (file *)s. This is made possible by the prototype change of externalise. PR: 29499 MFC after: 6 weeks Notes: svn path=/head/; revision=84472
* Fixed a missing forward declaration and unsorting of prototypes in rev.1.18.Bruce Evans2001-10-041-1/+2
| | | | Notes: svn path=/head/; revision=84439
* style(9) the structure definitions.David E. O'Brien2001-09-051-1/+1
| | | | Notes: svn path=/head/; revision=83045
* Implement a LOCAL_PEERCRED socket option which returns aDima Dorfman2001-08-171-0/+4
| | | | | | | | | | | | | | `struct xucred` with the credentials of the connected peer. Obviously this only works (and makes sense) on SOCK_STREAM sockets. This works for both the connect(2) and listen(2) callers. There is precise documentation of the semantics in unix(4). Reviewed by: dwmalone (eyeballed) Notes: svn path=/head/; revision=81857
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"Peter Wemm1999-12-291-3/+3
| | | | | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come. Notes: svn path=/head/; revision=55205
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Fixed missing and unused forward declarations of structs.Bruce Evans1998-05-171-2/+2
| | | | Notes: svn path=/head/; revision=36124
* Convert socket structures to be type-stable and add a version number.Garrett Wollman1998-05-151-5/+2
| | | | | | | | | | | | | | | | | | | | | | Define a parameter which indicates the maximum number of sockets in a system, and use this to size the zone allocators used for sockets and for certain PCBs. Convert PF_LOCAL PCB structures to be type-stable and add a version number. Define an external format for infomation about socket structures and use it in several places. Define a mechanism to get all PF_LOCAL and PF_INET PCB lists through sysctl(3) without blocking network interrupts for an unreasonable length of time. This probably still has some bugs and/or race conditions, but it seems to work well enough on my machines. It is now possible for `netstat' to get almost all of its information via the sysctl(3) interface rather than reading kmem (changes to follow). Notes: svn path=/head/; revision=36079
* Fix all areas of the system (or at least all those in LINT) to avoid storingGarrett Wollman1997-08-161-1/+2
| | | | | | | | | | | socket addresses in mbufs. (Socket buffers are the one exception.) A number of kernel APIs needed to get fixed in order to make this happen. Also, fix three protocol families which kept PCBs in mbufs to not malloc them instead. Delete some old compatibility cruft while we're at it, and add some new routines in the in_cksum family. Notes: svn path=/head/; revision=28270
* The long-awaited mega-massive-network-code- cleanup. Part I.Garrett Wollman1997-04-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit includes the following changes: 1) Old-style (pr_usrreq()) protocols are no longer supported, the compatibility glue for them is deleted, and the kernel will panic on boot if any are compiled in. 2) Certain protocol entry points are modified to take a process structure, so they they can easily tell whether or not it is possible to sleep, and also to access credentials. 3) SS_PRIV is no more, and with it goes the SO_PRIVSTATE setsockopt() call. Protocols should use the process pointer they are now passed. 4) The PF_LOCAL and PF_ROUTE families have been updated to use the new style, as has the `raw' skeleton family. 5) PF_LOCAL sockets now obey the process's umask when creating a socket in the filesystem. As a result, LINT is now broken. I'm hoping that some enterprising hacker with a bit more time will either make the broken bits work (should be easy for netipx) or dike them out. Notes: svn path=/head/; revision=25201
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Merge in Lite2: add function prototypes.Jeffrey Hsu1996-03-111-10/+14
| | | | | | | | | | | Did not accept prototypes for unp_attach(), unp_bind(), unp_connect(), unp_detach(), unp_discard(), unp_disconnect(), unp_drop(), np_gc(), unp_mark(), unp_scan(), and unp_shutdown(). They are used only in uipc_usrreq.c and declared static there. Reviewed by: davidg & bde Notes: svn path=/head/; revision=14489
* Another mega commit to staticize things.Poul-Henning Kamp1995-12-141-13/+1
| | | | Notes: svn path=/head/; revision=12820
* Completed function declarations and/or added prototypes.Bruce Evans1995-11-211-1/+5
| | | | Notes: svn path=/head/; revision=12453
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-3/+3
| | | | Notes: svn path=/head/; revision=8876
* Prototypes, prototypes and even more prototypes. Not quite done yet, butPoul-Henning Kamp1994-10-021-2/+20
| | | | | | | getting closer all the time. Notes: svn path=/head/; revision=3304
* Made them all idempotent.Paul Richards1994-08-211-1/+6
| | | | | | | | Reviewed by: Submitted by: Notes: svn path=/head/; revision=2165
* Added $Id$David Greenman1994-08-021-0/+1
| | | | Notes: svn path=/head/; revision=1817
* The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.Rodney W. Grimes1994-05-251-4/+1
| | | | | | | | Reviewed by: Rodney W. Grimes Submitted by: John Dyson and David Greenman Notes: svn path=/head/; revision=1549
* BSD 4.4 Lite Kernel SourcesRodney W. Grimes1994-05-241-0/+52
Notes: svn path=/head/; revision=1541