pub type OpenMapMut<'obj> = OpenMapImpl<'obj, Mut>;
Expand description
A mutable parsed but not yet loaded BPF map.
Aliased Type§
struct OpenMapMut<'obj> { /* private fields */ }
Implementations§
Source§impl<'obj> OpenMapMut<'obj>
impl<'obj> OpenMapMut<'obj>
Sourcepub fn new_mut(object: &'obj mut bpf_map) -> Self
pub fn new_mut(object: &'obj mut bpf_map) -> Self
Create a new OpenMapMut
from a ptr to a libbpf_sys::bpf_map
.
Sourcepub fn initial_value_mut(&mut self) -> Option<&mut [u8]>
pub fn initial_value_mut(&mut self) -> Option<&mut [u8]>
Retrieve the initial value of the map.
Sourcepub fn set_map_ifindex(&mut self, idx: u32)
pub fn set_map_ifindex(&mut self, idx: u32)
Bind map to a particular network device.
Used for offloading maps to hardware.
Sourcepub fn set_initial_value(&mut self, data: &[u8]) -> Result<()>
pub fn set_initial_value(&mut self, data: &[u8]) -> Result<()>
Set the initial value of the map.
Sourcepub fn set_key_size(&mut self, size: u32) -> Result<()>
pub fn set_key_size(&mut self, size: u32) -> Result<()>
Set the key size of the map in bytes.
Sourcepub fn set_value_size(&mut self, size: u32) -> Result<()>
pub fn set_value_size(&mut self, size: u32) -> Result<()>
Set the value size of the map in bytes.
Sourcepub fn set_max_entries(&mut self, count: u32) -> Result<()>
pub fn set_max_entries(&mut self, count: u32) -> Result<()>
Set the maximum number of entries this map can have.
Sourcepub fn set_map_flags(&mut self, flags: u32) -> Result<()>
pub fn set_map_flags(&mut self, flags: u32) -> Result<()>
Set flags on this map.
pub fn set_numa_node(&mut self, numa_node: u32) -> Result<()>
pub fn set_inner_map_fd(&mut self, inner_map_fd: BorrowedFd<'_>) -> Result<()>
pub fn set_map_extra(&mut self, map_extra: u64) -> Result<()>
Sourcepub fn set_autocreate(&mut self, autocreate: bool) -> Result<()>
pub fn set_autocreate(&mut self, autocreate: bool) -> Result<()>
Set whether or not libbpf should automatically create this map during load phase.
Sourcepub fn set_pin_path<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
pub fn set_pin_path<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
Set where the map should be pinned.
Note this does not actually create the pin.
Sourcepub fn reuse_fd(&mut self, fd: BorrowedFd<'_>) -> Result<()>
pub fn reuse_fd(&mut self, fd: BorrowedFd<'_>) -> Result<()>
Reuse an fd for a BPF map