2021-09-20 21:57:12 +03:00
|
|
|
// Copyright 2021 Microsoft. All rights reserved.
|
|
|
|
// MIT License
|
|
|
|
|
2021-09-23 03:28:50 +03:00
|
|
|
package netlink
|
2021-09-20 21:57:12 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"net"
|
|
|
|
)
|
|
|
|
|
|
|
|
type NetlinkInterface interface {
|
2021-09-23 03:28:50 +03:00
|
|
|
AddLink(link Link) error
|
2021-09-20 21:57:12 +03:00
|
|
|
DeleteLink(name string) error
|
|
|
|
SetLinkName(name string, newName string) error
|
|
|
|
SetLinkState(name string, up bool) error
|
2021-09-23 03:28:50 +03:00
|
|
|
SetLinkMTU(name string, mtu int) error
|
2021-09-20 21:57:12 +03:00
|
|
|
SetLinkMaster(name string, master string) error
|
|
|
|
SetLinkNetNs(name string, fd uintptr) error
|
|
|
|
SetLinkAddress(ifName string, hwAddress net.HardwareAddr) error
|
|
|
|
SetLinkPromisc(ifName string, on bool) error
|
|
|
|
SetLinkHairpin(bridgeName string, on bool) error
|
2022-08-17 20:53:57 +03:00
|
|
|
SetOrRemoveLinkAddress(linkInfo LinkInfo, mode, linkState int) error
|
2021-09-20 21:57:12 +03:00
|
|
|
AddIPAddress(ifName string, ipAddress net.IP, ipNet *net.IPNet) error
|
|
|
|
DeleteIPAddress(ifName string, ipAddress net.IP, ipNet *net.IPNet) error
|
2021-09-23 03:28:50 +03:00
|
|
|
GetIPRoute(filter *Route) ([]*Route, error)
|
|
|
|
AddIPRoute(route *Route) error
|
|
|
|
DeleteIPRoute(route *Route) error
|
2021-09-20 21:57:12 +03:00
|
|
|
}
|