From e3b113bbe6a423737ae98f42118ce9366e112e12 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 6 Apr 2020 16:27:27 +0200 Subject: [PATCH] unix: add nexthop types and consts Fixes golang/go#38249 Change-Id: Ie8149ac16d09e76d6c5aa4d47edd947a647c381f Reviewed-on: https://go-review.googlesource.com/c/sys/+/227357 Run-TryBot: Tobias Klauser Reviewed-by: Matt Layher Reviewed-by: Ian Lance Taylor TryBot-Result: Gobot Gobot --- unix/linux/types.go | 21 +++++++++++++++++++++ unix/ztypes_linux.go | 29 +++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/unix/linux/types.go b/unix/linux/types.go index 10f1ea46..8b7ed200 100644 --- a/unix/linux/types.go +++ b/unix/linux/types.go @@ -106,6 +106,7 @@ struct termios2 { #include #include #include +#include #include #include #include @@ -2303,3 +2304,23 @@ const ( type FsverityDigest C.struct_fsverity_digest type FsverityEnableArg C.struct_fsverity_enable_arg + +// nexthop + +type Nhmsg C.struct_nhmsg + +type NexthopGrp C.struct_nexthop_grp + +const ( + NHA_UNSPEC = C.NHA_UNSPEC + NHA_ID = C.NHA_ID + NHA_GROUP = C.NHA_GROUP + NHA_GROUP_TYPE = C.NHA_GROUP_TYPE + NHA_BLACKHOLE = C.NHA_BLACKHOLE + NHA_OIF = C.NHA_OIF + NHA_GATEWAY = C.NHA_GATEWAY + NHA_ENCAP_TYPE = C.NHA_ENCAP_TYPE + NHA_ENCAP = C.NHA_ENCAP + NHA_GROUPS = C.NHA_GROUPS + NHA_MASTER = C.NHA_MASTER +) diff --git a/unix/ztypes_linux.go b/unix/ztypes_linux.go index 781a5eae..1620ad06 100644 --- a/unix/ztypes_linux.go +++ b/unix/ztypes_linux.go @@ -2325,3 +2325,32 @@ type FsverityEnableArg struct { Sig_ptr uint64 _ [11]uint64 } + +type Nhmsg struct { + Family uint8 + Scope uint8 + Protocol uint8 + Resvd uint8 + Flags uint32 +} + +type NexthopGrp struct { + Id uint32 + Weight uint8 + Resvd1 uint8 + Resvd2 uint16 +} + +const ( + NHA_UNSPEC = 0x0 + NHA_ID = 0x1 + NHA_GROUP = 0x2 + NHA_GROUP_TYPE = 0x3 + NHA_BLACKHOLE = 0x4 + NHA_OIF = 0x5 + NHA_GATEWAY = 0x6 + NHA_ENCAP_TYPE = 0x7 + NHA_ENCAP = 0x8 + NHA_GROUPS = 0x9 + NHA_MASTER = 0xa +)