pub struct EbpfFirewall { /* private fields */ }Expand description
eBPF Firewall Manager
Implementations§
Source§impl EbpfFirewall
impl EbpfFirewall
Sourcepub fn load_program(
&mut self,
name: String,
program_type: ProgramType,
bytecode: Vec<u8>,
) -> Result<u32, EbpfError>
pub fn load_program( &mut self, name: String, program_type: ProgramType, bytecode: Vec<u8>, ) -> Result<u32, EbpfError>
Load eBPF program
Sourcepub fn attach_socket(
&mut self,
fd: i32,
program_name: &str,
) -> Result<(), EbpfError>
pub fn attach_socket( &mut self, fd: i32, program_name: &str, ) -> Result<(), EbpfError>
Attach program to socket
Sourcepub fn get_zero_copy_buffer(
&self,
fd: i32,
size: usize,
) -> Result<ZeroCopyBuffer, EbpfError>
pub fn get_zero_copy_buffer( &self, fd: i32, size: usize, ) -> Result<ZeroCopyBuffer, EbpfError>
Get zero-copy buffer for socket
Sourcepub fn process_packet(
&mut self,
packet: &[u8],
socket_fd: i32,
) -> Result<PacketAction, EbpfError>
pub fn process_packet( &mut self, packet: &[u8], socket_fd: i32, ) -> Result<PacketAction, EbpfError>
Process packet through firewall
Sourcepub fn get_performance_stats(&self) -> PerformanceStats
pub fn get_performance_stats(&self) -> PerformanceStats
Get performance statistics
Sourcepub fn get_socket_stats(&self, fd: i32) -> Option<SocketStats>
pub fn get_socket_stats(&self, fd: i32) -> Option<SocketStats>
Get socket statistics
Sourcepub fn get_program_stats(&self, program_id: u32) -> Option<ProgramStats>
pub fn get_program_stats(&self, program_id: u32) -> Option<ProgramStats>
Get program statistics
Sourcepub fn list_sockets(&self) -> Vec<i32>
pub fn list_sockets(&self) -> Vec<i32>
List all sockets
Sourcepub fn list_programs(&self) -> Vec<String>
pub fn list_programs(&self) -> Vec<String>
List all programs
Sourcepub fn list_rules(&self) -> Vec<FirewallRule>
pub fn list_rules(&self) -> Vec<FirewallRule>
List all firewall rules
Auto Trait Implementations§
impl Freeze for EbpfFirewall
impl RefUnwindSafe for EbpfFirewall
impl Send for EbpfFirewall
impl Sync for EbpfFirewall
impl Unpin for EbpfFirewall
impl UnsafeUnpin for EbpfFirewall
impl UnwindSafe for EbpfFirewall
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more