Documentation
¶
Index ¶
- type SwiftInterface
- func (a *SwiftInterface) AddRoute(route *netlink.Route) error
- func (a *SwiftInterface) AppendRoute(route *netlink.Route) error
- func (a *SwiftInterface) ChangeRoute(route *netlink.Route) error
- func (a *SwiftInterface) Close() error
- func (a *SwiftInterface) GetAdapterIndex() (int, error)
- func (a *SwiftInterface) GetAdapterName() (string, error)
- func (a *SwiftInterface) GetFD() *os.File
- func (a *SwiftInterface) RemoveRoute(route *netlink.Route) error
- func (a *SwiftInterface) ReplaceRoute(route *netlink.Route) error
- func (a *SwiftInterface) RouteList(family int) ([]netlink.Route, error)
- func (a *SwiftInterface) SetDNS(_ *swiftypes.DNSConfig) error
- func (a *SwiftInterface) SetMTU(mtu int) error
- func (a *SwiftInterface) SetStatus(status swiftypes.InterfaceStatus) error
- func (a *SwiftInterface) SetUnicastIpAddressEntry(config *swiftypes.UnicastConfig) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SwiftInterface ¶
type SwiftInterface struct {
io.ReadWriteCloser
// contains filtered or unexported fields
}
SwiftInterface represents a Linux TUN/TAP device.
func NewSwiftInterface ¶
func NewSwiftInterface(config *swiftconfig.Config) (*SwiftInterface, error)
NewSwiftInterface opens /dev/net/tun and initializes the SwiftInterface.
func (*SwiftInterface) AddRoute ¶
func (a *SwiftInterface) AddRoute(route *netlink.Route) error
AddRoute adds a network route via the current interface.
func (*SwiftInterface) AppendRoute ¶
func (a *SwiftInterface) AppendRoute(route *netlink.Route) error
AppendRoute append a network route via the current interface.
func (*SwiftInterface) ChangeRoute ¶
func (a *SwiftInterface) ChangeRoute(route *netlink.Route) error
ChangeRoute change a network route via the current interface.
func (*SwiftInterface) Close ¶
func (a *SwiftInterface) Close() error
func (*SwiftInterface) GetAdapterIndex ¶
func (a *SwiftInterface) GetAdapterIndex() (int, error)
GetAdapterIndex retrieves the system-wide link index of the interface.
func (*SwiftInterface) GetAdapterName ¶
func (a *SwiftInterface) GetAdapterName() (string, error)
GetAdapterName returns the current name of the Unix interface.
func (*SwiftInterface) GetFD ¶
func (a *SwiftInterface) GetFD() *os.File
GetFD returns the underlying OS file pointer.
func (*SwiftInterface) RemoveRoute ¶
func (a *SwiftInterface) RemoveRoute(route *netlink.Route) error
RemoveRoute remove a network route via the current interface.
func (*SwiftInterface) ReplaceRoute ¶
func (a *SwiftInterface) ReplaceRoute(route *netlink.Route) error
ReplaceRoute replace a network route via the current interface.
func (*SwiftInterface) RouteList ¶
func (a *SwiftInterface) RouteList(family int) ([]netlink.Route, error)
RouteList remove a network route via the current interface.
func (*SwiftInterface) SetDNS ¶
func (a *SwiftInterface) SetDNS(_ *swiftypes.DNSConfig) error
SetDNS is currently unsupported on Unix-like SwiftInterfaces.
func (*SwiftInterface) SetMTU ¶
func (a *SwiftInterface) SetMTU(mtu int) error
SetMTU updates the Maximum Transmission Unit for the Unix interface.
func (*SwiftInterface) SetStatus ¶
func (a *SwiftInterface) SetStatus(status swiftypes.InterfaceStatus) error
SetStatus toggles the interface between Up and Down states.
func (*SwiftInterface) SetUnicastIpAddressEntry ¶
func (a *SwiftInterface) SetUnicastIpAddressEntry(config *swiftypes.UnicastConfig) error
SetUnicastIpAddressEntry assigns an IP address and optional gateway to the interface.