|
1 | 1 | // SPDX-License-Identifier: MIT |
2 | 2 |
|
3 | | -use anyhow::Context; |
4 | | -use byteorder::{ByteOrder, NativeEndian}; |
5 | | -use netlink_packet_utils::{ |
6 | | - nla::{DefaultNla, Nla, NlaBuffer, NlasIterator, NLA_F_NESTED}, |
7 | | - parsers::{parse_u32, parse_u8}, |
8 | | - DecodeError, Emitable, Parseable, |
| 3 | +use netlink_packet_core::{ |
| 4 | + emit_u32, parse_u32, parse_u8, DecodeError, DefaultNla, Emitable, |
| 5 | + ErrorContext, Nla, NlaBuffer, NlasIterator, Parseable, NLA_F_NESTED, |
9 | 6 | }; |
10 | 7 |
|
11 | 8 | use crate::{EthtoolAttr, EthtoolHeader}; |
@@ -145,9 +142,7 @@ impl Nla for EthtoolCoalesceAttr { |
145 | 142 | | Self::RxMaxFramesHigh(d) |
146 | 143 | | Self::TxUsecsHigh(d) |
147 | 144 | | Self::TxMaxFramesHigh(d) |
148 | | - | Self::RateSampleInterval(d) => { |
149 | | - NativeEndian::write_u32(buffer, *d) |
150 | | - } |
| 145 | + | Self::RateSampleInterval(d) => emit_u32(buffer, *d).unwrap(), |
151 | 146 | Self::UseAdaptiveRx(d) | Self::UseAdaptiveTx(d) => { |
152 | 147 | buffer[0] = (*d).into() |
153 | 148 | } |
|
0 commit comments