// Copyright (C) 2019 - Will Glozer. All rights reserved. use anyhow::Result; use nell::{Family, Netlink, Socket}; use nell::api::proc::{subscribe, Op}; use nell::ffi::*; use Netlink::Msg; fn main() -> Result<()> { let mut sock = Socket::new(Family::CONNECTOR)?; sock.bind(0, CN_IDX_PROC)?; sock.send(&subscribe(Op::Listen))?; while let Msg(msg) = sock.recv::()? { println!("{:?}", msg.event()); } Ok(()) }