Author: jhb
Date: Fri Feb  1 15:32:20 2013
New Revision: 246210
URL: http://svnweb.freebsd.org/changeset/base/246210

Log:
  Add placeholder constants to reserve a portion of the socket option
  name space for use by downstream vendors to add custom options.
  
  MFC after:    2 weeks

Modified:
  head/sys/netinet/tcp.h
  head/sys/netinet/udp.h
  head/sys/sys/socket.h
  head/sys/sys/un.h

Modified: head/sys/netinet/tcp.h
==============================================================================
--- head/sys/netinet/tcp.h      Fri Feb  1 14:26:54 2013        (r246209)
+++ head/sys/netinet/tcp.h      Fri Feb  1 15:32:20 2013        (r246210)
@@ -166,6 +166,9 @@ struct tcphdr {
 #define        TCP_KEEPINTVL   512     /* L,N interval between keepalives */
 #define        TCP_KEEPCNT     1024    /* L,N number of keepalives before 
close */
 
+/* Start of reserved space for third-party user-settable options. */
+#define        TCP_VENDOR      SO_VENDOR
+
 #define        TCP_CA_NAME_MAX 16      /* max congestion control name length */
 
 #define        TCPI_OPT_TIMESTAMPS     0x01

Modified: head/sys/netinet/udp.h
==============================================================================
--- head/sys/netinet/udp.h      Fri Feb  1 14:26:54 2013        (r246209)
+++ head/sys/netinet/udp.h      Fri Feb  1 15:32:20 2013        (r246210)
@@ -50,6 +50,8 @@ struct udphdr {
  */
 #define        UDP_ENCAP                       1
 
+/* Start of reserved space for third-party user-settable options. */
+#define        UDP_VENDOR                      SO_VENDOR
 
 /*
  * UDP Encapsulation of IPsec Packets options.

Modified: head/sys/sys/socket.h
==============================================================================
--- head/sys/sys/socket.h       Fri Feb  1 14:26:54 2013        (r246209)
+++ head/sys/sys/socket.h       Fri Feb  1 15:32:20 2013        (r246210)
@@ -143,6 +143,15 @@ typedef    __uid_t         uid_t;
 #endif
 
 /*
+ * Space reserved for new socket options added by third-party vendors.
+ * This range applies to all socket option levels.  New socket options
+ * in FreeBSD should always use an option value less than SO_VENDOR.
+ */
+#if __BSD_VISIBLE
+#define        SO_VENDOR       0x80000000
+#endif
+
+/*
  * Structure used for manipulating linger option.
  */
 struct linger {

Modified: head/sys/sys/un.h
==============================================================================
--- head/sys/sys/un.h   Fri Feb  1 14:26:54 2013        (r246209)
+++ head/sys/sys/un.h   Fri Feb  1 15:32:20 2013        (r246210)
@@ -57,6 +57,9 @@ struct sockaddr_un {
 #define        LOCAL_CREDS             2       /* pass credentials to receiver 
*/
 #define        LOCAL_CONNWAIT          4       /* connects block until 
accepted */
 
+/* Start of reserved space for third-party socket options. */
+#define        LOCAL_VENDOR            SO_VENDOR
+
 #ifndef _KERNEL
 
 /* actual length of an initialized sockaddr_un */
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to