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 <tobias.klauser@gmail.com>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Tobias Klauser
2020-04-06 16:27:27 +02:00
committed by Tobias Klauser
parent c6e801f48b
commit e3b113bbe6
2 changed files with 50 additions and 0 deletions

View File

@@ -106,6 +106,7 @@ struct termios2 {
#include <linux/netfilter/nfnetlink.h>
#include <linux/netfilter.h>
#include <linux/netlink.h>
#include <linux/nexthop.h>
#include <linux/openat2.h>
#include <linux/perf_event.h>
#include <linux/random.h>
@@ -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
)

View File

@@ -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
)