mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
344b093258
full diffs: -fc5a7d91d5...62a13ae87c
-b2de5d10e3
...v1.0.0 -604eaf189e
...13995c7128ccc8e51e9a6bd2b551020a27180abd notable changes in libnetwork: - docker/libnetwork#2366 Bump vishvananda/netlink to 1.0.0 - docker/libnetwork#2339 controller: Check if IPTables is enabled for arrangeUserFilterRule - addresses docker/libnetwork#2158 dockerd when run with --iptables=false modifies iptables by adding DOCKER-USER - addresses moby/moby#35777 With iptables=false dockerd still creates DOCKER-USER chain and rules - addresses docker/for-linux#136 dockerd --iptables=false adds DOCKER-USER chain and modify FORWARD chain anyway - docker/libnetwork#2394 Make DNS records and queries case-insensitive - addresses moby/moby#28689 Embedded DNS is case-sensitive - addresses moby/moby#21169 hostnames with new networking are case-sensitive Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
42 lines
831 B
Go
42 lines
831 B
Go
package netlink
|
|
|
|
import (
|
|
"fmt"
|
|
"net"
|
|
)
|
|
|
|
// Rule represents a netlink rule.
|
|
type Rule struct {
|
|
Priority int
|
|
Family int
|
|
Table int
|
|
Mark int
|
|
Mask int
|
|
TunID uint
|
|
Goto int
|
|
Src *net.IPNet
|
|
Dst *net.IPNet
|
|
Flow int
|
|
IifName string
|
|
OifName string
|
|
SuppressIfgroup int
|
|
SuppressPrefixlen int
|
|
Invert bool
|
|
}
|
|
|
|
func (r Rule) String() string {
|
|
return fmt.Sprintf("ip rule %d: from %s table %d", r.Priority, r.Src, r.Table)
|
|
}
|
|
|
|
// NewRule return empty rules.
|
|
func NewRule() *Rule {
|
|
return &Rule{
|
|
SuppressIfgroup: -1,
|
|
SuppressPrefixlen: -1,
|
|
Priority: -1,
|
|
Mark: -1,
|
|
Mask: -1,
|
|
Goto: -1,
|
|
Flow: -1,
|
|
}
|
|
}
|