diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h index 1613301a402..fb2f8108d4f 100644 --- a/sys/netinet/tcp.h +++ b/sys/netinet/tcp.h @@ -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 diff --git a/sys/netinet/udp.h b/sys/netinet/udp.h index cea26673c38..c2d638dde32 100644 --- a/sys/netinet/udp.h +++ b/sys/netinet/udp.h @@ -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. diff --git a/sys/sys/socket.h b/sys/sys/socket.h index d7c6c792d52..c29a689b591 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -142,6 +142,15 @@ typedef __uid_t uid_t; #define SO_PROTOTYPE SO_PROTOCOL /* alias for SO_PROTOCOL (SunOS name) */ #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. */ diff --git a/sys/sys/un.h b/sys/sys/un.h index 6ab84748bbd..7837e76ee70 100644 --- a/sys/sys/un.h +++ b/sys/sys/un.h @@ -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 */