summaryrefslogtreecommitdiffstats
path: root/sys/sys/socket.h
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2010-11-12 13:02:26 +0000
committerluigi <luigi@FreeBSD.org>2010-11-12 13:02:26 +0000
commitd5e8d236f4009fc2611f996c317e94b2c8649cf5 (patch)
treee91599dcbd47fe55ea222b065a06b499aa245cca /sys/sys/socket.h
parent20a2600f84554023f0954887c9cfc8bf63c28cf0 (diff)
downloadFreeBSD-src-d5e8d236f4009fc2611f996c317e94b2c8649cf5.zip
FreeBSD-src-d5e8d236f4009fc2611f996c317e94b2c8649cf5.tar.gz
This commit implements the SO_USER_COOKIE socket option, which lets
you tag a socket with an uint32_t value. The cookie can then be used by the kernel for various purposes, e.g. setting the skipto rule or pipe number in ipfw (this is the reason SO_USER_COOKIE has been implemented; however there is nothing ipfw-specific in its implementation). The ipfw-related code that uses the optopn will be committed separately. This change adds a field to 'struct socket', but the struct is not part of any driver or userland-visible ABI so the change should be harmless. See the discussion at http://lists.freebsd.org/pipermail/freebsd-ipfw/2009-October/004001.html Idea and code from Paul Joe, small modifications and manpage changes by myself. Submitted by: Paul Joe MFC after: 1 week
Diffstat (limited to 'sys/sys/socket.h')
-rw-r--r--sys/sys/socket.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/socket.h b/sys/sys/socket.h
index 9f22748..6a58219 100644
--- a/sys/sys/socket.h
+++ b/sys/sys/socket.h
@@ -137,6 +137,7 @@ typedef __uid_t uid_t;
#define SO_LISTENQLEN 0x1012 /* socket's complete queue length */
#define SO_LISTENINCQLEN 0x1013 /* socket's incomplete queue length */
#define SO_SETFIB 0x1014 /* use this FIB to route */
+#define SO_USER_COOKIE 0x1015 /* user cookie (dummynet etc.) */
#endif
/*
OpenPOWER on IntegriCloud