pub struct NetworkState {
pub network_policy: NetworkPolicy,
pub port_map: PortMap,
pub pid_ip_overrides: Arc<RwLock<HashMap<u32, HashSet<IpAddr>>>>,
pub http_acl_addr: Option<SocketAddr>,
pub http_acl_ports: HashSet<u16>,
pub http_acl_orig_dest: Option<Arc<RwLock<HashMap<SocketAddr, IpAddr>>>>,
}Expand description
Network policy and port-remapping state.
Fields§
§network_policy: NetworkPolicyGlobal network policy: unrestricted or limited to a set of IPs.
port_map: PortMapPort binding and remapping tracker.
pid_ip_overrides: Arc<RwLock<HashMap<u32, HashSet<IpAddr>>>>Per-PID network overrides from policy_fn.
http_acl_addr: Option<SocketAddr>HTTP ACL proxy address (None if HTTP ACL not active).
http_acl_ports: HashSet<u16>TCP ports to intercept and redirect to the HTTP ACL proxy.
http_acl_orig_dest: Option<Arc<RwLock<HashMap<SocketAddr, IpAddr>>>>Shared map for recording original destination IPs on proxy redirect.
Implementations§
Source§impl NetworkState
impl NetworkState
pub fn new() -> Self
Sourcepub fn effective_network_policy(
&self,
pid: u32,
live_policy: Option<&Arc<RwLock<LivePolicy>>>,
) -> NetworkPolicy
pub fn effective_network_policy( &self, pid: u32, live_policy: Option<&Arc<RwLock<LivePolicy>>>, ) -> NetworkPolicy
Get the effective network policy for a PID.
Priority: per-PID override > live policy (from PolicyFnState) > global network_policy.
The live_policy parameter allows checking the live policy without needing
to lock the PolicyFnState mutex.
Auto Trait Implementations§
impl Freeze for NetworkState
impl !RefUnwindSafe for NetworkState
impl Send for NetworkState
impl Sync for NetworkState
impl Unpin for NetworkState
impl UnsafeUnpin for NetworkState
impl !UnwindSafe for NetworkState
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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