summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1999-01-10 02:44:33 +0000
committerderaadt <deraadt@openbsd.org>1999-01-10 02:44:33 +0000
commitd103c16fc5c74bd51d5288320f320b0214657c67 (patch)
tree19c82e88494f5f6bffc17d4ac1a72710dfcd91fd
parentindent (diff)
downloadwireguard-openbsd-d103c16fc5c74bd51d5288320f320b0214657c67.tar.xz
wireguard-openbsd-d103c16fc5c74bd51d5288320f320b0214657c67.zip
add SO_NETPROC and CMSG_{FIRSTHDR,ALIGN,LEN,SPACE}; cmetz
-rw-r--r--sys/sys/socket.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/sys/sys/socket.h b/sys/sys/socket.h
index 9548b7b643f..25c3ef5698d 100644
--- a/sys/sys/socket.h
+++ b/sys/sys/socket.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: socket.h,v 1.19 1997/11/30 18:50:17 millert Exp $ */
+/* $OpenBSD: socket.h,v 1.20 1999/01/10 02:44:33 deraadt Exp $ */
/* $NetBSD: socket.h,v 1.14 1996/02/09 18:25:36 christos Exp $ */
/*
@@ -69,14 +69,15 @@
/*
* Additional options, not kept in so_options.
*/
-#define SO_SNDBUF 0x1001 /* send buffer size */
-#define SO_RCVBUF 0x1002 /* receive buffer size */
-#define SO_SNDLOWAT 0x1003 /* send low-water mark */
-#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
-#define SO_SNDTIMEO 0x1005 /* send timeout */
-#define SO_RCVTIMEO 0x1006 /* receive timeout */
+#define SO_SNDBUF 0x1001 /* send buffer size */
+#define SO_RCVBUF 0x1002 /* receive buffer size */
+#define SO_SNDLOWAT 0x1003 /* send low-water mark */
+#define SO_RCVLOWAT 0x1004 /* receive low-water mark */
+#define SO_SNDTIMEO 0x1005 /* send timeout */
+#define SO_RCVTIMEO 0x1006 /* receive timeout */
#define SO_ERROR 0x1007 /* get error status and clear */
#define SO_TYPE 0x1008 /* get socket type */
+#define SO_NETPROC 0x1020 /* multiplex; network processing */
/*
* Structure used for manipulating linger option.
@@ -311,6 +312,15 @@ struct cmsghdr {
#define CMSG_FIRSTHDR(mhdr) ((struct cmsghdr *)(mhdr)->msg_control)
+/* Round len up to next alignment boundary */
+#define CMSG_ALIGN(len) (((len)+sizeof(long)-1) & ~(sizeof(long)-1))
+
+/* Length of the contents of a control message of length len */
+#define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
+
+/* Length of the space taken up by a padded control message of length len */
+#define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
+
/* "Socket"-level control message types: */
#define SCM_RIGHTS 0x01 /* access rights (array of int) */