summaryrefslogtreecommitdiff
path: root/vendor/github.com/vishvananda/netlink/link.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/vishvananda/netlink/link.go')
-rw-r--r--vendor/github.com/vishvananda/netlink/link.go126
1 files changed, 98 insertions, 28 deletions
diff --git a/vendor/github.com/vishvananda/netlink/link.go b/vendor/github.com/vishvananda/netlink/link.go
index 4e77037b5..fe74ffab9 100644
--- a/vendor/github.com/vishvananda/netlink/link.go
+++ b/vendor/github.com/vishvananda/netlink/link.go
@@ -3,6 +3,7 @@ package netlink
import (
"fmt"
"net"
+ "os"
)
// Link represents a link device from netlink. Shared link attributes
@@ -37,6 +38,9 @@ type LinkAttrs struct {
EncapType string
Protinfo *Protinfo
OperState LinkOperState
+ NetNsID int
+ NumTxQueues int
+ NumRxQueues int
}
// LinkOperState represents the values of the IFLA_OPERSTATE link
@@ -258,6 +262,9 @@ const (
type Macvlan struct {
LinkAttrs
Mode MacvlanMode
+
+ // MACAddrs is only populated for Macvlan SOURCE links
+ MACAddrs []net.HardwareAddr
}
func (macvlan *Macvlan) Attrs() *LinkAttrs {
@@ -283,8 +290,10 @@ type TuntapFlag uint16
// Tuntap links created via /dev/tun/tap, but can be destroyed via netlink
type Tuntap struct {
LinkAttrs
- Mode TuntapMode
- Flags TuntapFlag
+ Mode TuntapMode
+ Flags TuntapFlag
+ Queues int
+ Fds []*os.File
}
func (tuntap *Tuntap) Attrs() *LinkAttrs {
@@ -326,26 +335,28 @@ func (generic *GenericLink) Type() string {
type Vxlan struct {
LinkAttrs
- VxlanId int
- VtepDevIndex int
- SrcAddr net.IP
- Group net.IP
- TTL int
- TOS int
- Learning bool
- Proxy bool
- RSC bool
- L2miss bool
- L3miss bool
- UDPCSum bool
- NoAge bool
- GBP bool
- FlowBased bool
- Age int
- Limit int
- Port int
- PortLow int
- PortHigh int
+ VxlanId int
+ VtepDevIndex int
+ SrcAddr net.IP
+ Group net.IP
+ TTL int
+ TOS int
+ Learning bool
+ Proxy bool
+ RSC bool
+ L2miss bool
+ L3miss bool
+ UDPCSum bool
+ UDP6ZeroCSumTx bool
+ UDP6ZeroCSumRx bool
+ NoAge bool
+ GBP bool
+ FlowBased bool
+ Age int
+ Limit int
+ Port int
+ PortLow int
+ PortHigh int
}
func (vxlan *Vxlan) Attrs() *LinkAttrs {
@@ -694,17 +705,25 @@ func (gretap *Gretap) Attrs() *LinkAttrs {
}
func (gretap *Gretap) Type() string {
+ if gretap.Local.To4() == nil {
+ return "ip6gretap"
+ }
return "gretap"
}
type Iptun struct {
LinkAttrs
- Ttl uint8
- Tos uint8
- PMtuDisc uint8
- Link uint32
- Local net.IP
- Remote net.IP
+ Ttl uint8
+ Tos uint8
+ PMtuDisc uint8
+ Link uint32
+ Local net.IP
+ Remote net.IP
+ EncapSport uint16
+ EncapDport uint16
+ EncapType uint16
+ EncapFlags uint16
+ FlowBased bool
}
func (iptun *Iptun) Attrs() *LinkAttrs {
@@ -715,6 +734,28 @@ func (iptun *Iptun) Type() string {
return "ipip"
}
+type Sittun struct {
+ LinkAttrs
+ Link uint32
+ Local net.IP
+ Remote net.IP
+ Ttl uint8
+ Tos uint8
+ PMtuDisc uint8
+ EncapType uint16
+ EncapFlags uint16
+ EncapSport uint16
+ EncapDport uint16
+}
+
+func (sittun *Sittun) Attrs() *LinkAttrs {
+ return &sittun.LinkAttrs
+}
+
+func (sittun *Sittun) Type() string {
+ return "sit"
+}
+
type Vti struct {
LinkAttrs
IKey uint32
@@ -732,6 +773,35 @@ func (iptun *Vti) Type() string {
return "vti"
}
+type Gretun struct {
+ LinkAttrs
+ Link uint32
+ IFlags uint16
+ OFlags uint16
+ IKey uint32
+ OKey uint32
+ Local net.IP
+ Remote net.IP
+ Ttl uint8
+ Tos uint8
+ PMtuDisc uint8
+ EncapType uint16
+ EncapFlags uint16
+ EncapSport uint16
+ EncapDport uint16
+}
+
+func (gretun *Gretun) Attrs() *LinkAttrs {
+ return &gretun.LinkAttrs
+}
+
+func (gretun *Gretun) Type() string {
+ if gretun.Local.To4() == nil {
+ return "ip6gre"
+ }
+ return "gre"
+}
+
type Vrf struct {
LinkAttrs
Table uint32