You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aya/test/cases/010_load/000_name/name_test.rs

21 lines
538 B
Rust

//! ```cargo
//! [dependencies]
//! aya = { path = "../../../../aya" }
//! ```
use aya::{
Bpf,
programs::{Xdp, XdpFlags},
};
use std::convert::TryInto;
use std::{thread, time};
fn main() {
println!("Loading XDP program");
let mut bpf = Bpf::load_file("name_test.o").unwrap();
let dispatcher: &mut Xdp = bpf.program_mut("ihaveaverylongname").unwrap().try_into().unwrap();
dispatcher.load().unwrap();
dispatcher.attach("eth0", XdpFlags::default()).unwrap();
thread::sleep(time::Duration::from_secs(20));
}