Skip to main content

walk_raw_sockets

Function walk_raw_sockets 

Source
pub fn walk_raw_sockets<P: PhysicalMemoryProvider>(
    reader: &ObjectReader<P>,
) -> Result<Vec<RawSocketInfo>>
Expand description

Walk the task list and enumerate all open raw sockets.

Walks task_struct.files -> files_struct.fdt -> fdtable.fd[], then for each open file checks whether it is a raw socket by probing the kernel socket struct fields.

Gracefully returns Ok(vec![]) if any required symbol is absent so that callers on unexpected kernel versions are not broken.