@@ -9,9 +9,9 @@ use netlink_packet_utils::{
99
1010use super :: super :: {
1111 InfoBond , InfoBridge , InfoGreTap , InfoGreTap6 , InfoGreTun , InfoGreTun6 ,
12- InfoGtp , InfoHsr , InfoIpVlan , InfoIpoib , InfoKind , InfoMacSec , InfoMacVlan ,
13- InfoMacVtap , InfoSitTun , InfoTun , InfoVeth , InfoVlan , InfoVrf , InfoVti ,
14- InfoVxlan , InfoXfrm ,
12+ InfoGtp , InfoHsr , InfoIpVlan , InfoIpVtap , InfoIpoib , InfoKind , InfoMacSec ,
13+ InfoMacVlan , InfoMacVtap , InfoSitTun , InfoTun , InfoVeth , InfoVlan , InfoVrf ,
14+ InfoVti , InfoVxlan , InfoXfrm ,
1515} ;
1616
1717const IFLA_INFO_DATA : u16 = 2 ;
@@ -26,6 +26,7 @@ pub enum InfoData {
2626 Vxlan ( Vec < InfoVxlan > ) ,
2727 Bond ( Vec < InfoBond > ) ,
2828 IpVlan ( Vec < InfoIpVlan > ) ,
29+ IpVtap ( Vec < InfoIpVtap > ) ,
2930 MacVlan ( Vec < InfoMacVlan > ) ,
3031 MacVtap ( Vec < InfoMacVtap > ) ,
3132 GreTap ( Vec < InfoGreTap > ) ,
@@ -51,6 +52,7 @@ impl Nla for InfoData {
5152 Self :: Vlan ( nlas) => nlas. as_slice ( ) . buffer_len ( ) ,
5253 Self :: Veth ( msg) => msg. buffer_len ( ) ,
5354 Self :: IpVlan ( nlas) => nlas. as_slice ( ) . buffer_len ( ) ,
55+ Self :: IpVtap ( nlas) => nlas. as_slice ( ) . buffer_len ( ) ,
5456 Self :: Ipoib ( nlas) => nlas. as_slice ( ) . buffer_len ( ) ,
5557 Self :: MacVlan ( nlas) => nlas. as_slice ( ) . buffer_len ( ) ,
5658 Self :: MacVtap ( nlas) => nlas. as_slice ( ) . buffer_len ( ) ,
@@ -78,6 +80,7 @@ impl Nla for InfoData {
7880 Self :: Vlan ( nlas) => nlas. as_slice ( ) . emit ( buffer) ,
7981 Self :: Veth ( msg) => msg. emit ( buffer) ,
8082 Self :: IpVlan ( nlas) => nlas. as_slice ( ) . emit ( buffer) ,
83+ Self :: IpVtap ( nlas) => nlas. as_slice ( ) . emit ( buffer) ,
8184 Self :: Ipoib ( nlas) => nlas. as_slice ( ) . emit ( buffer) ,
8285 Self :: MacVlan ( nlas) => nlas. as_slice ( ) . emit ( buffer) ,
8386 Self :: MacVtap ( nlas) => nlas. as_slice ( ) . emit ( buffer) ,
@@ -182,6 +185,17 @@ impl InfoData {
182185 }
183186 InfoData :: IpVlan ( v)
184187 }
188+ InfoKind :: IpVtap => {
189+ let mut v = Vec :: new ( ) ;
190+ for nla in NlasIterator :: new ( payload) {
191+ let nla = & nla. context ( format ! (
192+ "invalid IFLA_INFO_DATA for {kind} {payload:?}"
193+ ) ) ?;
194+ let parsed = InfoIpVtap :: parse ( nla) ?;
195+ v. push ( parsed) ;
196+ }
197+ InfoData :: IpVtap ( v)
198+ }
185199 InfoKind :: MacVlan => {
186200 let mut v = Vec :: new ( ) ;
187201 for nla in NlasIterator :: new ( payload) {
0 commit comments