Documentation ¶
Overview ¶
Package xnet contains low level Linux networking calls (generally related to netlink and tunneling)
Index ¶
Constants ¶
const ( // SIGRPriority is the metric to use when inserting routes in the Linux routing table. // This follows the convention of FRR, where BGP routes are inserted with a metric // equal to the administrative distance (in the case of BGP, this would be 20). // For Gateway routes, the administrative distance is 15, hence the priority. SIGRPriority = 15 SIGTxQlen = 1000 )
Variables ¶
This section is empty.
Functions ¶
func Open ¶ added in v0.7.0
Open creates a new DeviceHandle backed by a Linux network interface of type tun. The interface will have the specified name.
func UseNameResolver ¶ added in v0.7.0
func UseNameResolver(namer func(addr.IA) string, opener DeviceOpener) control.DeviceOpener
UseNameResolver constructs a control.DeviceOpener implementation that opens Linux devices with names resolved using the selected naming function.
Types ¶
type DeviceOpener ¶ added in v0.7.0
DeviceOpener opens Linux tunnels.
func OpenerWithOptions ¶ added in v0.7.0
func OpenerWithOptions(ctx context.Context, options ...DeviceOption) DeviceOpener
OpenerWithOptions returns an Open implementation with the desired options attached.
type DeviceOpenerFunc ¶ added in v0.7.0
type DeviceOption ¶ added in v0.7.0
type DeviceOption func(*deviceOptions)
func WithRoutingOnlyNoCreate ¶ added in v0.7.0
func WithRoutingOnlyNoCreate() DeviceOption
WithRoutingOnlyNoCreate signals to create a device handle that supports routing but reading and writing return errors. This can be used for implementations where data-plane forwarding is done by other applications. The device must already exist, and an error will be returned if it does not.