Skip to content

Commit 6dfb94e

Browse files
florianlgopherbot
authored andcommitted
unix: add types for SOCK_DIAG
Change-Id: Ifcc90735b6e42b6c9971d4ba15c31b8169e005fe Reviewed-on: https://go-review.googlesource.com/c/sys/+/579996 Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 7d69d98 commit 6dfb94e

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed

unix/linux/types.go

+31
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ struct termios2 {
143143
#include <linux/sched/types.h>
144144
#undef kernel_sched_param
145145
#include <linux/shm.h>
146+
#include <linux/sock_diag.h>
146147
#include <linux/socket.h>
147148
#include <linux/stat.h>
148149
#include <linux/taskstats.h>
@@ -5917,3 +5918,33 @@ const SizeofSchedAttr = C.sizeof_struct_sched_attr
59175918

59185919
type Cachestat_t C.struct_cachestat
59195920
type CachestatRange C.struct_cachestat_range
5921+
5922+
// generated by:
5923+
// $ perl -nlE '/^\s*((SK_|SKNLGRP_)\w+)/ && say "$1 = C.$1"' /usr/include/linux/sock_diag.h
5924+
const (
5925+
SK_MEMINFO_RMEM_ALLOC = C.SK_MEMINFO_RMEM_ALLOC
5926+
SK_MEMINFO_RCVBUF = C.SK_MEMINFO_RCVBUF
5927+
SK_MEMINFO_WMEM_ALLOC = C.SK_MEMINFO_WMEM_ALLOC
5928+
SK_MEMINFO_SNDBUF = C.SK_MEMINFO_SNDBUF
5929+
SK_MEMINFO_FWD_ALLOC = C.SK_MEMINFO_FWD_ALLOC
5930+
SK_MEMINFO_WMEM_QUEUED = C.SK_MEMINFO_WMEM_QUEUED
5931+
SK_MEMINFO_OPTMEM = C.SK_MEMINFO_OPTMEM
5932+
SK_MEMINFO_BACKLOG = C.SK_MEMINFO_BACKLOG
5933+
SK_MEMINFO_DROPS = C.SK_MEMINFO_DROPS
5934+
SK_MEMINFO_VARS = C.SK_MEMINFO_VARS
5935+
SKNLGRP_NONE = C.SKNLGRP_NONE
5936+
SKNLGRP_INET_TCP_DESTROY = C.SKNLGRP_INET_TCP_DESTROY
5937+
SKNLGRP_INET_UDP_DESTROY = C.SKNLGRP_INET_UDP_DESTROY
5938+
SKNLGRP_INET6_TCP_DESTROY = C.SKNLGRP_INET6_TCP_DESTROY
5939+
SKNLGRP_INET6_UDP_DESTROY = C.SKNLGRP_INET6_UDP_DESTROY
5940+
SK_DIAG_BPF_STORAGE_REQ_NONE = C.SK_DIAG_BPF_STORAGE_REQ_NONE
5941+
SK_DIAG_BPF_STORAGE_REQ_MAP_FD = C.SK_DIAG_BPF_STORAGE_REQ_MAP_FD
5942+
SK_DIAG_BPF_STORAGE_REP_NONE = C.SK_DIAG_BPF_STORAGE_REP_NONE
5943+
SK_DIAG_BPF_STORAGE = C.SK_DIAG_BPF_STORAGE
5944+
SK_DIAG_BPF_STORAGE_NONE = C.SK_DIAG_BPF_STORAGE_NONE
5945+
SK_DIAG_BPF_STORAGE_PAD = C.SK_DIAG_BPF_STORAGE_PAD
5946+
SK_DIAG_BPF_STORAGE_MAP_ID = C.SK_DIAG_BPF_STORAGE_MAP_ID
5947+
SK_DIAG_BPF_STORAGE_MAP_VALUE = C.SK_DIAG_BPF_STORAGE_MAP_VALUE
5948+
)
5949+
5950+
type SockDiagReq C.struct_sock_diag_req

unix/mkerrors.sh

+2
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ struct ltchars {
263263
#include <linux/sched.h>
264264
#include <linux/seccomp.h>
265265
#include <linux/serial.h>
266+
#include <linux/sock_diag.h>
266267
#include <linux/sockios.h>
267268
#include <linux/taskstats.h>
268269
#include <linux/tipc.h>
@@ -549,6 +550,7 @@ ccflags="$@"
549550
$2 !~ "NLA_TYPE_MASK" &&
550551
$2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ &&
551552
$2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ ||
553+
$2 ~ /^SOCK_|SK_DIAG_|SKNLGRP_$/ ||
552554
$2 ~ /^FIORDCHK$/ ||
553555
$2 ~ /^SIOC/ ||
554556
$2 ~ /^TIOC/ ||

unix/zerrors_linux.go

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix/ztypes_linux.go

+31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)