nell 0.3.0

Linux netlink interface
Documentation
// 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::<cn_proc_event>()? {
        println!("{:?}", msg.event());
    }

    Ok(())
}