params_linux.go 1.7 KB

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