File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -729,6 +729,7 @@ impl LinkAddRequest {
729729 /// Create xfrm tunnel
730730 /// This is equivalent to `ip link add name NAME type xfrm if_id NUMBER`,
731731 /// The NUMBER is a XFRM if_id which may be connected to IPsec policy
732+ #[ deprecated( note = "Please use `xfrmtun_link` instead" ) ]
732733 pub fn xfrmtun ( self , name : String , ifid : u32 ) -> Self {
733734 self . name ( name)
734735 . link_info (
@@ -738,6 +739,24 @@ impl LinkAddRequest {
738739 . up ( )
739740 }
740741
742+ /// Create xfrm tunnel
743+ /// This is equivalent to `ip link add name NAME type xfrm if_id NUMBER dev
744+ /// LINK`. The NUMBER is a XFRM if_id which may be connected to IPsec
745+ /// policy. The LINK is the underlying link ID to attach the tunnel to,
746+ /// but instead of specifying a link name (`LINK`), we specify a link
747+ /// index. A LINK of `0` can be used to specify `NONE`.
748+ pub fn xfrmtun_link ( self , name : String , ifid : u32 , link : u32 ) -> Self {
749+ self . name ( name)
750+ . link_info (
751+ InfoKind :: Xfrm ,
752+ Some ( InfoData :: Xfrm ( vec ! [
753+ InfoXfrm :: IfId ( ifid) ,
754+ InfoXfrm :: Link ( link) ,
755+ ] ) ) ,
756+ )
757+ . up ( )
758+ }
759+
741760 /// Create a new bond.
742761 /// This is equivalent to `ip link add link NAME type bond`.
743762 pub fn bond ( self , name : String ) -> BondAddRequest {
You can’t perform that action at this time.
0 commit comments