aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/un.h
diff options
context:
space:
mode:
authorDima Dorfman <dd@FreeBSD.org>2001-08-17 22:01:18 +0000
committerDima Dorfman <dd@FreeBSD.org>2001-08-17 22:01:18 +0000
commit0c1bb4fbf1a07495aa163806e00ea56872c97286 (patch)
treea9fd833a0d5be8077a8bafc85a497fe0bae21cfa /sys/sys/un.h
parent3da705c074bc4670cbe8a16676d1c5c8fc041607 (diff)
downloadsrc-0c1bb4fbf1a07495aa163806e00ea56872c97286.tar.gz
src-0c1bb4fbf1a07495aa163806e00ea56872c97286.zip
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)
Notes
Notes: svn path=/head/; revision=81857
Diffstat (limited to 'sys/sys/un.h')
-rw-r--r--sys/sys/un.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/sys/un.h b/sys/sys/un.h
index e7c370195a50..710f995b7614 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));