Skip to main content

NlMsg

Trait NlMsg 

Source
pub unsafe trait NlMsg {
    // Required method
    unsafe fn write(&self, buf: *mut c_void, seq: u32, msg_type: MsgType);
}
Expand description

Trait for all types in this crate that can serialize to a Netlink message.

§Safety

This trait is unsafe to implement because it must never serialize to anything larger than the largest possible netlink message. Internally the nft_nlmsg_maxsize function is used to make sure the buf pointer passed to write always has room for the largest possible Netlink message.

Required Methods§

Source

unsafe fn write(&self, buf: *mut c_void, seq: u32, msg_type: MsgType)

Serializes the Netlink message to the buffer at buf. buf must have space for at least nft_nlmsg_maxsize() bytes. This is not checked by the compiler, which is why this method is unsafe.

§Safety

The caller must pass a buf with enough space for the largest possible netlink message. This size can be obtained with nft_nlmsg_maxsize.

Implementors§

Source§

impl NlMsg for Chain<'_>

Source§

impl NlMsg for Rule<'_>

Source§

impl NlMsg for Table

Source§

impl<K> NlMsg for Set<'_, K>

Source§

impl<K> NlMsg for SetElemsMsg<'_, K>