Skip to content

Commit 71a906e

Browse files
jwhitedgopherbot
authored andcommitted
unix/linux: add TUN flags and virtio_net_hdr constants
Change-Id: I10c86c100f4db77740eff6f07d91d6489b21b6f8 GitHub-Last-Rev: 3e8d734 GitHub-Pull-Request: #148 Reviewed-on: https://go-review.googlesource.com/c/sys/+/468656 Run-TryBot: Brad Fitzpatrick <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 2977c77 commit 71a906e

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed

unix/linux/types.go

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ struct termios2 {
110110
#include <linux/if_bridge.h>
111111
#include <linux/if_packet.h>
112112
#include <linux/if_pppox.h>
113+
#include <linux/if_tun.h>
113114
#include <linux/if_xdp.h>
114115
#include <linux/ipc.h>
115116
#include <linux/kcm.h>
@@ -141,9 +142,10 @@ struct termios2 {
141142
#include <linux/stat.h>
142143
#include <linux/taskstats.h>
143144
#include <linux/tipc.h>
145+
#include <linux/virtio_net.h>
146+
#include <linux/vm_sockets.h>
144147
#include <linux/watchdog.h>
145148
#include <linux/wireguard.h>
146-
#include <linux/vm_sockets.h>
147149
148150
#include <mtd/mtd-user.h>
149151
@@ -5666,3 +5668,31 @@ const (
56665668
AUDIT_NLGRP_NONE = C.AUDIT_NLGRP_NONE
56675669
AUDIT_NLGRP_READLOG = C.AUDIT_NLGRP_READLOG
56685670
)
5671+
5672+
// generated by:
5673+
// perl -nlE '/^#define (TUN_F_\w+)/ && say "$1 = C.$1"' include/uapi/linux/if_tun.h
5674+
const (
5675+
TUN_F_CSUM = C.TUN_F_CSUM
5676+
TUN_F_TSO4 = C.TUN_F_TSO4
5677+
TUN_F_TSO6 = C.TUN_F_TSO6
5678+
TUN_F_TSO_ECN = C.TUN_F_TSO_ECN
5679+
TUN_F_UFO = C.TUN_F_UFO
5680+
)
5681+
5682+
// generated by:
5683+
// perl -nlE '/^#define (VIRTIO_NET_HDR_F_\w+)/ && say "$1 = C.$1"' include/uapi/linux/virtio_net.h
5684+
const (
5685+
VIRTIO_NET_HDR_F_NEEDS_CSUM = C.VIRTIO_NET_HDR_F_NEEDS_CSUM
5686+
VIRTIO_NET_HDR_F_DATA_VALID = C.VIRTIO_NET_HDR_F_DATA_VALID
5687+
VIRTIO_NET_HDR_F_RSC_INFO = C.VIRTIO_NET_HDR_F_RSC_INFO
5688+
)
5689+
5690+
// generated by:
5691+
// perl -nlE '/^#define (VIRTIO_NET_HDR_GSO_\w+)/ && say "$1 = C.$1"' include/uapi/linux/virtio_net.h
5692+
const (
5693+
VIRTIO_NET_HDR_GSO_NONE = C.VIRTIO_NET_HDR_GSO_NONE
5694+
VIRTIO_NET_HDR_GSO_TCPV4 = C.VIRTIO_NET_HDR_GSO_TCPV4
5695+
VIRTIO_NET_HDR_GSO_UDP = C.VIRTIO_NET_HDR_GSO_UDP
5696+
VIRTIO_NET_HDR_GSO_TCPV6 = C.VIRTIO_NET_HDR_GSO_TCPV6
5697+
VIRTIO_NET_HDR_GSO_ECN = C.VIRTIO_NET_HDR_GSO_ECN
5698+
)

unix/ztypes_linux.go

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)