Class: Nl::Linux::Wireguard::Messages::DoSetDeviceRequest
- Inherits:
-
Genl::Message
- Object
- Raw::Message
- Genl::Message
- Nl::Linux::Wireguard::Messages::DoSetDeviceRequest
- Defined in:
- nl-linux/generated/nl/linux/wireguard.rb
Overview
Set WireGuard device
This command should be called with a wgdevice set, containing one but
not both of ``WGDEVICE_A_IFINDEX`` and ``WGDEVICE_A_IFNAME``.
It is possible that the amount of configuration data exceeds that of the
maximum message length accepted by the kernel. In that case, several
messages should be sent one after another, with each successive one
filling in information not contained in the prior. Note that if
``WGDEVICE_F_REPLACE_PEERS`` is specified in the first message, it
probably should not be specified in fragments that come after, so that
the list of peers is only cleared the first time but appended after.
Likewise for peers, if ``WGPEER_F_REPLACE_ALLOWEDIPS`` is specified in
the first message of a peer, it likely should not be specified in
subsequent fragments.
If an error occurs, ``NLMSG_ERROR`` will reply containing an errno.
Requires CAP_NET_ADMIN in the user namespace owning the network namespace.
Constant Summary collapse
- TYPE =
1- FIXED_HEADER =
nil- ATTRIBUTE_SET =
AttributeSets::Wgdevice
- ATTRIBUTES =
Ractor.make_shareable(%i[ifindex ifname private_key public_key flags listen_port fwmark peers])
Instance Attribute Summary
Attributes included from StructuredPayload
Instance Method Summary collapse
-
#flags ⇒ Integer
0orWGDEVICE_F_REPLACE_PEERSif all current peers should be removed prior to adding the list below. -
#fwmark ⇒ Integer
Set as
0to disable. - #ifindex ⇒ Integer
- #ifname ⇒ String
-
#listen_port ⇒ Integer
Set as
0to choose randomly. -
#peers ⇒ Array<AttributeSets::Wgpeer>
The index/type parameter is unused on
SET_DEVICEoperations and is zero onGET_DEVICEoperations. -
#private_key ⇒ String
Set to all zeros to remove.
- #public_key ⇒ String
Methods inherited from Genl::Message
Methods inherited from Raw::Message
#append_attribute, decode, #initialize
Methods included from StructuredPayload
Constructor Details
This class inherits a constructor from Nl::Raw::Message
Instance Method Details
#flags ⇒ Integer
0 or WGDEVICE_F_REPLACE_PEERS if all current peers should be
removed prior to adding the list below.
Known flags are defined in Flags::WgdeviceFlags.
657 |
# File 'nl-linux/generated/nl/linux/wireguard.rb', line 657 def flags; attributes[:"flags"]&.value; end |
#fwmark ⇒ Integer
Set as 0 to disable.
667 |
# File 'nl-linux/generated/nl/linux/wireguard.rb', line 667 def fwmark; attributes[:"fwmark"]&.value; end |
#ifindex ⇒ Integer
635 |
# File 'nl-linux/generated/nl/linux/wireguard.rb', line 635 def ifindex; attributes[:"ifindex"]&.value; end |
#ifname ⇒ String
639 |
# File 'nl-linux/generated/nl/linux/wireguard.rb', line 639 def ifname; attributes[:"ifname"]&.value; end |
#listen_port ⇒ Integer
Set as 0 to choose randomly.
662 |
# File 'nl-linux/generated/nl/linux/wireguard.rb', line 662 def listen_port; attributes[:"listen_port"]&.value; end |
#peers ⇒ Array<AttributeSets::Wgpeer>
The index/type parameter is unused on SET_DEVICE operations and is
zero on GET_DEVICE operations.
673 |
# File 'nl-linux/generated/nl/linux/wireguard.rb', line 673 def peers; attributes[:"peers"]&.value; end |
#private_key ⇒ String
Set to all zeros to remove.
644 |
# File 'nl-linux/generated/nl/linux/wireguard.rb', line 644 def private_key; attributes[:"private_key"]&.value; end |
#public_key ⇒ String
648 |
# File 'nl-linux/generated/nl/linux/wireguard.rb', line 648 def public_key; attributes[:"public_key"]&.value; end |