#[non_exhaustive]pub struct NetlinkHeader {
pub length: u32,
pub message_type: u16,
pub flags: u16,
pub sequence_number: u32,
pub port_number: u32,
}
Expand description
A Netlink header representation. A netlink header has the following structure:
0 8 16 24 32
+----------------+----------------+----------------+----------------+
| packet length (including header) |
+----------------+----------------+----------------+----------------+
| message type | flags |
+----------------+----------------+----------------+----------------+
| sequence number |
+----------------+----------------+----------------+----------------+
| port number (formerly known as PID) |
+----------------+----------------+----------------+----------------+
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.length: u32
Length of the netlink packet, including the header and the payload
message_type: u16
NetlinkMessage type. The meaning of this field depends on the netlink protocol family in use.
flags: u16
Flags. It should be set to one of the NLM_F_*
constants.
sequence_number: u32
Sequence number of the packet
port_number: u32
Port number (usually set to the the process ID)
Trait Implementations§
Source§impl Clone for NetlinkHeader
impl Clone for NetlinkHeader
Source§fn clone(&self) -> NetlinkHeader
fn clone(&self) -> NetlinkHeader
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NetlinkHeader
impl Debug for NetlinkHeader
Source§impl Default for NetlinkHeader
impl Default for NetlinkHeader
Source§fn default() -> NetlinkHeader
fn default() -> NetlinkHeader
Returns the “default value” for a type. Read more
Source§impl Emitable for NetlinkHeader
impl Emitable for NetlinkHeader
Source§impl Hash for NetlinkHeader
impl Hash for NetlinkHeader
Source§impl<'a, T: AsRef<[u8]> + ?Sized> Parseable<NetlinkBuffer<&'a T>> for NetlinkHeader
impl<'a, T: AsRef<[u8]> + ?Sized> Parseable<NetlinkBuffer<&'a T>> for NetlinkHeader
type Error = DecodeError
Source§fn parse(buf: &NetlinkBuffer<&'a T>) -> Result<NetlinkHeader, DecodeError>
fn parse(buf: &NetlinkBuffer<&'a T>) -> Result<NetlinkHeader, DecodeError>
Deserialize the current type.
Source§impl PartialEq for NetlinkHeader
impl PartialEq for NetlinkHeader
impl Copy for NetlinkHeader
impl Eq for NetlinkHeader
impl StructuralPartialEq for NetlinkHeader
Auto Trait Implementations§
impl Freeze for NetlinkHeader
impl RefUnwindSafe for NetlinkHeader
impl Send for NetlinkHeader
impl Sync for NetlinkHeader
impl Unpin for NetlinkHeader
impl UnwindSafe for NetlinkHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)