1use crate::structs::FlowId;
2
3#[cfg(feature = "net_injection")]
4pub mod fast;
6#[cfg(feature = "net_injection")]
7pub use fast::start_fast;
8#[cfg(feature = "net_injection")]
9pub mod reliable;
11#[cfg(feature = "net_injection")]
12pub use reliable::start_reliable;
13
14#[cfg(all(
15 any(target_os = "windows", target_os = "linux"),
16 feature = "ebpf",
17 feature = "net_injection"
18))]
19pub mod ebpf;
21#[cfg(all(target_os = "linux", feature = "iptables", feature = "net_injection"))]
22pub mod iptables;
24
25pub trait NetEnabler: Clone + std::marker::Send + 'static {
27 fn get_ttl(&self) -> Option<u8>;
28
29 fn is_packet_relevant(&self, flags: u8) -> bool;
31
32 fn is_fast(&self) -> bool;
34
35 fn close_session(&self, f: &FlowId);
37
38 fn open_session(&self, f: &FlowId);
40}
41
42#[derive(Debug, Clone)]
43pub struct DummyNetEnabler {}
45
46impl NetEnabler for DummyNetEnabler {
47 fn is_packet_relevant(&self, _: u8) -> bool {
48 false
49 }
50 fn is_fast(&self) -> bool {
51 false
52 }
53 fn close_session(&self, _: &FlowId) {}
54 fn open_session(&self, _: &FlowId) {}
55 fn get_ttl(&self) -> Option<u8> {
56 None
57 }
58}