github.com/borderzero/water@v0.0.1/params_linux.go (about) 1 package water 2 3 // DevicePermissions determines the owner and group owner for the newly created 4 // interface. 5 type DevicePermissions struct { 6 // Owner is the ID of the user which will be granted ownership of the 7 // device. If set to a negative value, the owner value will not be 8 // changed. By default, Linux sets the owner to -1, which allows any user. 9 Owner uint 10 11 // Group is the ID of the group which will be granted access to the device. 12 // If set to a negative value, the group value will not be changed. By 13 // default, Linux sets the group to -1, which allows any group. 14 Group uint 15 } 16 17 // PlatformSpecificParams defines parameters in Config that are specific to 18 // Linux. A zero-value of such type is valid, yielding an interface 19 // with OS defined name. 20 type PlatformSpecificParams struct { 21 // Name is the name to be set for the interface to be created. This overrides 22 // the default name assigned by OS such as tap0 or tun0. A zero-value of this 23 // field, i.e. an empty string, indicates that the default name should be 24 // used. 25 Name string 26 27 // Persist specifies whether persistence mode for the interface device 28 // should be enabled or disabled. 29 Persist bool 30 31 // Permissions, if non-nil, specifies the owner and group owner for the 32 // interface. A zero-value of this field, i.e. nil, indicates that no 33 // changes to owner or group will be made. 34 Permissions *DevicePermissions 35 36 // MultiQueue specifies whether the multiqueue flag should be set on the 37 // interface. From version 3.8, Linux supports multiqueue tuntap which can 38 // uses multiple file descriptors (queues) to parallelize packets sending 39 // or receiving. 40 MultiQueue bool 41 } 42 43 func defaultPlatformSpecificParams() PlatformSpecificParams { 44 return PlatformSpecificParams{} 45 }