Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
API BREAK
To remove the duplicate error of
LinkAddRequest
andLinkSetRequest
,this patch introduce
LinkMessageBuilder
to generateLinkMessage
forlink handlers to use.
The
impl LinkMessageBuilder<T>
holds the common functions available for allinterface types.
The
impl LinkMessageBuilder<LinkVlan>
holds VLAN specific functions.The LinkMessageBuilder is designed for advanced user, wrapper functions
are created for common use cases. For example, to create a VLAN
interface:
These patches included these new structures to generate matching
LinkMessageBuilder:
LinkUnspec
(for matching existing interface)LinkDummy
LinkVeth
LinkVlan
LinkVxlan
LinkMacVlan
LinkMacVtap
LinkWireguard
LinkBondPort
Special note:
Due to confliction, the previous VxLAN
link()
function changed todev()
. Thelink()
is the share function for all interface types. TheAPI is matching with
ip link
command line option for vxlan.Please check
examples/create_vxlan.rs
for usage.The
LinkHandler::set_bond_port()
changed toLinkHandler::set_port()
, please checkexamples/set_bond_port.rs
for usage.
The
message_mut()
function is removed fromLinkSetRequest
andLinkAddRequest
, user should modify the LinkMessage before sent tohandler.