Documentation ¶
Overview ¶
Provides a high-level library for manipulating network interfaces, links, and routes. Splice provides a unified interface for multiple operating systems.
Index ¶
- func AddressAdd(intf *net.Interface, address *net.IPNet) error
- func AddressDelete(intf *net.Interface, address *net.IPNet) error
- func AddressList(intf *net.Interface) ([]*net.IPNet, error)
- func LinkBringDown(intf *net.Interface) error
- func LinkBringUp(intf *net.Interface) error
- func RouteAddViaGateway(destination *net.IPNet, gateway net.IP) error
- func RouteAddViaInterface(destination *net.IPNet, intf *net.Interface) error
- func RouteExistsTo(destination net.IP) bool
- func RouteHasEntry(destination *net.IPNet) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddressAdd ¶
Adds an IP address to an interface. This is equivalent to 'ip address add <address> dev <intf.Name>'
func AddressDelete ¶
Removes an IP address from an interface. This is equivalent to 'ip address del <address> dev <intf.Name>'
func AddressList ¶
Returns a list of IP addresses configured on the given interface. This is equivalent to 'ip address show <interface>'
func LinkBringDown ¶
Administratively brings down the given network interface.
func LinkBringUp ¶
Administratively brings up the given network interface.
func RouteAddViaGateway ¶
Adds a new route to the given IP network, routed by the given gateway. This is equivalent to 'ip route add <destination> via <gateway>'.
func RouteAddViaInterface ¶
Adds a new route to the given IP network, send out the given interface. This is equivalent to 'ip route add <destination> dev <intf.Name>'.
func RouteExistsTo ¶
Determines if a route to the destination IP is available. This will always return true if a default route exists, regardless if the gateway can actually reach the destination.
func RouteHasEntry ¶
Determines if the routing table has a specific entry for the given destination network.
Types ¶
This section is empty.