Crates.io | nell |
lib.rs | nell |
version | 0.3.0 |
source | src |
created_at | 2018-03-13 18:47:02.745715 |
updated_at | 2020-06-07 04:21:39.740103 |
description | Linux netlink interface |
homepage | |
repository | |
max_upload_size | |
id | 55402 |
size | 126,067 |
nell provides a Rust interface to the Linux netlink subsystem including both low level messaging and a higher level API for accessing link, address, and routing information, socket diag info, etc.
let mut sock = Socket::new(Family::ROUTE)?;
let mut msg = Message::<rtgenmsg>::new(RTM_GETLINK);
msg.set_flags(NLM_F_REQUEST | NLM_F_DUMP);
msg.rtgen_family = AF_UNSPEC;
sock.send(&msg)?;
while let Msg(msg) = sock.recv::<ifinfomsg>()? {
let link = link(&msg)?;
println!("{:?}", link);
}
Copyright (C) 2017 - Will Glozer
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.