diff options
author | dd <dd@FreeBSD.org> | 2001-08-17 22:01:18 +0000 |
---|---|---|
committer | dd <dd@FreeBSD.org> | 2001-08-17 22:01:18 +0000 |
commit | 5e416567e18401664948a984b8208f0d39a1f0fd (patch) | |
tree | a9fd833a0d5be8077a8bafc85a497fe0bae21cfa /sys/sys/un.h | |
parent | 90eec3a264887cf9fc47c0654b2012231223b681 (diff) | |
download | FreeBSD-src-5e416567e18401664948a984b8208f0d39a1f0fd.zip FreeBSD-src-5e416567e18401664948a984b8208f0d39a1f0fd.tar.gz |
Implement a LOCAL_PEERCRED socket option which returns a
`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)
Diffstat (limited to 'sys/sys/un.h')
-rw-r--r-- | sys/sys/un.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/sys/un.h b/sys/sys/un.h index e7c3701..710f995 100644 --- a/sys/sys/un.h +++ b/sys/sys/un.h @@ -46,12 +46,16 @@ struct sockaddr_un { char sun_path[104]; /* path name (gag) */ }; +/* Socket options. */ +#define LOCAL_PEERCRED 0x001 /* retrieve peer credentails */ + #ifdef _KERNEL struct mbuf; struct socket; int uipc_usrreq __P((struct socket *so, int req, struct mbuf *m, struct mbuf *nam, struct mbuf *control)); +int uipc_ctloutput __P((struct socket *so, struct sockopt *sopt)); int unp_connect2 __P((struct socket *so, struct socket *so2)); void unp_dispose __P((struct mbuf *m)); int unp_externalize __P((struct mbuf *rights)); |