unix: add Linux Kernel Connection Multiplexor types and constants

For details on KCM, see:
https://www.kernel.org/doc/Documentation/networking/kcm.txt.

Change-Id: I14ebf0aaad17f5a9078f027bd50e050c69b08981
Reviewed-on: https://go-review.googlesource.com/c/sys/+/348449
Trust: Matt Layher <mdlayher@gmail.com>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/unix/linux/types.go b/unix/linux/types.go
index dfd5e50..afbfae7 100644
--- a/unix/linux/types.go
+++ b/unix/linux/types.go
@@ -108,6 +108,7 @@
 #include <linux/if_pppox.h>
 #include <linux/if_xdp.h>
 #include <linux/ipc.h>
+#include <linux/kcm.h>
 #include <linux/keyctl.h>
 #include <linux/landlock.h>
 #include <linux/loop.h>
@@ -4043,3 +4044,11 @@
 	IFLA_CAN_DATA_BITRATE_CONST   = C.IFLA_CAN_DATA_BITRATE_CONST
 	IFLA_CAN_BITRATE_MAX          = C.IFLA_CAN_BITRATE_MAX
 )
+
+// Kernel connection multiplexor
+
+type KCMAttach C.struct_kcm_attach
+
+type KCMUnattach C.struct_kcm_unattach
+
+type KCMClone C.struct_kcm_clone
diff --git a/unix/mkerrors.sh b/unix/mkerrors.sh
index bcc0039..a037087 100755
--- a/unix/mkerrors.sh
+++ b/unix/mkerrors.sh
@@ -232,6 +232,7 @@
 #include <linux/if_packet.h>
 #include <linux/if_xdp.h>
 #include <linux/input.h>
+#include <linux/kcm.h>
 #include <linux/kexec.h>
 #include <linux/keyctl.h>
 #include <linux/landlock.h>
@@ -504,6 +505,7 @@
 		$2 ~ /^O?XTABS$/ ||
 		$2 ~ /^TC[IO](ON|OFF)$/ ||
 		$2 ~ /^IN_/ ||
+		$2 ~ /^KCM/ ||
 		$2 ~ /^LANDLOCK_/ ||
 		$2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||
 		$2 ~ /^LO_(KEY|NAME)_SIZE$/ ||
diff --git a/unix/zerrors_linux.go b/unix/zerrors_linux.go
index 5038341..bc7c9d0 100644
--- a/unix/zerrors_linux.go
+++ b/unix/zerrors_linux.go
@@ -1286,6 +1286,8 @@
 	IUTF8                                       = 0x4000
 	IXANY                                       = 0x800
 	JFFS2_SUPER_MAGIC                           = 0x72b6
+	KCMPROTO_CONNECTED                          = 0x0
+	KCM_RECV_DISABLE                            = 0x1
 	KEXEC_ARCH_386                              = 0x30000
 	KEXEC_ARCH_68K                              = 0x40000
 	KEXEC_ARCH_AARCH64                          = 0xb70000
@@ -2458,6 +2460,9 @@
 	SIOCGSTAMPNS                                = 0x8907
 	SIOCGSTAMPNS_OLD                            = 0x8907
 	SIOCGSTAMP_OLD                              = 0x8906
+	SIOCKCMATTACH                               = 0x89e0
+	SIOCKCMCLONE                                = 0x89e2
+	SIOCKCMUNATTACH                             = 0x89e1
 	SIOCOUTQNSD                                 = 0x894b
 	SIOCPROTOPRIVATE                            = 0x89e0
 	SIOCRTMSG                                   = 0x890d
diff --git a/unix/ztypes_linux.go b/unix/ztypes_linux.go
index 27f7d7a..e6a8d88 100644
--- a/unix/ztypes_linux.go
+++ b/unix/ztypes_linux.go
@@ -4145,3 +4145,16 @@
 	IFLA_CAN_DATA_BITRATE_CONST   = 0xe
 	IFLA_CAN_BITRATE_MAX          = 0xf
 )
+
+type KCMAttach struct {
+	Fd     int32
+	Bpf_fd int32
+}
+
+type KCMUnattach struct {
+	Fd int32
+}
+
+type KCMClone struct {
+	Fd int32
+}