Skip to content

expose link statistics as part of getifaddrs #2704

@Luca-spopo

Description

@Luca-spopo

Hello, first of all thank you for maintaining this amazing project.

nix::ifaddrs::InterfaceAddress is missing the field ifa_data, which is present in libc::ifaddrs

libc's ifa_data of type *mut c_void can point to a struct of type rtnl_link_stats when the address family is AF_PACKET. This struct contains useful statistics about the interface.

I would like to be able to get that info from the call to nix's getifaddrs.

My proposal is that we can expose a new field in InterfaceAddress:

pub link_stats: Option<LinkStats>,

LinkStats would be our representation of the fields in rtnl_link_stats which we can write by hand, or we can use the rtnl_link_stats struct provided by linux_raw_sys

I can make a PR for this code change if the proposal makes sense

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions