set_peer
Description:
If idx
is one past the last peer, the behavior is the same as
append_peer.
Otherwise, the peer will be at idx
and replace the peer instance at that index. Note that if a peer with the same public-key
exists on another index, then that peer will also be replaced. In that case, the number of peers will shrink by one (because the one at
idx
got replace and then one with the same public-key got removed). This also means, that the resulting index afterwards may be one
less than idx
(if another peer with a lower index was dropped).
Parameters:
this |
the SettingWireGuard instance |
peer |
the WireGuardPeer instance to set. This seals |
idx |
the index, in the range of 0 to the number of peers (including). That means, if |