feat: added tcp

sorry Judah
This commit is contained in:
Andrew Rioux
2025-02-12 17:49:31 -05:00
parent e388b2eefa
commit f9ff9f266a
37 changed files with 1939 additions and 902 deletions

View File

@@ -92,6 +92,7 @@ extern "C" {
pub fn rtnl_link_get_name(link: *mut rtnl_link) -> *const c_char;
pub fn rtnl_link_get_ifindex(link: *mut rtnl_link) -> c_int;
pub fn rtnl_link_get_type(link: *mut rtnl_link) -> *const c_char;
pub fn rtnl_link_get_mtu(link: *mut rtnl_link) -> c_uint;
pub fn rtnl_route_alloc_cache(
sock: *mut nl_sock,

View File

@@ -91,6 +91,11 @@ impl Link {
}
}
/// Returns the MTU of the link
pub fn mtu(&self) -> u32 {
unsafe { rtnl_link_get_mtu(self.link) }
}
/// Determines the type of link. Ethernet devices are "veth or eth"
pub fn ltype(&self) -> Option<String> {
unsafe {