@@ -211,6 +211,7 @@ pub type MplsBos = u8;
211
211
pub type MplsTc = u8 ;
212
212
pub type MplsLabel = u32 ;
213
213
pub type TcpFlagsMask = u8 ;
214
+ pub type IpTos = u8 ;
214
215
215
216
bitflags ! {
216
217
// TcpFlags _ARE_ exactly 8 bits.
@@ -1370,6 +1371,7 @@ pub enum TcFilterFlowerOption {
1370
1371
KeyMplsLabel ( MplsLabel ) ,
1371
1372
KeyTcpFlags ( TcpFlags ) ,
1372
1373
KeyTcpFlagsMask ( TcpFlagsMask ) ,
1374
+ KeyIpTos ( IpTos ) ,
1373
1375
}
1374
1376
1375
1377
impl Nla for TcFilterFlowerOption {
@@ -1445,6 +1447,7 @@ impl Nla for TcFilterFlowerOption {
1445
1447
Self :: KeyMplsLabel ( _) => 4 ,
1446
1448
Self :: KeyTcpFlags ( _) => 2 ,
1447
1449
Self :: KeyTcpFlagsMask ( _) => 2 ,
1450
+ Self :: KeyIpTos ( _) => 1 ,
1448
1451
Self :: Other ( attr) => attr. value_len ( ) ,
1449
1452
}
1450
1453
}
@@ -1525,6 +1528,7 @@ impl Nla for TcFilterFlowerOption {
1525
1528
Self :: KeyMplsLabel ( _) => TCA_FLOWER_KEY_MPLS_LABEL ,
1526
1529
Self :: KeyTcpFlags ( _) => TCA_FLOWER_KEY_TCP_FLAGS ,
1527
1530
Self :: KeyTcpFlagsMask ( _) => TCA_FLOWER_KEY_TCP_FLAGS_MASK ,
1531
+ Self :: KeyIpTos ( _) => TCA_FLOWER_KEY_IP_TOS ,
1528
1532
Self :: Other ( attr) => attr. kind ( ) ,
1529
1533
}
1530
1534
}
@@ -1676,6 +1680,7 @@ impl Nla for TcFilterFlowerOption {
1676
1680
Self :: KeyTcpFlagsMask ( flags) => {
1677
1681
buffer. copy_from_slice ( ( * flags as u16 ) . to_be_bytes ( ) . as_slice ( ) )
1678
1682
}
1683
+ Self :: KeyIpTos ( tos) => buffer. copy_from_slice ( & [ * tos] . as_slice ( ) ) ,
1679
1684
Self :: Other ( attr) => attr. emit_value ( buffer) ,
1680
1685
}
1681
1686
}
0 commit comments