use netlink_bindings::rt_link;
#[cfg_attr(not(feature = "async"), maybe_async::must_be_sync)]
#[cfg_attr(feature = "tokio", tokio::main(flavor = "current_thread"))]
#[cfg_attr(feature = "smol", macro_rules_attribute::apply(smol_macros::main))]
async fn main() {
let mut request = rt_link::Request::new()
.set_create()
.op_newlink_do(&rt_link::Ifinfomsg::new());
request
.encode()
.push_ifname(c"12345678901234567890") .nested_linkinfo()
.push_kind(c"bridge");
let mut sock = netlink_socket2::NetlinkSocket::new();
let mut iter = sock.request(&request).await.unwrap();
while let Some(res) = iter.recv().await {
println!("{:?}", res);
}
}