Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for extended ACK #16

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,22 @@ impl Socket {
)?;
Ok(res == 1)
}

/// `NETLINK_EXT_ACK`
/// Extended ACK controls reporting of additional error/warning TLVs in NLMSG_ERROR and NLMSG_DONE messages.
pub fn set_ext_ack(&mut self, value: bool) -> Result<()> {
let value: libc::c_int = value.into();
setsockopt(self.0, libc::SOL_NETLINK, libc::NETLINK_EXT_ACK, value)
}

pub fn get_ext_ack(&self) -> Result<bool> {
let res = getsockopt::<libc::c_int>(
self.0,
libc::SOL_NETLINK,
libc::NETLINK_EXT_ACK,
)?;
Ok(res == 1)
}
}

/// Wrapper around `getsockopt`:
Expand Down
Loading