Skip to content

Commit

Permalink
unix: add types for SOCK_DIAG
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
florianl authored and gopherbot committed May 6, 2024
1 parent 7d69d98 commit 6dfb94e
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 0 deletions.
31 changes: 31 additions & 0 deletions unix/linux/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ struct termios2 {
#include <linux/sched/types.h>
#undef kernel_sched_param
#include <linux/shm.h>
#include <linux/sock_diag.h>
#include <linux/socket.h>
#include <linux/stat.h>
#include <linux/taskstats.h>
Expand Down Expand Up @@ -5917,3 +5918,33 @@ const SizeofSchedAttr = C.sizeof_struct_sched_attr

type Cachestat_t C.struct_cachestat
type CachestatRange C.struct_cachestat_range

// generated by:
// $ perl -nlE '/^\s*((SK_|SKNLGRP_)\w+)/ && say "$1 = C.$1"' /usr/include/linux/sock_diag.h
const (
SK_MEMINFO_RMEM_ALLOC = C.SK_MEMINFO_RMEM_ALLOC
SK_MEMINFO_RCVBUF = C.SK_MEMINFO_RCVBUF
SK_MEMINFO_WMEM_ALLOC = C.SK_MEMINFO_WMEM_ALLOC
SK_MEMINFO_SNDBUF = C.SK_MEMINFO_SNDBUF
SK_MEMINFO_FWD_ALLOC = C.SK_MEMINFO_FWD_ALLOC
SK_MEMINFO_WMEM_QUEUED = C.SK_MEMINFO_WMEM_QUEUED
SK_MEMINFO_OPTMEM = C.SK_MEMINFO_OPTMEM
SK_MEMINFO_BACKLOG = C.SK_MEMINFO_BACKLOG
SK_MEMINFO_DROPS = C.SK_MEMINFO_DROPS
SK_MEMINFO_VARS = C.SK_MEMINFO_VARS
SKNLGRP_NONE = C.SKNLGRP_NONE
SKNLGRP_INET_TCP_DESTROY = C.SKNLGRP_INET_TCP_DESTROY
SKNLGRP_INET_UDP_DESTROY = C.SKNLGRP_INET_UDP_DESTROY
SKNLGRP_INET6_TCP_DESTROY = C.SKNLGRP_INET6_TCP_DESTROY
SKNLGRP_INET6_UDP_DESTROY = C.SKNLGRP_INET6_UDP_DESTROY
SK_DIAG_BPF_STORAGE_REQ_NONE = C.SK_DIAG_BPF_STORAGE_REQ_NONE
SK_DIAG_BPF_STORAGE_REQ_MAP_FD = C.SK_DIAG_BPF_STORAGE_REQ_MAP_FD
SK_DIAG_BPF_STORAGE_REP_NONE = C.SK_DIAG_BPF_STORAGE_REP_NONE
SK_DIAG_BPF_STORAGE = C.SK_DIAG_BPF_STORAGE
SK_DIAG_BPF_STORAGE_NONE = C.SK_DIAG_BPF_STORAGE_NONE
SK_DIAG_BPF_STORAGE_PAD = C.SK_DIAG_BPF_STORAGE_PAD
SK_DIAG_BPF_STORAGE_MAP_ID = C.SK_DIAG_BPF_STORAGE_MAP_ID
SK_DIAG_BPF_STORAGE_MAP_VALUE = C.SK_DIAG_BPF_STORAGE_MAP_VALUE
)

type SockDiagReq C.struct_sock_diag_req
2 changes: 2 additions & 0 deletions unix/mkerrors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ struct ltchars {
#include <linux/sched.h>
#include <linux/seccomp.h>
#include <linux/serial.h>
#include <linux/sock_diag.h>
#include <linux/sockios.h>
#include <linux/taskstats.h>
#include <linux/tipc.h>
Expand Down Expand Up @@ -549,6 +550,7 @@ ccflags="$@"
$2 !~ "NLA_TYPE_MASK" &&
$2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ &&
$2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ ||
$2 ~ /^SOCK_|SK_DIAG_|SKNLGRP_$/ ||
$2 ~ /^FIORDCHK$/ ||
$2 ~ /^SIOC/ ||
$2 ~ /^TIOC/ ||
Expand Down
4 changes: 4 additions & 0 deletions unix/zerrors_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions unix/ztypes_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6dfb94e

Please sign in to comment.