rustnet_host/linux/
mod.rs1mod process;
4
5#[cfg(feature = "ebpf")]
6pub mod ebpf;
7#[cfg(feature = "ebpf")]
8mod enhanced;
9
10pub use process::LinuxProcessLookup;
11
12use crate::ProcessLookup;
13use anyhow::Result;
14
15pub fn create_process_lookup(_use_pktap: bool) -> Result<Box<dyn ProcessLookup>> {
19 #[cfg(feature = "ebpf")]
20 {
21 match enhanced::EnhancedLinuxProcessLookup::new() {
23 Ok(enhanced) => {
24 log::info!("Using enhanced Linux process lookup (eBPF + procfs)");
25 return Ok(Box::new(enhanced));
26 }
27 Err(e) => {
28 log::warn!(
29 "Enhanced lookup failed, falling back to basic procfs: {}",
30 e
31 );
32 }
33 }
34 }
35 log::info!("Using Linux process lookup (procfs)");
37 Ok(Box::new(LinuxProcessLookup::new()?))
38}