pub struct PolicyEngine { /* private fields */ }Expand description
Policy evaluation engine.
Evaluates NetworkPolicy rules against parsed frames, using first-match-wins
semantics. Domain-based rules check the DnsPinSet to see if the destination
IP was resolved from a matching domain.
Implementations§
Source§impl PolicyEngine
impl PolicyEngine
Sourcepub fn new(policy: NetworkPolicy, pin_set: Arc<RwLock<DnsPinSet>>) -> Self
pub fn new(policy: NetworkPolicy, pin_set: Arc<RwLock<DnsPinSet>>) -> Self
Creates a new policy engine with the given policy and pin set.
Sourcepub fn evaluate(&self, frame: &ParsedFrame<'_>, direction: Direction) -> Action
pub fn evaluate(&self, frame: &ParsedFrame<'_>, direction: Direction) -> Action
Evaluates a parsed frame against the policy.
Returns the action to take (Allow or Deny). Uses first-match-wins: the first rule whose direction, destination, protocol, and ports all match determines the action. If no rule matches, the default action is returned.
Auto Trait Implementations§
impl Freeze for PolicyEngine
impl RefUnwindSafe for PolicyEngine
impl Send for PolicyEngine
impl Sync for PolicyEngine
impl Unpin for PolicyEngine
impl UnsafeUnpin for PolicyEngine
impl UnwindSafe for PolicyEngine
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